Horde3D
http://horde3d.org/forums/

custom parameters in xml
http://horde3d.org/forums/viewtopic.php?f=1&t=420
Page 1 of 1

Author:  jimbo [ 15.07.2008, 22:20 ]
Post subject:  custom parameters in xml

It would be nice if it's possible to have a simple method of accessing custom parameter in the xml files,
for example:

Code:
<Model name="player" geometry="player.geo">
   <Mesh name="player_mesh" material="player.material.xml" batchStart="0" batchCount="24843" vertRStart="0" vertREnd="5974" weight="100" />
</Model>

Then get this "weight" parameter by doing something like:

Code:
Horde3D:getNodeCustomParami(node,"weight")

Author:  swiftcoder [ 15.07.2008, 22:23 ]
Post subject:  Re: custom parameters in xml

This would be very tricky to implement in C++, because we would have to infer the type of the value (string, integer, float, etc.).

Author:  DarkAngel [ 16.07.2008, 02:20 ]
Post subject:  Re: custom parameters in xml

swiftcoder wrote:
This would be very tricky to implement in C++, because we would have to infer the type of the value (string, integer, float, etc.).
You could always treat the data as a string (it is being read from a text file after all) and then let the application code convert the string into whatever value they want (I assume the application knows what the type should be).

Code:
int weight;
weight = FromString<int>( Horde3D:getNodeCustomParam(node,"weight") );

Author:  Volker [ 16.07.2008, 07:36 ]
Post subject:  Re: custom parameters in xml

But I think that's nothing Horde3D should do. If you want custom attributes that are not supposed to be used by Horde3D you can either use Attachments or parse the code yourself.

Author:  jimbo [ 16.07.2008, 18:03 ]
Post subject:  Re: custom parameters in xml

How to do this using attachments? Do you mean extensions?

Author:  Volker [ 16.07.2008, 18:33 ]
Post subject:  Re: custom parameters in xml

You can store custom attributes and child nodes using an Attachment node. Just add to the node you want to store additional attributes a child node "Attachment":

Code:
<Mesh ... >
    <Attachment customAttribute = "1" />
</Mesh>


You can then later get this node by using getNodeAttachmentString

Author:  jimbo [ 16.07.2008, 19:16 ]
Post subject:  Re: custom parameters in xml

Thanks, just what I need ;)

Author:  Volker [ 21.07.2008, 07:20 ]
Post subject:  Re: custom parameters in xml

After the last commit this method is now called Horde3D::getNodeParamstr( nodeHandle, SceneNodeParams::AttachmentString )

Author:  DarkAngel [ 22.02.2009, 06:04 ]
Post subject:  Re: custom parameters in xml

Volker wrote:
You can store custom attributes and child nodes using an Attachment node. Just add to the node you want to store additional attributes a child node "Attachment":

Code:
<Mesh ... >
    <Attachment customAttribute = "1" />
</Mesh>


You can then later get this node by using getNodeAttachmentString

Sorry to dig up an old thread - I just wanted to ask if the Horde3D Editor supports the Attachment property, or do these have to be edited outside of the editor?

I noticed that the editor has an "Attachment Settings" dialog, but it only contains a greyed-out tick-box named "Attachment PlugIn".

Author:  Volker [ 22.02.2009, 08:57 ]
Post subject:  Re: custom parameters in xml

It supports it for the plugins. So if you want to use an Attachment Node, you have to write a plugin for the editor handling the attachment nodes. That's the way the GameEngine is integrated into the editor.

Author:  DarkAngel [ 22.02.2009, 10:52 ]
Post subject:  Re: custom parameters in xml

Volker wrote:
It supports it for the plugins. So if you want to use an Attachment Node, you have to write a plugin for the editor handling the attachment nodes. That's the way the GameEngine is integrated into the editor.
That's good, thanks Volker.
I guess I'll do them by hand for now, and in the long-run I can make a plug-in.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/