Horde3D

Next-Generation Graphics Engine
It is currently 27.11.2024, 03:22

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: custom parameters in xml
PostPosted: 15.07.2008, 22:20 
Offline

Joined: 10.04.2008, 09:13
Posts: 86
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")


Top
 Profile  
Reply with quote  
PostPosted: 15.07.2008, 22:23 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
This would be very tricky to implement in C++, because we would have to infer the type of the value (string, integer, float, etc.).

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 16.07.2008, 02:20 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
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") );


Last edited by DarkAngel on 16.07.2008, 07:50, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: 16.07.2008, 07:36 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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.


Top
 Profile  
Reply with quote  
PostPosted: 16.07.2008, 18:03 
Offline

Joined: 10.04.2008, 09:13
Posts: 86
How to do this using attachments? Do you mean extensions?


Top
 Profile  
Reply with quote  
PostPosted: 16.07.2008, 18:33 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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


Top
 Profile  
Reply with quote  
PostPosted: 16.07.2008, 19:16 
Offline

Joined: 10.04.2008, 09:13
Posts: 86
Thanks, just what I need ;)


Top
 Profile  
Reply with quote  
PostPosted: 21.07.2008, 07:20 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
After the last commit this method is now called Horde3D::getNodeParamstr( nodeHandle, SceneNodeParams::AttachmentString )


Top
 Profile  
Reply with quote  
PostPosted: 22.02.2009, 06:04 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
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".


Top
 Profile  
Reply with quote  
PostPosted: 22.02.2009, 08:57 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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.


Top
 Profile  
Reply with quote  
PostPosted: 22.02.2009, 10:52 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group