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
-
The animated windmills, and ski-lift line with top station scenarios are working.
wow ! cannot wait to test skilift/chairlift and cable ways pylons and stations in Switzerland DLC ! It would be fantastic addition to immersion !
Thank you
-
Just posted the initial release of osm2AFSobject
So kick the tires and see if the wheels fall off.
/Stu
-
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.
-
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.
-
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.
-
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>
-
..or should I suspect the caracter "é" (my surname is Hervé ) , and perhaps "é" should be changed in english coding ?
-
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
-
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...
-
what did you provide as the second argument to PylonGen?
-
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?
Code
Display More<!-- ============================================================================================ --> <!-- windmill scenario with animation specification--> <nodeConfiguration> <selectionCriteria> <andCriteria> <keyValueEntry key="power" value="generator"/> <keyValueEntry key="generator:source" value="wind"/> </andCriteria> </selectionCriteria> <explicitModelNameKey>"model"</explicitModelNameKey> <defaultModelName>"Windmills\110M\windturbine_n90_110m_1_2"</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="110" modelName="Windmills\110M\windturbine_n90_110m_1_2"/> <mapEntry key="height" value="150" modelName="Windmills\110M\windturbine_swt36_150m_offshore_1_5"/> <mapEntry key="height" value="200" modelName="Windmills\200M\windturbine_e126_200m_2_0"> <animation rotation_in_degrees="70.0" duration ="0.0" time_scale="2.0"/> </mapEntry> </modelNameMapping> </nodeConfiguration>
The fixed mills already show up:
-
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.
-
Thank you Stu.
-
I finally got the animated wind-turbines working with this xml-script (excerpt):
Code
Display More<!-- ============================================================================================ --> <!-- windmill scenario with animation specification--> <nodeConfiguration> <selectionCriteria> <andCriteria> <keyValueEntry key="generator:source" value="wind"/> </andCriteria> </selectionCriteria> <explicitModelNameKey>"model"</explicitModelNameKey> <defaultModelName>"Windmills\110M\windturbine_n90_110m_1_2"</defaultModelName> <modelNameMapping> <mapEntry key="offshore" value="yes" modelName="Windmills\150M\windturbine_swt36_150m_offshore_1_5"> <animation rotation_in_degrees="75.0" duration ="0.0" time_scale="2.0"/> </mapEntry> <mapEntry key="power" value="generator" modelName="Windmills\200M\windturbine_e126_200m_2_0"> <animation rotation_in_degrees="80.0" duration ="0.0" time_scale="2.5"/> </mapEntry> </modelNameMapping> </nodeConfiguration> </osm2AFSobjectConfiguration>
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.
-
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>
-