including custom data in with the export?

compound

08-11-2007 16:16:45

basically i currently use text files to obtain info about each of the objects in ym game, this isnt very designer friendly and since trying Ofusion ive discovered this will be alot easier for everyone.

i couldnt find anywhere i could declare custom data anywhere in the exporter though, how is this possible?

each object i need to include a small amount of data like this:

BoundType = Cylinder
BoundSizeX = 1
BoundSizeY = 2
BoundSizeZ = 1
BoundOffsetX = 0
BoundOffsetY = 1
BoundOffsetZ = 0
BoundOffsetRotX = 0
BoundOffsetRotY = 0
BoundOffsetRotZ = 90
Mass = 20.0
InertiaX = 10.0
InertiaY = 10.0
InertiaZ = 10.0
PhysicsMaterial = Wood
PinUpvector = false


also how would i read the data exported in OSM Scene loader?

Evak

08-11-2007 16:36:06

just select your mesh in max and use the right click menu, select prefs and then the user defined tab. Type in your data in there. It will all be stored in the OSM file.

You have to write your own code to grab the userdata from the OSM file since its only text, Ofusion doesn't know what you intend to do with it.

Adding your data to a mesh and exporting the scene produces this in the .OSM file.

<entity name="Box01" hidden="false" filename="Box01.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="-4.9104614" y="0" z="-2.1190643" />
<rotation x="0" y="0" z="-0" w="-1" />
<scale x="1" y="1" z="1" />
<properties>
<property BoundType="Cylinder" />
<property BoundSizeX="1" />
<property BoundSizeY="2" />
<property BoundSizeZ="1" />
<property BoundOffsetX="0" />
<property BoundOffsetY="1" />
<property BoundOffsetZ="0" />
<property BoundOffsetRotX="0" />
<property BoundOffsetRotY="0" />
<property BoundOffsetRotZ="90" />
<property Mass="20.0" />
<property InertiaX="10.0" />
<property InertiaY="10.0" />
<property InertiaZ="10.0" />
<property PhysicsMaterial="Wood" />
<property PinUpvector="false" />
</properties>
</entity>

compound

08-11-2007 16:51:06

thanks for your fast reply

did you mean right click the object and select object properties?

i have just tried this but it doesnt seem to export to my .osm file for some reason, is there a option i must change before it does this?

Evak

08-11-2007 16:58:54

I use the Pro version of ofusion and am unable to test on the CE edition. It's possible this feature isn't avaliable in the CE edition :(

compound

08-11-2007 17:10:47

ah shame, spose can manually put the data into the osm file

or maybe have some kind of method that links to my original text files based on the object name i spose

thanks alot

Lioric

10-11-2007 02:17:19

You can see this article about using object properties in your applications:

Using "User Defined" Properties