Object generation utility

  • Substract the two X Coordinate range (projected) values from each other and multiply them by 0.476 and you get the diameter in meters.

    Yes it is possible to calculate the way length (which would be the circumference in the storage tank case).

    It would then be able to calculate diameter based on an assumption that the way is circular.

    In any case the calculated number would not be particularly useful for model selection.

    The height tag for windmills is useful because 70M or 90M are really a class designation not a specific measurement.

    The calculated diameter will be a float value. Even if converted to an integer how much variation will be based on the drawing accuracy of the way author.

    After spending a lot of time to generalize the osm2AFSobject utility I am reluctant add back in specific assumptions about features.

    It may be possible to add the concept of a computed tag with a binning capability to smooth out variance.

    You don't want a different model map for every meter in size.

    In any case that will not make the next release which I am trying to get out the door (as a beta at least)

    There are a lot of changes from PylonGen to test.

    The animated windmills, and ski-lift line with top station scenarios are working.

    I need to work on documentation and some stress tests before I release.

    /Stu

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • thank you lenidcamper .... I'm still unable to configure correctly osm2afsobjects configuration file to be able from map.osm to have a result....

    Of course, it is much more complex for my poor knowledge than just running Pylongen.exe....

    I juste copy/paste lines concerning skilifts from example.xml to the .config file, but it is unclear for me if it is correct...

    If someone can send me the right .config just to be able to render skilifts, I'll be more than happy.

    Thank you in advance, Regards

  • Sorry for the confusion

    example.xml IS the config file

    the osm2AFSobject.exe.config is something generated by Visual Studio

    I did not test if it was safe to delete it.

    PS

    I tried running with osm2AFSobject.exe.config as configuration file and I am surprised there were no validation errors.

    I will have to look at that.

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

    Edited once, last by lenidcamper (February 28, 2019 at 3:10 PM).

  • Ok. So what must I have to edit in the example.tsc. to be able to make ski lifts autogen? I really don’t get it, sorry. Could you share here the correct txt necessary in the example.tsc ? And the name must be example.tsc ?

    Thank you for your help

  • there is no example.tsc

    Out of the box you can run the example.xml

    running in the folder where you extracted the zip file with the command

    osm2AFSobject.exe .\myFile.osm .\example.xml

    should produce osmObjects.tsc with entries for any power pylons, aerial ways, storage tanks or windmill features in myFile.osm

    osmObjects.tsc can be renamed to anything you choose when deployed to the scenery folders

    I am not sure where the confusion lies.

    /Stu

    PS you would need to adjust relativePathPrefix in example.xml to match what your scenery deployment folder structure.

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

    Edited once, last by lenidcamper (February 28, 2019 at 3:57 PM).

  • Out of the box, without any change.... nothing happens....

    Should I change someting in the example.tsc ?

    For example this line : <relativePathPrefix>"..\..\..\..\objects\"</relativePathPrefix>

    ????

    I'm running all the the unzipped folder, with "map.osm" ( = my file.osm")

  • There is no example.tsc only example.XML

    osm2AFSobject will process map.osm with example.XML out of the box but AFS2 will not load the objects unless you adjust the

    relativePathPrefix so that the paths in the generated [string8][geometry] elements in the TSC file match your scenery folder hierarchy.

    If you put the model TMB and TTX files in the same folder as your TSC then you do not need relative path prefix and the path names in the XML would just

    the TMB file name .

    If you want to package the model files in separate folders or want to share the models across multiple scenery packages you need the relative paths.

    Look at the section in the User Guide on relative paths

    The relative path and deployment environment is really the same as PylonGen except that the relative path prefix is defined in the XML rather than as a command line argument and the models are bundled in an objects folder.

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • Ok thx

    now i'm successfull rendering the .tsc

    But nothing appear ! Clearly probably it is linked to the objects relative path...

    Here my example.tsc. Do you think you can see the problem ? Notice I only changed at the begining relative path to objects (where resides my AF2 addon folders, succesfull with pylongen tsc):

    <?xml version="1.0" encoding="utf-8"?>

    <osm2AFSobjectConfiguration xmlns="urn:osm2AFSobject-schema">

    <!--

    See osm2AFSobjectConfiguration.svg and osm2AFSobjectConfiguration.xsd for documentatin of the schema

    Best viewed from Firefox or Chrome browsers

    -->

    <relativePathPrefix>"C:\Users\Hervé\Documents\Aerofly FS 2\scenery\places\Autogen ch West PowerPylons\objects\"</relativePathPrefix>

    <!-- ============================================================================================ -->

    <!-- power line scenario -->

    <wayConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="power" value="line" />

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"PowerPylons\6-cables\6-cables"</defaultModelName>

    <referencedNodes>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="power" value="tower" />

    </andCriteria>

    </selectionCriteria>

    <modelNameMapping>

    <mapEntry key="cables" value="3" modelName="PowerPylons\3-cables\3-cables"/>

    <mapEntry key="cables" value="4" modelName="PowerPylons\4-cables\4-cables"/>

    <mapEntry key="cables" value="6" modelName="PowerPylons\6-cables\6-cables"/>

    <mapEntry key="cables" value="8" modelName="PowerPylons\8-cables\8-cables"/>

    <mapEntry key="cables" value="10" modelName="PowerPylons\10-cables\10-cables"/>

    </modelNameMapping>

    </referencedNodes>

    </wayConfiguration>


    <!-- ============================================================================================ -->

    <!-- ski lift scenario -->

    <wayConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="aerialway" value="gondola" />

    <!-- occupency tag can be used to process aerialways of a certain type with appropriate sized towers.

    Requires additional way configuration for each type.

    -->

    <keyValueEntry key="aerialway:occupancy" value="8" />

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"AerialWays\LiftTower\LiftTower"</defaultModelName>

    <referencedNodes>

    <!-- no selection criteria. process all nodes on the way.

    Scenario relies on explicit model name on aerialway="station" nodes.-->

    <modelNameMapping>

    <mapEntry key="aerialway" value="pylon" modelName="AerialWays\Lift_Tower\lift_tower"/>

    </modelNameMapping>

    </referencedNodes>

    </wayConfiguration>

    <!-- ============================================================================================ -->

    <!-- storage tank scenario using circumferance way -->

    <wayConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="man_made" value="storage_tank" />

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"StorageTanks\40MDome\40Mdome"</defaultModelName>

    <oneObject>"true"</oneObject>

    </wayConfiguration>


    <!-- ============================================================================================ -->

    <!-- storage tank from center point node -->

    <nodeConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="man_made" value="storage_tank"/>

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"StorageTanks\20mflat\20Mflat"</defaultModelName>

    </nodeConfiguration>

    <!-- ============================================================================================ -->

    <!-- windmill scenario with animation specification-->

    <nodeConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="power" value="generator"/>

    <keyValueEntry key="generator:source" value="wind_turbine"/>

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"Windmills\25M\25M"</defaultModelName>

    <modelNameMapping>

    <mapEntry key="height" value="70" modelName="Windmills\70M\windturbine_v39_70m_0_5">

    <animation rotation_in_degrees="90.0" duration ="0.0" time_scale="1.2"/>

    </mapEntry>

    <mapEntry key="height" value="90" modelName="Windmills\90M\90M"/>

    <mapEntry key="height" value="200" modelName="Windmills\200M\windturbine_e126_200m_2_0">

    <animation rotation_in_degrees="90.0" duration ="0.0" time_scale="2.0"/>

    </mapEntry>

    </modelNameMapping>

    </nodeConfiguration>

    </osm2AFSobjectConfiguration>

  • you specified an absolute path

    the relative path prefix would be blank if the objects folder is in the same folder as the TSC

    ..\ if objects folder is in the parent folder

    ..\..\ if objects folder is in the grandparent folder

    ans so on

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • Thx you very much for your help.... I replaced the original untouched example.xml (with relative path), and really got the same relative structure (but not the same SSD - my final .tsc folder is on C: but the working folder ion "G:" -but anyway that ios not important, right ?

    I'll try again and again...

    Pylongen.exe was working at the first try.... I still cannot understand what am I doing wrong...

  • Hi Stu,

    thank you very much for your great XML addition.

    All is working so far.

    I found, that I had to change the value="wind_turbine" to "wind" to get a match with wind generators in northern germany.

    Can you help me with the animated ones:

    All of my mills do not have a height parameter, so the static <default_ModelName> is drawn.

    When I try to add animation parameters into the term, I get an error message that this node is write protected.

    Code
     <defaultModelName>"Windmills\110M\windturbine_n90_110m_1_2"<animation rotation_in_degrees="90.0" duration ="0.0" time_scale="1.2"/></defaultModelName>


    Can you modify my script please for animation of standard mills?

    The fixed mills already show up:

    Cheers, Thomas


  • I found, that I had to change the value="wind_turbine" to "wind" to get a match with wind generators in northern germany.

    that is why it is driven by XML

    the variation in OSM is hard to predict

    When I try to add animation parameters into the term, I get an error message that this node is write protected.

    I had not contemplated animation for the default model.

    I will need to modify the schema to allow this and verify that the animation context is propagated correctly.

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • I finally got the animated wind-turbines working with this xml-script (excerpt):

    I tested this script with osm data of a wind farm north of helgoland and as second area, west of EDXE.

    You will need to copy the animated models from a DLC which supports animated wind mills.

    Cheers, Thomas


    Edited 2 times, last by TomSimMuc (March 1, 2019 at 4:17 PM).

  • what did you provide as the second argument to PylonGen?

    Hello Stu,

    In Pylogen.exe, I simply "put " map.osm over Pylogen.exe, and all worked at the first try...

    Here I'm successfull doing some .tsc, but NOTHING appear in the simulator..... As far as I know, I put exactly the same folder (parents, grandparents) structure in the "zip" deployed structure.....

    I'll continue to try....

    If you are kind enough to ahve a look at my "example.tsc".... Do you think all is as it has to be ?¨

    Thx

    <?xml version="1.0" encoding="utf-8"?>

    <osm2AFSobjectConfiguration xmlns="urn:osm2AFSobject-schema">

    <!--

    See osm2AFSobjectConfiguration.svg and osm2AFSobjectConfiguration.xsd for documentatin of the schema

    Best viewed from Firefox or Chrome browsers

    -->

    <relativePathPrefix>"..\..\..\..\objects\"</relativePathPrefix>

    <!-- ============================================================================================ -->

    <!-- power line scenario -->

    <wayConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="power" value="line" />

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"PowerPylons\6-cables\6-cables"</defaultModelName>

    <referencedNodes>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="power" value="tower" />

    </andCriteria>

    </selectionCriteria>

    <modelNameMapping>

    <mapEntry key="cables" value="3" modelName="PowerPylons\3-cables\3-cables"/>

    <mapEntry key="cables" value="4" modelName="PowerPylons\4-cables\4-cables"/>

    <mapEntry key="cables" value="6" modelName="PowerPylons\6-cables\6-cables"/>

    <mapEntry key="cables" value="8" modelName="PowerPylons\8-cables\8-cables"/>

    <mapEntry key="cables" value="10" modelName="PowerPylons\10-cables\10-cables"/>

    </modelNameMapping>

    </referencedNodes>

    </wayConfiguration>


    <!-- ============================================================================================ -->

    <!-- ski lift scenario -->

    <wayConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="aerialway" value="gondola" />

    <!-- occupency tag can be used to process aerialways of a certain type with appropriate sized towers.

    Requires additional way configuration for each type.

    -->

    <keyValueEntry key="aerialway:occupancy" value="8" />

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"AerialWays\LiftTower\LiftTower"</defaultModelName>

    <referencedNodes>

    <!-- no selection criteria. process all nodes on the way.

    Scenario relies on explicit model name on aerialway="station" nodes.-->

    <modelNameMapping>

    <mapEntry key="aerialway" value="pylon" modelName="AerialWays\Lift_Tower\lift_tower"/>

    </modelNameMapping>

    </referencedNodes>

    </wayConfiguration>

    <!-- ============================================================================================ -->

    <!-- storage tank scenario using circumferance way -->

    <wayConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="man_made" value="storage_tank" />

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"StorageTanks\40MDome\40Mdome"</defaultModelName>

    <oneObject>"true"</oneObject>

    </wayConfiguration>


    <!-- ============================================================================================ -->

    <!-- storage tank from center point node -->

    <nodeConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="man_made" value="storage_tank"/>

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"StorageTanks\20mflat\20Mflat"</defaultModelName>

    </nodeConfiguration>

    <!-- ============================================================================================ -->

    <!-- windmill scenario with animation specification-->

    <nodeConfiguration>

    <selectionCriteria>

    <andCriteria>

    <keyValueEntry key="power" value="generator"/>

    <keyValueEntry key="generator:source" value="wind_turbine"/>

    </andCriteria>

    </selectionCriteria>

    <explicitModelNameKey>"model"</explicitModelNameKey>

    <defaultModelName>"Windmills\25M\25M"</defaultModelName>

    <modelNameMapping>

    <mapEntry key="height" value="70" modelName="Windmills\70M\windturbine_v39_70m_0_5">

    <animation rotation_in_degrees="90.0" duration ="0.0" time_scale="1.2"/>

    </mapEntry>

    <mapEntry key="height" value="90" modelName="Windmills\90M\90M"/>

    <mapEntry key="height" value="200" modelName="Windmills\200M\windturbine_e126_200m_2_0">

    <animation rotation_in_degrees="90.0" duration ="0.0" time_scale="2.0"/>

    </mapEntry>

    </modelNameMapping>

    </nodeConfiguration>

    </osm2AFSobjectConfiguration>