Board index FlightGear Development Scenery

Blender - Generate Shapefiles

Questions and discussion about enhancing and populating the FlightGear world.

Blender - Generate Shapefiles

Postby xDraconian » Fri Aug 31, 2018 5:04 am

I'm planning to officially release this over the weekend, but the script is quite functional at the moment.
Anyone interested in checking out the pre-release can find the scripts at my repo
https://sourceforge.net/p/xdraconian-fgscenery/code/ci/master/tree/

The scripts are located within folder FGBlenderTools

The documentation is still a work in progress, so here a brief summary of how to use the scripts within Blender v2.79:
- Copy the io_scene_flightgear folder into your Blender scripts folder
    blender/bin/2.79/scripts/addons_contrib/io_scene_flightgear
    Or install the scripts via Blender's User Preferences dialog

Enable the script via File > User Preferences > Add-ons. Set support level to "Testing" and you should see the script. Check to enable.

Load a BTG file
Delete the default objects in the scene
Select Scene in the Properties Panel
Expand the Flightgear panel
Select Terrain
Confirm your Data Root is correct (needed to find the FG textures)
Under BTG File, browse to the BTG file you wish to load
Click the Load button

Produce the ESRI Shapefiles
With the BTG loaded, click Misc tab in the Tools Panel
If the button is disabled it is because you haven't selected the object to export. Select any landclass (only one being selected is necessary)
Click Generate ESRI Shapefile

The shapefiles are written to your Blender USER folder.
If you don't know where that is, paste this into your Python console (within Blender)
bpy.utils.resource_path('USER')

If you have trouble with these instructions then I recommend you wait for the official release where I hope to have more detailed instructions.

I hope you appreciate the work I put into this and that you find it useful for maintaining the FG scenery.
Feedback is always welcome.

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

Re: Blender - Generate Shapefiles

Postby wlbragg » Fri Aug 31, 2018 7:00 am

Hi Scott, I'm really excited to try this. Should it work in Linux?

I tried to activate it in Blender scripts and I get the following error. Sorry about how I am showing you the error as it was the best I could do. I couldn't figure out how to get a text version of the error. Hope it is enough for you to troubleshoot.
I added the io folder to scripts/addons in usr/share/blender. I could see it in preferences under community/and a couple different categories. It didn't show up in testing. As soo as I click on the activate it bombed with...
Image
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Blender - Generate Shapefiles

Postby ctesc356 » Fri Aug 31, 2018 10:43 am

Hello,
it seems i have the same bug:
File "/home/ett/.config/blender/2.79/scripts/addons/io_scene_flightgear/fg_shapefile_io.py", line 36, in <module>
import shapefile
ImportError: No module named 'shapefile'

where can we find this module "shapefile"?
ctesc356
 
Posts: 74
Joined: Wed Aug 25, 2010 9:20 am

Re: Blender - Generate Shapefiles

Postby xDraconian » Fri Aug 31, 2018 5:34 pm

Thank you for the testing.

The scripts require two external python scripts:
pyproj
shapefile

you can install them via python PIP
python3 -m pip install -U pyproj
python3 -m pip install -U shapefile

ensure these packages exist within Blender's Python/dist-packages folder

wlbragg wrote in Fri Aug 31, 2018 7:00 am:Should it work in Linux?

Yes

https://pypi.org/project/pyshp/
https://pypi.org/project/pyproj/

instructions for installing PIP
https://pip.pypa.io/en/stable/installing/
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: Blender - Generate Shapefiles

Postby xDraconian » Fri Aug 31, 2018 5:58 pm

wlbragg wrote in Fri Aug 31, 2018 7:00 am:I added the io folder to scripts/addons in usr/share/blender. I could see it in preferences under community/and a couple different categories. It didn't show up in testing.

It shows up in Testing when you install it to addons_contrib. I preferred this folder since this script is not yet fully implemented.
Since you installed it within folder addons that causes the script to be found via the community tab.
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: Blender - Generate Shapefiles

Postby TribalBob » Sat Sep 01, 2018 7:32 pm

Hello.

I apologize if this a foolish question, but could I use this method to somehow generate my own terrain textured with satellite imagery...? If so, could you please outline the process for me and what tools I would need...?

I have been searching for a way to have satellite imagery for my terrain and it seems things like osgEarth and fgphotoscenery are outdated and I have no idea where to begin finding information on the current method for texturing terrain with satellite imagery as the more I search Google and the forums the more confused I get with outdated methods and information.

If I can figure out how to do it, I'd be more than happy to create a guide and share the terrain i make with the community...
Thank you for your time and any help you may be able to provide.
TribalBob
 
Posts: 47
Joined: Thu Aug 23, 2018 12:58 pm

Re: Blender - Generate Shapefiles

Postby stuart » Sat Sep 01, 2018 7:35 pm

Hi TribalBob,

I think it's unlikely that this would directly allow for phototextured scenery. The shapefiles that this generates are used as the first input stage into the FG scenery toolchain. I.e. they get assigned materials and eventually textures by FlightGear itself.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Blender - Generate Shapefiles

Postby TribalBob » Sat Sep 01, 2018 7:41 pm

stuart wrote in Sat Sep 01, 2018 7:35 pm:Hi TribalBob,

I think it's unlikely that this would directly allow for phototextured scenery. The shapefiles that this generates are used as the first input stage into the FG scenery toolchain. I.e. they get assigned materials and eventually textures by FlightGear itself.

-Stuart


Hello,

Thank you for the information. Does that mean it is not possible at all to texture the terrain with satellite imagery? Even if I create the terrain, texture it and use the UFO to delete the original terrain and place my custom terrain as an object...?
TribalBob
 
Posts: 47
Joined: Thu Aug 23, 2018 12:58 pm

Re: Blender - Generate Shapefiles

Postby wkitty42 » Sat Sep 01, 2018 8:21 pm

TribalBob wrote in Sat Sep 01, 2018 7:32 pm:I have no idea where to begin finding information on the current method for texturing terrain with satellite imagery

there is no "current method"... all that exists, at this time, is the old way with the old FG version that requires one to patch the FG source code and compile it for their system... if someone were to port that old stuff to the newer FG, then there would be a "current method"...

i thought this was made pretty clear in the other two topics about it?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9162
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: Blender - Generate Shapefiles

Postby xDraconian » Sat Sep 01, 2018 8:48 pm

TribalBob wrote in Sat Sep 01, 2018 7:32 pm:could I use this method to somehow generate my own terrain textured with satellite imagery...?

No, that is not the intended purpose of this script. This script is targeted at scenery developers wishing to maintain the default world scenery.
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: Blender - Generate Shapefiles

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

I'm officially releasing the initial version of FGBlenderTools.
Blender v2.79 is 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.
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint


Return to Scenery

Who is online

Users browsing this forum: No registered users and 5 guests