Jump to content
  • Advertisement
Sign in to follow this  
RobMaddison

Collada getNode_array

This topic is 1724 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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!