Few years ago I flew in VATSIM with MSFS. There are a lot of good freeware sceneries for airport. The most impressions I got from fences near runway. They make altitude feel stronger and more real feel of flight. Taxiing along fence is more better than along forest. So I decide that for my local FG airport I make fences. And I made it with UFO. That was really annoying – move, rotate and pitch pieces of fence 10 meters long. Runway ends of UKDD located at steep hill.
So I decide make my own tool for build fence, thinking that it would be handy for other scenery makers. Later I add some features, so it can build not only fences.
I coded it with no human interface. All preferences was hardcoded. Even Soitaten can't use it. So I didn't share it. But recently I need some rest and fun, and I write GUI for it. And share it with you.
What it can do:
Between markers, that you place with UFO, at certain intervals it takes altitudes and export they into the xml file.
Then in Blender you prepare 3d-model, open that xml file and your model cloned at that points, and string for stg-file is displayed.
Some examples:
- power line small


- power line big


- alley


- bush


- cars at road




- cars at parking


- fence


- road





- serpentine




- China wall




- lights along road and taxiway
- railway power line
- ski lifter
- hangars in ruler lane
- ends of bridge
- etc
In difference to usual UFO-placed objects, thats above is one big object. AFAIK experts says, that its more better to load one big object than a lot of small. That object takes one line in stg file, loads at once and in best case use one drawcall. So it very fps-friendly. It is can be even better, if all that object join into another big one.
For a more natural view, script can randomly choice and rotate source models.
How to use it:
Actually, it is not a script. This is tool with two parts: one is nasal for UFO and second is addon for Blender.
You can take it here.
Place ufo folder over fgdata/Aircraft/ufo and put fencemaker.py into blender/2.xy/scripts/addons, then register it in Blender' preferences-addon-object.


Flightgear
So, let's launch $ fgfs –aircraft=ufo-fencemaker, take off and place markers alongside future fence, alley, road whenever. Then press hotkey f and enter length (and width) of model.


Script can change length a bit to get integral models between markers. If interval between markers too small, model can be jammed.
If you want that one side of your object not dive into the ground at steep hill, you should enter width for it.
That option added after I drive Isle of Man race track. For usual narrow fences and trees better left width as 0.
When you are ready, hit ctrl-f and script export ufo-fenceplan-export-HxW.xml to ~.fgfs folder. I recommend immediately rename it.
Now you can change length and export once more (for example, for bushes between trees; ChinaWall was exported with 40m for walls and 200m for towers with same markers). You can export markers with UFO's e export to load it later with fgfs --pref= and continue work.
Blender
Now time to launch Blender. You can left FlightGear running, and place generated object into first marker place to quickly observe your work.
At the bottom of the Objects tab, you can find FG-fencemaker panel.
I prepare .blend file with example models for you, to help you figure out.
Object will be build in the 1st layer, so leave it empty and create your model in any other layer.
Model can be two types - fence or pole.
Fence should begin from positive X axis, and ends at Origin. Lenght of model (and width for wide ones) should be same as you enter in ufo-fencemaker menu.
Poles oriented from +X to -X too, but centered at Origin. Poles will placed at elevation taken from the file, evenly distributed between and at UFO markers, rotate along and don't stretch. For trees and bushes you can check RandomRotate checkbox.
Origin of model can be in any place. If it not at (0,0,0), then script move it there. That made for randomize object. You can make one model, then copy it, move to free space. Then change its texture, slightly shift vertexes etc. You can make a lot of that models. If you select few of them, script when build object will be randomly take models from that selection. If you want to increase probability of certain model, just make more copies of it.
Fences can be place in two ways, which defines by Shear checkbox.
If it unchecked, fence placed between poles horizontally. Its looks like a ladder.
In another case (Shear enabled) fence stretched from one pole to next. Roads makes with that method.
So, select model(s) of fence, check checkboxes and press Build button. Then select 1st layer and check that you got.
North is at the -X, East at +Y. You can join it in one object to use it in LOD animation separate from poles. Apply RemoveDoubles (0.2 suits well). Repeat same for poles.
In console script wrote line for *.stg file.
Export model, switch to running FG and place model at your first marker to check is everything is ok.
Further development:
- Generate object relative to center of tile, so you can join several objects in one.
- Make fine-turn for roads.
Worst thing:
Nasal script use .course_to() function, which imprecise relative to SimGear's SGGeodesy::courseDeg(). So long as runway length fences rotates a bit, and position of end misplaced up to 2 meters.
If someone can expose SimGear's geodesy functions to nasal, it would be possible to make absolutely precise fences; and also some of my another scenery tools become usable.
Cheers.