Board index FlightGear Development Scenery

FGBlenderTools - FlightGear Development Tools (Blender)

Questions and discussion about enhancing and populating the FlightGear world.

FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Sat Sep 01, 2018 9:19 pm

I'm officially releasing the initial version of FGBlenderTools.
Blender v2.79 is supported.
Python v3.7 is not supported.

Refer to the README.MD file for installation and usage instructions.
https://sourceforge.net/projects/xdraconian-fgscenery/files/

Note: Blender v2.80 is not supported. v2.80 has not been released by Blender.org and the python API is going through design changes. Blender has not yet informed the community to begin add-on upgrades - we're being told to wait until the API is stable.

Note: My pre-release instructions were to install into the addon_contrib folder. I changed this to target the addons folder because it is more intuitive and now this package is officially released.

I hope you find it useful. Feedback is welcome.

<Edit>
It seems that installing pyproj compiles the necessary proj.4 library. Therefore, you can skip the instructions about installing Proj.4.

<Edit>
Don't use Python 3.7. I just confirmed the same error other users with Python 3.7 have been reporting.

Instructions for Windows:
Use Python 3.6 (latest is 3.6.6)
Via File Explorer, navigate to c:\Python36 (or wherever you happened to have it installed)
You will see file python.exe in this folder
In the File Explorer path field (top of the window), type:
Code: Select all
cmd

This will open a Command Terminal at c:\Python36
Run:
Code: Select all
.\python -m pip install -U pip
.\python -m pip install -U setuptools
.\python -m pip install -U cython
.\python -m pip install -U pyshp
.\python -m pip install -U pyproj


The packages will be installed within folder
Code: Select all
c:\Python36\Lib\site-packages


Copy the packages into Blender's python folder:
Code: Select all
<blender>\2.79\python\lib\site-packages
Last edited by xDraconian on Tue Sep 04, 2018 4:38 am, edited 1 time in total.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby ctesc356 » Mon Sep 03, 2018 8:06 am

Hello,
have his error by "Enable the checkbox for FlightGear Development Tools"
File "/home/... /2.79/python/lib/python3.5/pyproj/__init__.py", line 51, in <module>
from pyproj import _proj
ImportError: cannot import name '_proj'

Module "pyproj" is present in the blender 's python

Os: debian testing
ctesc356
 
Posts: 46
Joined: Wed Aug 25, 2010 8:20 am

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Mon Sep 03, 2018 3:22 pm

ctesc356 wrote in Mon Sep 03, 2018 8:06 am:have his error by "Enable the checkbox for FlightGear Development Tools"


@ctesc356,

Look inside your pyproj folder and confirm that there are three files in there.
    datadir.py
    __init__.py
    _proj.cpython-36m-x86_64-linux-gnu.so

Your error seems to indicate that the last one is missing. Likely due to a failed compile.
Also confirm that the data files exist. If you open up datadir.py you can see where is it expecting to find those data files.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby ctesc356 » Mon Sep 03, 2018 9:41 pm

Thanks for the reply.
the files are present.
i have also "_proj.cpython-37m-x86_64-linux-gnu.so"

in "datadir.py" :
import os

if 'PROJ_DIR' in os.environ:
pyproj_datadir = os.environ['PROJ_DIR']
else:
pyproj_datadir = "/usr/share/proj/"

"/usr/share/proj/" folder contains 36 files (total 19.4 Mo)

Installed "pyproj" is: python3-pyproj 1.9.5.1-4 from Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
ctesc356
 
Posts: 46
Joined: Wed Aug 25, 2010 8:20 am

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Tue Sep 04, 2018 12:20 am

@ctesc356

I appears that your version differs from mine. I have 31 files @ 15.1 MB. You seem to be running Python3.7m while I'm running Python3.6m.
Neither of these differences would I expect to cause a problem.

ctesc356 wrote in Mon Sep 03, 2018 9:41 pm:i have also "_proj.cpython-37m-x86_64-linux-gnu.so"

You shouldn't have more than one _proj.so file. If you do have more than one then that may explain the issue you are seeing.

Please try this from the Terminal window:
Code: Select all
python3 -c "import pyproj; pyproj.test()"

and then try this within the Blender Python Console
Code: Select all
import pyproj; pyproj.test()


Please let me know your results.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Tue Sep 04, 2018 4:39 am

Confirmed the same error with Python 3.7. I've update the initial post with further instructions.
Thanks for the testing and reporting the issue.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby ctesc356 » Tue Sep 04, 2018 8:33 am

Ok, i have a "python mismatch" in my system :D
Debian "Buster"(testing) comes with python 2.7, 3.6 and 3.7
Blender 279 comes with python 3.5

In "pyproj" from blender, i delete "_proj.cpython-37m-x86_64-linux-gnu.so" and rename "_proj.cpython-36m-x86_64-linux-gnu.so" to "_proj.cpython-35m-x86_64-linux-gnu.so"

The tests passed, i have a warning the first pass, but the script works.
Shapefiles are created and tested as ok in qgis.

Another question:
Is it complicated to write a script to export from blender to btg?
Ok, "Export funtionality is not intended due to the complications this would impose upon automated scenery regeneration."

But in some cases it would be interesting to have this functionality.

For example: creation of altiports, with slopes.
Tg construct creates undesirable embankments that can be removed.
ctesc356
 
Posts: 46
Joined: Wed Aug 25, 2010 8:20 am

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Tue Sep 04, 2018 2:40 pm

ctesc356 wrote in Tue Sep 04, 2018 8:33 am:The tests passed, i have a warning the first pass, but the script works.
Shapefiles are created and tested as ok in qgis.

Thank you for testing @ctesc356. I'm glad you got it resolved.

ctesc356 wrote in Tue Sep 04, 2018 8:33 am:Is it complicated to write a script to export from blender to btg?

No more difficult that the import process.

Keep in mind that Terragear would overwrite the BTG, so ideally, if we allow edits and export of the BTG, we would also need to modify the underlying HGT file which defined the BTG.
This is where the complexity arises. Rather than modifying the HGT I would prefer a design that informs Terragear that the terrain contained some manual edits. Sort of a heightmap delta that represented the edits that were performed. The advantage being Terragear would replay those edits regardless of where the user retrieved their HGT file. Potentially even replaying the edits on something other than an HGT format.

Perhaps it could be added in the future, but I believe there are easier productivity tools the FG content community would benefit from.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby portreekid » Fri Sep 07, 2018 1:20 pm

I'm having problems. I can't really pinpoint them. __init__.py seems to be running fine (after setting FG_ROOT), but the Misc menu isn't showing up.
Image

Am I blind?
portreekid
 
Posts: 336
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Fri Sep 07, 2018 5:16 pm

portreekid wrote in Fri Sep 07, 2018 1:20 pm: ... but the Misc menu isn't showing up.

It does not show up until you inform Blender that you are working on a FlightGear scene.
Your screenshot shows you on the "Render" tab [camera icon]
Select "Scene" tab (two icons to the right of Render) and then expand the FlightGear panel.
Then choose Scenery - Terrain
At this point the Misc tab will be visible on the left edge, below Grease Pencil.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby portreekid » Sat Sep 08, 2018 7:56 pm

Obviously I am not fit enough in Blender. ;-) Awesome work. We now have a possibility to retrieve the shapefiles.
portreekid
 
Posts: 336
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby slawekmikula » Sat Sep 08, 2018 9:22 pm

Hi scott,

Installation under ubuntu 18.04

Code: Select all
sudo apt-get install python3-pyproj python3-pyshp


Next open blender (default distro binary) and go to preferences/addons. There is on the bottom side button to "Install addon from File...". Select io_scene_flightgear.zip (extracted from SF download).

IMPORTANT. There should be FG_ROOT environment variable set in order to load the extension. If not following error occurs:

Image

So in console:
Code: Select all
$ export FG_ROOT=<where is your fgdata folder>
$ blender


Scott, maybe some workaround with this (information where to set it without exception or define it in addon configuration ?

Another quirks:
- stg/btg selector - it would be great if they remember last used location
- stg/btg paths - one shows full path, second one (btg) only filename
- loading simple stg/btg works fine but loading tile #3269679 (poland, cracow, city centre, nearest airport EPKK) gives following error in the console (had to terminate blender)

Code: Select all
blender(+0x1049c68) [0x56103d9d0c68]
blender(wm_event_do_handlers+0x1e5) [0x56103d9d0f85]
blender(WM_main+0x18) [0x56103d9c7ce8]
blender(main+0x38f) [0x56103d986c8f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f8f432fab97]
blender(_start+0x2a) [0x56103d9c3b2a]
BLI_assert failed: /build/blender-UBljLx/blender-2.79.b+dfsg0/source/blender/blenlib/intern/edgehash.c:95, edgehash_bucket_index(), at 'v0 < v1'

slawekmikula
 
Posts: 51
Joined: Sun Feb 19, 2017 9:31 am

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Sun Sep 09, 2018 5:46 am

portreekid wrote in Sat Sep 08, 2018 7:56 pm:Awesome work. We now have a possibility to retrieve the shapefiles.

Thank you @portreekid
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Sun Sep 09, 2018 5:54 am

slawekmikula wrote in Sat Sep 08, 2018 9:22 pm:IMPORTANT. There should be FG_ROOT environment variable set in order to load the extension

I thought I had included that in the instructions. Will double-check.

slawekmikula wrote in Sat Sep 08, 2018 9:22 pm:Scott, maybe some workaround with this

Good suggestion. I'll just default it to blank when FG_ROOT is missing.

slawekmikula wrote in Sat Sep 08, 2018 9:22 pm:Another quirks:
- stg/btg selector - it would be great if they remember last used location
- stg/btg paths - one shows full path, second one (btg) only filename
- loading simple stg/btg works fine but loading tile #3269679 (poland, cracow, city centre, nearest airport EPKK) gives following error in the console (had to terminate blender)

Remember prior location: I agree that this would be a valuable feature. I thought the same for Data Directory and Shapefile Save Directory, but haven't gotten to it yet.
One shows full path: If the BTG lacks the full path, it assumes the same location as the STG. Note: that STG loading is optional.
#3269679: I'll look into it. Thanks for the bug report @slawekmikula.
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: FGBlenderTools - FlightGear Development Tools (Blender)

Postby xDraconian » Sun Sep 09, 2018 6:03 am

Appreciate those of you who have given FGBlenderTools a try. Thank you!

Just wanted to mention that this version is a rework of the version I had lost. I learned my lesson and decided to release once I had a portion of it functional again.
I have much more planned for this set of tools. I'll continue to add features to it as long as their remains people that are getting value from it.

Scott
xDraconian
 
Posts: 236
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Next

Return to Scenery

Who is online

Users browsing this forum: No registered users and 8 guests