Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 11:33

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 02.01.2008, 18:56 
Offline

Joined: 02.01.2008, 18:34
Posts: 14
Hello,
I'm new to Horde so be gentle :).

I'm having some problems with objects that are attached to a character (such as helmet or glasses) importing correctly.

I believe the problem lies in Collada Conv, but I may easily be wrong.

I am using Max and the FCollada exporter. Some attachments work and others do not.

When I export an attachment that works correctly the collada is of the form:
Code:
<node id="EYE-node" name="EYE" sid="Bone9" type="JOINT">
  <node id="EYE-node_PIVOT" name="EYE_PIVOT" type="NODE">
     <instance_geometry url="#EYE-mesh">

An example of exported Collada that does not work:
Code:
   
<node id="HELMET-node" name="HELMET" sid="Bone10" type="JOINT">
  <instance_geometry url="#HELMET-mesh">

In the second example the mesh is attached directly to the Joint. I'm not entirely sure why this happens to some objects in Max (the source art isn't mine), however I believe it is valid. I also think that having an instance geometry directly attached to a joint node is valid in the collada schema.

Assuming that the fault isn't with the data or the collada exporter, then the point at which the geometry is ignored is during the conversion process.

In Converter::convertModel() the assumption is made that a joint cannot contain mesh data.
Code:
if( iNode.joint )
{
   oNode = new Joint();
   _joints.push_back( (Joint *)oNode );
}
else
{
   // Check if node is a mesh
   if( iNode.instanceId != "" )
   {
      oNode = new Mesh();
      _meshes.push_back( (Mesh *)oNode );
   }
}

Removing the "else" from above means that my attachments will be displayed on the model. However I don't imagine this is the correct fix.

What is the correct way to fix this problem?
Is it best fixed in the source data, or the converter?

Thanks,
Sean


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.01.2008, 17:01 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Hi blue,

I had a look at the COLLADA spec and both cases you describe seem to be valid. Even worse I noticed that in theory a node could have several instanced geometries. ColladaConv currently ignores that. Your current fix usually won't work correctly since it is discarding the joint.

Obvoiusly instance_geometry is also handled as a scene node in COLLADA, not just as a link, but with limited capabilites (can't have transformation or children). So it always needs some parent node container.

Hmm, one solution would be to always treat instance_geometry as Horde-Mesh-node and COLLADA-node as Group. But this would usually be quite inefficient since it introduces much more nodes than actually required.

I would be interested in knowing how the second case (geometry directly at joint) is looking in the 3ds max schematic view as opposed to the first (usual) case. Do you see any difference there?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.01.2008, 17:41 
Offline

Joined: 02.01.2008, 18:34
Posts: 14
Hi Marciano,
I'm not seeing any difference at all in the schematic view.

In the image below you should be able to see glasses and helmet which contain geometry directly at the joint, and eyes which do not.

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.01.2008, 17:48 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for the image. What happens if you also display the Controllers? Do all objects have a Transform controller?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.01.2008, 17:54 
Offline

Joined: 02.01.2008, 18:34
Posts: 14
Yup, all the objects have Transform controllers as well.

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.01.2008, 18:13 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
If you look at your skin modifier, is it true that glasses and helmet are in the joint list and eyes are not? If that's the case it would explain the behavior of ColladaMax. Because then you would have geometry which acts at the same time as a joint, something that is not supported in Horde (nodes are either meshes or joints). But this should be very easy to fix in the model.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 04.01.2008, 00:30 
Offline

Joined: 02.01.2008, 18:34
Posts: 14
Hi Marciano,
Thanks for your help so far. I'm new to 3ds Max and using a resource that wasn't made by me, so you'll have to forgive my ignorance. I have been unable to find the answers on the internet, so perhaps you can help again :).

Where can I see the joint list for a skinned model in 3ds Max? What defines what will be exported as a Joint in Collada? How do I determine or change if some geometry is acting as a Joint?

The model is using the Physique modifier, which I think is the basically the skin modifier. I can't see how to get a list of joints from this, and I don't know how to set a geometry to be a joint, or a child of a joint.

I would have thought that the joint came from using the "select and link" to link geometries to the biped. I must be missing something though as that doesn't solve the problem.

Hope you can help. I'm sure if I knew Max better, this would be very obvious.

Thanks,
Sean


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 04.01.2008, 16:05 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The skin modifier has a list of bones (where you can add and remove items) that are used for skinning in the modifier paramters. If you add a mesh to that list it is also exported as a joint, otherwise not. Unfortunately I don't know how things are working when you are using the physique modifier.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 24.01.2008, 03:26 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
I'm happy to announce that all the problems described in this thread should be solved with the next version of ColladaConv. It can handle an arbitrary number of instances and you can also have geometry at a joint now. Furthermore I have cleaned up the node and animation handling code so it should be much easier to understand and modify.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 15 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:  
Powered by phpBB® Forum Software © phpBB Group