Hi! I’m writing my own collada loader/viewer from scratch and about to start to work on animation.
Where can I find a list of all valid target transformations for <channel>? I hadn’t found it anywhere in the specification (it could be a bit more verbose in some places).
I had build a short list from the standard examples:
Am I missing anything?
You can find a description of the sid addressing scheme in “Address Syntax” at the end of chapter 2 of the specification.
A list of all the target attribute member names is at the end of the Common Glossary in chapter 4 of the specification.
Basically it’s <NodeID>/<transformElementSID>.<attribute>
Thanks. But where can I find a list of transformElementSID and what transformElementSID.attribute combinations are valid?
The best place to find transformElementSID is in your Collada file. The sid is an attribute on all targetted transform elements in your scene, as the example in chapter 2 shows.
The valid types of attribute depend on the type of element being targetted:
<translate> has X, Y, Z.
<rotate> has X, Y, Z, ANGLE.
<scale> has X, Y, Z.
I am not sure where these are documented.
This discussion of channels brings up an interesting question… What things can be targets of an animation channel? Can only elements stored under “nodes” be animated, or can anything be animated?
For example, lets say I have a UV mapping with a transform applied to it – in Maya, an artist can actually animate the UV transform (note that the Maya exporter currently doesn’t export UV transforms at all, but let’s say it did). The UV transform itself would be stored in a location such as the following (going after the example in multitexture.xml):
<param name="SCount" type="int" flow="IN">1</param>
<param name="TCount" type="int" flow="IN">1</param>
<param name="SOffset" type="float" flow="IN">0.000000</param>
<param name="TOffset" type="float" flow="IN">0.000000</param>
<param name="SScaling" type="float" flow="IN">1.000000</param>
<param name="TScaling" type="float" flow="IN">1.000000</param>
<param name="S" type="float" flow="OUT"/>
<param name="T" type="float" flow="OUT"/>
Can I animate “SOffset” and “TOffset”? I would have to assign IDs to those parameters, and in order to find them, I’d have to add any parameter with an ID to a global list in the scene to allow them to be referenced. The format seems to support the concept of having an animation URI point to anything, but will the exporters at some point in the future support this? There’s also the question of whether it would be possible to animate these parameters uniquely per-instance, since you are pointing to parameters that are in library data, not scene data…
Other useful things would be to animate color components on lights or materials, or to animate visibility channels. It would be useful to be able to extract generic animation curves that don’t animate anything as well (I noticed there is a “spline” type in the source code that doesn’t appear to be documented). As far as I can tell, the Collada specification doesn’t include support for visibility fields at all–is this something that will be added in the future? I assume blend shape or vertex animation are planned for the future, and those will also require animation channels to drive different parameters.
With the release of the 1.2.1 schema you can target any param, where ever it is. Param elements simply gained a sid attribute. A nice concise powerful mechanism.
Of course it all depends on import/export paths doing the right thing.
The latest schema is here of course.
Anything that can have an ID can be the root of an address expression. The <param> element had this already but adding the SID attribute allowed you to address parameters relative to their parent element, which users asked for.
Thanks for the feedback. I’ll add some more explanations about addressing to the spec for the next release.
Is there any possibility that channel targets can point to different nodes in the same animation element?
For example is it possible that the channel elements can have the same source id and different target attributes?
<channel id="Box_translateX-channel" source="#Box_translateX" target="Box/translate.X"/>
<channel id="MyOtherBox_translateX-channel" source="#Box_translateX" target="MyOtherBox/translate.X"/>
<channel id="MySidesteppingCharacter_translateX-channel" source="#Box_translateX" target="MySidesteppingCharacter/translate.X"/>
… within the same animation element? Or does it define the same animation data for different objects in different <animation> elements?
If the <animation> and <channel> elements are bound to the same object then it would simplify my current implementation.
But if they could be targeted to different nodes then an animator could create one animation (for example jump), assign the same animation to 50 different object and let each channel point to the different objects.
Yes, that’s exactly the purpose of the light-weight <channel> element:
to be able to target the same (potentially large) keyframe data to multiple objects.