Sign in to follow this  

Collada getNode_array

This topic is 1512 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all

 

I've got a little issue with Collada that I'm confused about and I wondered if any of you have seen the same thing before I go asking on other forums.

 

My importer has worked for some time but I've just upgraded to VS2008 from VS2005 and I've rebuilt the Collada DOM (vs9-1.4).  When I try to extract the skeleton joint data (this is a model exported to DAE format from 3ds Max), I pass the domNodeRef to my recursive method and although everything else about the node looks like it's the correct node in the xml, the name, id and sid of the node stays the same as the root node, here's a snippet of the Collada document showing the "Bip001" node - this is essentially the start of my skeleton.

 

- <library_visual_scenes>
- <visual_scene id="" name="">
- <node name="Avatar1" id="Avatar1" sid="Avatar1">
  <instance_controller url="#Avatar1Controller" />
- <extra>
- <technique profile="FCOLLADA">
  <visibility>1.000000</visibility>
  </technique>
  </extra>
  </node>
- <node name="Bip001" id="Bip001" sid="Bip001" type="JOINT">
  <matrix sid="matrix">0.000000 1.000000 -0.000000 -0.066163 -0.000000 0.000000 1.000000 89.513779 1.000000 -0.000000 0.000000 -0.941559 0.000000 0.000000 0.000000 1.000000</matrix>
- <extra>
- <technique profile="FCOLLADA">
  <visibility>1.000000</visibility>
  </technique>
  </extra>
- <node name="Bip001 Footsteps" id="Bip001 Footsteps" sid="Bip001 Footsteps">
  <matrix sid="matrix">0.000001 -1.000000 0.000000 0.000000 1.000000 0.000001 -0.000000 0.000000 0.000000 -0.000000 1.000000 -78.418900 0.000000 0.000000 0.000000 1.000000</matrix>
- <extra>
- <technique profile="FCOLLADA">
  <visibility>1.000000</visibility>
  </technique>
  </extra>
  </node>
- <node name="Bip001 Pelvis" id="Bip001 Pelvis" sid="Bip001 Pelvis" type="JOINT">
  <matrix sid="matrix">0.000000 1.000000 -0.000001 0.000000 -0.000000 0.000001 1.000000 0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
- <extra>
- <technique profile="FCOLLADA">
  <visibility>1.000000</visibility>

 

 

And here is my very simple starting code to extract the skeleton:

 

 

std::string nodeName = node->getName(); // returns "Bip001"

for (int iNode = 0; iNode < node->getNode_array().getCount(); iNode++)

     ExtractSkeletonNodes(node->getNode_array()[iNode], skeletonName);

 

 

As you can see the 'node' variable is correct, but inside the recursive function ExtractSkeletonNodes, when I get the bone name, it's the same but all the matrix information and children nodes load correctly (it doesn't recurse endlessly).

 

Bit confused on this one as it all worked fine before and I'm using getNode_array() in other places without this issue.

 

Any ideas?

 

 

 

 

Share this post


Link to post
Share on other sites

This looks like a bug in Collada.  My bone names (from the biped) end up being Bip001 Spine, Bip001 R UpperArm, etc with spaces.  Removing the spaces (or replacing with an underscore) makes it work so there must be some kind of bug on parsing the string of the bone name.

Share this post


Link to post
Share on other sites

This topic is 1512 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this