• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

PlacePointsAlongLine using a custom OBJ or MDL

Messages
38
Country
unitedstates
I've poured through the manual but could use a little push with a example script to place a repeating custom mdl or object along a border tag of osm.
for which I could just swap out my GUID

Just created my own custom Object or MDL using MDX.
Added it into a custom scenery project as a Library Object using "LibraryCreatorXML".
It appears in P3D V4 latest under SimDirectors catalog with a GUID.

I have extracted OSM data into a .osm file and can filter the osm data file with osmfilter.exe prior to using it in ScenProc.
It views as a LINE using QGIS3 just fine.
OSM data using tag:
boundary=administrative
+ admin_level=2
https://wiki.openstreetmap.org/wiki/Tag:boundary=administrative

SCENPROC SCRIPT so far with 0 results exporting.
ImportOGR|san1.osm|*|*|NOREPROJ
SplitGrid|AGN|*|boundary=administrative
PlacePointsAlongLine|FTYPE=LINE|SINGLE|100;100|0;0|50|fence|fence|hdg
CreateAGNLibObject|type="fence"|{42bd1f69-ceb6-4e41-a440-66444b20b900}
ExportAGN|P3D v2|Fence


Any help is greatly appreciated and thank you for this tool.
 

Attachments

  • qgis-bin_2019-08-22_19-51-54.jpg
    qgis-bin_2019-08-22_19-51-54.jpg
    139.7 KB · Views: 298

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

Administrative areas are polygons, not lines. So the step to place points along a line will not be able to create any points on them. At the moment scenProc has no step to place points on the border of a polygon.

The AGN library objects refer to classes in the default.xml file. So this means that you need to add your custom object to the default.xml file before you can use it in autogen.
 
Messages
38
Country
unitedstates
Hi,

Administrative areas are polygons, not lines. So the step to place points along a line will not be able to create any points on them. At the moment scenProc has no step to place points on the border of a polygon.

The AGN library objects refer to classes in the default.xml file. So this means that you need to add your custom object to the default.xml file before you can use it in autogen.

Thank you for your reply today... I will work with Poly possibly... Great software I am coming from X-Plane using World 2 Xplane which was similar software.
 
Messages
38
Country
unitedstates
Hi,
Administrative areas are polygons, not lines. So the step to place points along a line will not be able to create any points on them. At the moment scenProc has no step to place points on the border of a polygon.
The AGN library objects refer to classes in the default.xml file. So this means that you need to add your custom object to the default.xml file before you can use it in autogen.

Arno,
I have to reach out and again ask 2 questions... I have had much success with your application Thank You.

ImportOGR|osm/border.osm|*|*|AUTODETECT
SPLITGRID|AGN|*|FROMFILE="osm/border.osm"
PlacePointsAlongLine|FTYPE="LINE"|CONTINUOUS|2.43;2.43|1;1|0|String;type|Border|hdg
CreateXMLLibObj|*|{0b90fa93-768b-49e1-9f31-1fd98b0476cd}|hdg|0|0|1
ExportBGL|P3D v2|border|D:\Program Files\Lockheed Martin\Prepar3D v4\Addon scenery\Border\scenery


Using JOSM java application I have been able to clean up the border lines prior to sending the .osm thru ScenProc.
this sample includes 3 ways 4 nodes?

HrSnfWR.jpg


The problem I am seeing is each "Node" or point I assume in the above sample places my custom objects rotated 90 degrees while the CONTINUOUS in between objects are built properly stacking them side by side.
1. Is there a way to fix the Points themselves rotation? or to disable them?

see sample below.
SQ3joOp.jpg


2. How come the conversion finds points and creates a BGL but if I do not use SPLITGRID feature it tends to not show anything?

Thanks again...
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

For issue one, your filter the the CreateXMLObject step is to use any feature, not only the points you made. Try a filter with only the points you made.

I'm not sure for the second one. Some steps require a SplitGrid before, but you get an error in the log if you forget.
 
Messages
38
Country
unitedstates
Hi,
For issue one, your filter the the CreateXMLObject step is to use any feature, not only the points you made. Try a filter with only the points you made.
I'm not sure for the second one. Some steps require a SplitGrid before, but you get an error in the log if you forget.

Arno just a quick thank you I believe my scripting just needed understanding more... It's working correctly now.
for the records and users reading this: the highlighted red in script fixed.

I assume "Border" is a variable name / type assigned by me. so when creating the xml object I needed to reference the variable name or type.
excuse my non programming description. I used an * previously which didnt filter anything most likely.

ImportOGR|osm/border.osm|*|*|AUTODETECT
SPLITGRID|AGN|*|FROMFILE="osm/border.osm"
PlacePointsAlongLine|FTYPE="LINE"|CONTINUOUS|2.43;2.43|0;0|0|String;type|Border|hdg
CreateXMLLibObj|type="Border"|{c51f2ddf-8a2e-4e06-9e87-e3a48a787ab0}|hdg|0|0|1
ExportBGL|P3D v2|border|D:\Program Files\Lockheed Martin\Prepar3D v4\Addon scenery\Border\scenery

GREAT WORK ON THIS PROGRAM! and others I assume.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
That warning is coming from the OGR library that reads the OSM data. I found this bug report about it:

https://github.com/OSGeo/gdal/issues/849

So the version of the library scenProc currently uses seems to have a limit of 2000 nodes, while in the latest release it was increased to 10000. I plan to upgrade to a newer OGR version in the future.
 
Messages
38
Country
unitedstates
Thank you for your reply.
That explains it. I shall attempt to divide the source osm data into sections using JOSM.
 
Messages
38
Country
unitedstates
@arno my project generated 100% perfect using CreateXMLLibObj with ExportBGL.
However the shear amount of objects is just killing FPS like 0.2 fps and I need to use AUTOGEN.

I want to take this below XML based working script and use Autogen.

ImportOGR|osm/T.osm|*|*|AUTODETECT
PlacePointsAlongLine|FTYPE="LINE"|CONTINUOUS|2.43;2.43|0;0|0|String;type|TheWallP3D|hdg
CreateXMLLibObj|type="TheWallP3D"|{492f03f4-1316-44c4-88b6-1537760b31fc}|hdg|180|0|1

ExportBGL|P3D v2|TheWallP3D-T|D:\Program Files\Lockheed Martin\Prepar3D v4\Addon scenery\TheWallP3D\scenery|KEEPXML

I have all the entries made with annotator.exe so that ScenProc sees GUID Class when right clicking.
I have a MDL in folder.

Yet within the sim I see nothing. Any help with this below attempted script?
It successfully generates 2805 .agn files. which some have kb data for.

ImportOGR|../osm/T.osm|*|*|AUTODETECT
SPLITGRID|AGN|*|FTYPE="LINE"
PlacePointsAlongLine|FTYPE="LINE"|CONTINUOUS|2.43;2.43|0;0|0|String;type|TheWallP3D|hdg
PointToPolygon|FTYPE="POINT"|2.43;2.43|hdg|String;type|TheWallP3D
CreateAGNLibObject|FTYPE="POLYGON"|{492f03f4-44c4-1316-3715-b688fc310b76}

ExportAGN|P3D v2|D:\Program Files\Lockheed Martin\Prepar3D v4\Addon scenery\TheWallP3D\texture

1570932031629.png


The data is a 1 way line only in OSM.
lO4FdZX.jpg


I assume we are placing points along a line then converting points to polygon and creating an AGNlib object from the polygon?
I don't get why we need to create a polygon for agn?

Cant P3D just place autogen objects along a line?

Thank you again.
 

Attachments

  • Prepar3D_2019-10-07_12-56-16.jpg
    Prepar3D_2019-10-07_12-56-16.jpg
    179.4 KB · Views: 269

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

I'm autogen library objects are placed as polygons, just like you draw a rectangle in Annotator to place them. That's why.

So the main difference is that you need to add the step to make polygons.

Did you add your new classes to the default.xml file?
 
Messages
38
Country
unitedstates
Did you add your new classes to the default.xml file?

yes ... basically i took the original BGL from modelxconverter and saved it as a MDL directly but looking at the GUID in modelx it was.
492f03f4131644c488b61537760b31fc but the 492F03F444C413163715B688FC310B76 comes when you create it using annotator?

which one does scenproc need in the
CreateAGNLibObject|FTYPE="POLYGON"|{
492f03f4-44c4-1316-3715-b688fc310b76}

<CLASS>
<NAME>TheWallP3D Class</NAME>
<GUID>492F03F444C413163715B688FC310B76</GUID>
<WIDTH>2.43</WIDTH>
<DEPTH>2.43</DEPTH>
<LIBRARYOBJECT>
<NAME>TheWallP3D</NAME>
<GUID>492f03f4131644c488b61537760b31fc</GUID>
</LIBRARYOBJECT>
</CLASS>
 

Deano1973

Resource contributor
Messages
384
Country
unitedkingdom
You're on the right track here - I had the same problem not so long ago in that placing Library Objects with Sceneproc required different GUIDs than when using autogen - who knew? Why not run the script with each one and see which works? Shouldn't take long to figure it out.

If using Library Objects, you also need Scenery Objects settings in P3D to be at maximum - otherwise additional scenery stuff generated by SceneProc often doesn't show ( in my experience ).
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
You need to use the class guid. But you can't just add the dashes like you did, then you change the guid. Why not use the auto completion in scenproc to add the right one?
 
Messages
592
Country
us-california
there's a bug in P3D currently effecting library objects functionality and performance, seen the last 2 official releases (none HF),
 
Messages
38
Country
unitedstates
there's a bug in P3D currently effecting library objects functionality and performance, seen the last 2 official releases (none HF),

i had no problems with BGL but now that i'm working with annotator and GUID's with regards to autogen.
things just seem not working as they simply should.

do you have any idea what version has fixed it?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I think your issue is that you are mixing FS2004 and FSX guid notations like I explained above. If you enter the wrong guid, you are calling a non existing object.

In the default.xml file the FS2004 notation is used, while in scenproc script you used the FSX style. Either you use the FS2004 style there as well or you need to convert correctly between them.
 
Messages
38
Country
unitedstates
I think your issue is that you are mixing FS2004 and FSX guid notations like I explained above. If you enter the wrong guid, you are calling a non existing object.
In the default.xml file the FS2004 notation is used, while in scenproc script you used the FSX style. Either you use the FS2004 style there as well or you need to convert correctly between them.

2 Questions:
  1. Autogen object(s) are as simple as exporting an .MDL from modelx converter instead of a .BGL? or either format can work?
  2. Editing the default.xml within the Prepar3D autogen folder and adding a the below code within a REGION CODE section?
Within ScenProc right click Select GUID helper chooses the GUID CLASS not the OBJECT GUID.
Funny thing is ScenProc inserts GUID with hyphens yet the default.xml "default" entries are all using non hyphens when editing with NOTEPAD++ etc.

is the hyphens whats doing this I made them the same or is it the { } surrounding them?

<CLASS>
<NAME>TheWallP3D Class</NAME>
<GUID>492F03F444C413163715B688FC310B76</GUID>
<WIDTH>2.43</WIDTH>
<DEPTH>2.43</DEPTH>
<LIBRARYOBJECT>
<NAME>TheWallP3D</NAME>
<GUID>492f03f4131644c488b61537760b31fc</GUID>
</LIBRARYOBJECT>
</CLASS>

Thank you for your time and feedback.
 
Last edited:
Top