We’ve been exporting .dae files with animations in Maya and referencing animation nodes via their animation ID (from library_animations) in visual_scenes. We would get the animation matrices in visual_scenes by taking values from tags “rotateX”, “rotateY”, and “rotateZ”. An animation ID would look something like <animation id=“Part1.rotateX”>.
When exporting in max, though, the animation ID would go like <animation id=“INNER_RING-node-rx”> and tags as “rotX”, “rotY”, “rotZ”, etc.
The source ID (sID) seems to be have more information and could possibly be used for both cases, would this be correct? Is there any code I could possibly take a look at to go about relating the animations this (or through a better) way?
Any help/references would be greatly appreciated, once again.
Hi Natasha, you’re correct that the scoped identifier (sid) is the way to find the animation targets. The sid reference syntax is explained in the spec and the release notes, and it’s pretty complicated. Fortunately the DOM provides code to resolve sid references to specific daeElements, or even pointers to float values when the animation targets a specific component of a vector or matrix. You might use code like this:
‘container’ is a pointer to the element containing the sid reference, like a domChannel, and ‘target’ is the sid reference string, like “myNode/rotateY”.
I’ve found there are many type of information in the animation channels. In Maya I would identify ‘rotateX’ to be a stream of floats(angles).
This same data though coming from max looks like “rotX” in the source-id.
for Maya I was doing this sort of info (eg. rotX, transX, scaleY, transform) to get the animation stream type…
if (!strcmp (channelType, “rotateX.ANGLE”))
channelStreamType = CST_RX;
else if (!strcmp (channelType, “rotateY.ANGLE”))
channelStreamType = CST_RY;
else if (!strcmp (channelType, “rotateZ.ANGLE”))
channelStreamType = CST_RZ;
What is the recommended way to get the type of animation channel type?
Collada’s animation system is capable of targeting almost any value for animation, so it’s harder to classify them into particular types. Probably the best way is to resolve the sid ref (rotateX.ANGLE) to an element, then look at the name of the element (<rotate>), and that should give you the info you need.
Hi—I have a question regarding animation of lights in Collada.
If I have animated lights that are exported out of Max (blinking/fading) the collada exporter seems to rename the nodes in animation to something totally different from my light names.
I am using the resolver to try to access the animation nodes with my target as the node string, i.e., “light_name/intensity” but this doesn’t seem to get me any results.
What is the best way to associate light nodes to their corresponding animations?
to try to get the appropriate animation channel, is there something I am doing wrong? I am also not using the latest version of Collada, so I don’t know if that has anything to do with it. Right now I’ve found a temporary solution, which involves a lot of parsing and keywords lol. But any help on the more elegant solution would be appreciated. Thanks a lot!
The animation channel is targeting an ID or SID called “intensity”. That has to be in the <light> somewhere in order for it to resolve correctly. I suspect it is the SID on the <color> element in the light, but it could be in an <extra> so I’ll wait for your post of the <light> now.
The SID are in the <extra> so resolving them might be a problem for the DOM, since content in <extra> is not always stongly typed and parsed inside the DOM. If it is a problem it will help to file a bug at sourceforge.
Try this first though (taken from your earlier post) with using the “FCOLLADA” profile string: