I’m generating collada 1.4 animation from a simulator. I would like a single
collada file to hold several animations of the whole scene, as shown in the
example.
The task of combining animations is made harder by the requirement to set
unique ids for source, sample, and arrays elements. Moreover, I can’t see the
reason for this requirement. Why could I not use scoped id?
I would like to know if there is a workaround and the rationale for this limitaition.
Use an animation clip to group the animations together?
Sharable elements in the COLLADA schema have id attributes so that they can be referenced from other documents via URL (with fragment). The constraint that id values must be unique within the instance document comes from XML.
You see that all the id use the same prefix. When several animations are combined in a single file, there might be id collisions.
When this occurs, the id prefix needs to be updated everywhere.
I would have preferred something in this spirit
With this example, fixing an id collision involves changing a single id.
[quote="marcus"]
Use an animation clip to group the animations together?
[/quote]
I never used animation clips. But I think I would still have to manipulate global ids and ensure they are unique within the whole document. Isn't it?
[quote="marcus"]
Sharable elements in the COLLADA schema have id attributes so that they can be referenced from other documents via URL (with fragment).
The constraint that id values must be unique within the instance document comes from XML.
[/quote]
[/quote]
Ok. I just understood that fragments don't work with sid. Still, I'm curious about the concrete use case for this (referencing sources, arrays and samplers from other documents).
Don't you think target-like addressing would have been more appropriate?
(I eventually ordered the collada book, maybe this is discussed in the "design choices" section.)
Cheers
COLLADA design encourages modular content. Notice that the top level document schema is just asset, libraries, and a default scene. With documents as the primary division, the ID attribute usage is needed. That is how the animation design grew out because we know that animation key frame data are quite often the largest blocks of data and so separation of that is encouraged (as with each of the library element types).
As with other parts of the schema, it’s certainly possible to allow both ID and SID attributes on elements to enable more flexibility in content structure. Adding that to data sources and animations would be an enhancement request against the schema and specification.