Board index FlightGear Development Scenery

Blender: Import BTG

Questions and discussion about enhancing and populating the FlightGear world.

Blender: Import BTG

Postby xDraconian » Sun Aug 19, 2018 8:09 pm

I have posted a Blender python add-on to load BTG files. Works with Blender v2.79.

If you have been keeping an old version of Blender v2.49 around so that you can use the outdated Blender_and_BTG script then it is time to upgrade. Blender v2.80 is looking very good.

https://sourceforge.net/p/xdraconian-fg ... nderTools/
xDraconian
 
Posts: 329
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: Blender: Import BTG

Postby ctesc356 » Wed Aug 22, 2018 12:38 pm

Hello,
thank you for sharing.
I have a little problem with "fg_root = os.getenv (" FG_ROOT ")
he always sends me "fg_root = None".

with a direct assignment of the path (fg_root = <path to fgdata>) it works.
ctesc356
 
Posts: 61
Joined: Wed Aug 25, 2010 8:20 am

Re: Blender: Import BTG

Postby xDraconian » Wed Aug 22, 2018 5:56 pm

ctesc356 wrote in Wed Aug 22, 2018 12:38 pm:I have a little problem with "fg_root = os.getenv (" FG_ROOT ")

FG_ROOT is an environment variable. Refer to http://wiki.flightgear.org/$FG_ROOT

On Windows
setx /m FG_ROOT c:\path\to\fgdata

On Linux
Add the following to file ~/.profile
export FG_ROOT=path/to/fgdata

Hope that resolves your issue.

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

Re: Blender: Import BTG

Postby TribalBob » Sat Sep 01, 2018 8:47 pm

Hello,

I am trying to get this working on Windows 10 following the directions on Sourceforge.

I am attempting to install pyproj via pip using the command "python3 -m pip install -U pyproj" and when I first ran it I received an error which I worked around by installing MSVC++ 14.0 but now it is throwing a new error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc -IC:\Users\SiViX\AppData\Local\Programs\Python\Python37\include -IC:\Users\SiViX\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tc_proj.c /Fobuild\temp.win-amd64-3.7\Release\_proj.obj
_proj.c
_proj.c(3709): warning C4244: 'function': conversion from 'Py_ssize_t' to 'long', possible loss of data
_proj.c(3729): warning C4244: 'function': conversion from 'Py_ssize_t' to 'long', possible loss of data
_proj.c(7421): error C2039: 'exc_type': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7422): error C2039: 'exc_value': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7423): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7435): error C2039: 'exc_type': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7436): error C2039: 'exc_value': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7437): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7438): error C2039: 'exc_type': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7439): error C2039: 'exc_value': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7440): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7483): error C2039: 'exc_type': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7484): error C2039: 'exc_value': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7485): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7486): error C2039: 'exc_type': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7487): error C2039: 'exc_value': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7488): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\sivix\appdata\local\programs\python\python37\include\pystate.h(209): note: see declaration of '_ts'
_proj.c(7845): warning C4146: unary minus operator applied to unsigned type, result still unsigned
_proj.c(7863): warning C4146: unary minus operator applied to unsigned type, result still unsigned
_proj.c(7881): warning C4146: unary minus operator applied to unsigned type, result still unsigned
_proj.c(8055): warning C4146: unary minus operator applied to unsigned type, result still unsigned
_proj.c(8073): warning C4146: unary minus operator applied to unsigned type, result still unsigned
_proj.c(8091): warning C4146: unary minus operator applied to unsigned type, result still unsigned
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

----------------------------------------
Command "C:\Users\SiViX\AppData\Local\Programs\Python\Python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SiViX\\AppData\\Local\\Temp\\pip-install-aslqpp6f\\pyproj\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\SiViX\AppData\Local\Temp\pip-record-zo1nvrpo\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\SiViX\AppData\Local\Temp\pip-install-aslqpp6f\pyproj\"


Any help you might be able to offer would be greatly appreciated (sorry, I am kinda new to all of this)
TribalBob
 
Posts: 47
Joined: Thu Aug 23, 2018 11:58 am

Re: Blender: Import BTG

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

I've now merged the BTG script into FGBlenderTools. You may find the instructions there easier. Refer to thread Blender - Generate Shapefiles
https://proj4.org/install.html#install

Based on your log, the root issue seems to be this line:
_proj.c(7421): error C2039: 'exc_type': is not a member of '_ts'

This is causing the compile to fail. With this being a holiday weekend, I don't have time to research this now. Please see if the FGBlenderTools instructions resolve the issue for you.

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

Re: Blender: Import BTG

Postby TribalBob » Sun Sep 02, 2018 12:33 am

Sounds good, I will see what I can figure out, thanks. Happy holidays!
Last edited by Gijs on Thu Sep 06, 2018 4:19 pm, edited 1 time in total.
Reason: Please don't quote the complete post above yours
TribalBob
 
Posts: 47
Joined: Thu Aug 23, 2018 11:58 am

Re: Blender: Import BTG

Postby xDraconian » Tue Sep 04, 2018 2:24 am

TribalBob wrote in Sat Sep 01, 2018 8:47 pm:I am attempting to install pyproj via pip using the command "python3 -m pip install -U pyproj" and when I first ran it I received an error which I worked around by installing MSVC++ 14.0 but now it is throwing a new error:

I'm in the process of trying to reproduce this issue on Windows 10.

My workflow for Win10 with Visual Studio 2017 Community:
Navigate via Explorer to c:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\
Open a Powershell Admin console window (Explorer File menu)
Code: Select all
./python -m pip install -U pyshp
./python -m pip install -U pyproj

Result:
pyshp successfully installed v1.2.12 in site-packages folder
pyproj successfully installed v1.9.5.1 in site-packages folder

Test:
Code: Select all
./python -c "import pyproj; pyproj.test()"

...
78 tests in 18 items.
78 passed and 0 failed.
Test passed.

@TribalBob, I'm unable to reproduce the error. Perhaps following my same workflow will resolve your issue? Please let me know if you resolve it.
xDraconian
 
Posts: 329
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: Blender: Import BTG

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

@TribalBob, @ctesc356, @Windows_Users

Don't use Python 3.7. I just confirmed the same error.

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
xDraconian
 
Posts: 329
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint


Return to Scenery

Who is online

Users browsing this forum: No registered users and 4 guests