The Flight Gear Scenery Addition Process Environment (FGSCAPE)
I have developed a scenery addition process, which is not really software but a process that involves existing features and some additional software. This makes it easy, using a UFO like object to add scenery to the Fg environment, use the export feature of the FG UFO to export the data to an XML file, and some custom Python scripts to export the data from the python script to a text file tat can be then copied and pasted to a text file to be cut and pasted into the stg file in the Flight Gear folder. Later versions will have the ability to navigate to the stg file, open it, and append the data to it, and save it.
Update: working code: 13 July 2020 1735
rd = open ("ufo-model-export.xml", "r")
# Read list of lines
out = [] # list to save lines
while True:
# Read next line
line = rd.readline()
# print(type(line))
if "OBJECT" in line:
strlen=len(line)
#print(strlen)
#print(line)
first_chars = line[33:strlen-15]
print(first_chars)
# If line is blank, then you struck the EOF
if not line :
break;
Here is the working Python code:
rd = open ("data1.xml", "r")
# Read list of lines
out = [] # list to save lines
while True:
# Read next line
line = rd.readline()
# print(type(line))
if "OBJECT" in line:
strlen=len(line)
print(strlen)
#print(line)
first_chars = line[33:strlen-15]
print(first_chars)
# If line is blank, then you struck the EOF
if not line :
break;
code adapted from: https://www.techbeamers.com/python-read-file-line-by-line/
The current Process is as follows: (tested an d working)
An example of an exported palm tree model is shown here:
<model>
<legend type="string"></legend>
<heading-deg type="double">0</heading-deg>
<pitch-deg type="double">0</pitch-deg>
<roll-deg type="double">0</roll-deg>
<path type="string">Models/Trees/palm_01.xml</path>
<latitude-deg type="double">37.49783842</latitude-deg>
<longitude-deg type="double">-122.497318</longitude-deg>
<elevation-ft type="double">81.19526371</elevation-ft>
<absolute-path type="string">C:\Program Files (x86)\FlightGear\data/Models/Trees/palm_01.xml</absolute-path>
<stg-path type="string">w130n30/w123n37/942042.stg</stg-path>
<stg-heading-deg type="double">0</stg-heading-deg>
<elevation-m type="double">24.74831638</elevation-m>
<object-line type="string">OBJECT_SHARED Models/Trees/palm_01.xml -122.49731796 37.49783842 24.7483 0.0</object-line>
</model>
These tools are listed as being available for adding scenery. Several are listed at:
http://wiki.flightgear.org/Category:Scenery_enhancement
How To:
http://wiki.flightgear.org/Howto:Add_details_to_your_airport
http://wiki.flightgear.org/Howto:Editing_tile_textures_and_materials