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