What is the recommended approach for locating parameters by SID?
For example, I am currently looking at the texture element within ‘diffuse’ within ‘blinn’ within ‘technique’ within ‘profile_COMMON’. The texture element refers to a newparam. This newparam happens to be a child of ‘profile_COMMON’.
Is it safe to assume that the newparam will always be located here? Or could it be located at a different level?
Use daeSIDResolver, check this thread.
Unfortunately I am unable to take advantage of the Collada DOM for my project. To locate an element referenced by a SID, what would be the recommended approach in terms of the logic? Thanks in advance.
Oh, sorry about that.
If I am not mistaken, it can be located at a different level, different shading element, different profile, etc.
The process for resolving a SID reference is documented in the Collada spec and the release notes in the “Address Syntax” section in chapter 3. The release notes have important changes and additional explanation, so be sure to look them over.
SID references were poorly designed IMO. They’re very challenging to implement properly, and the spec is ambiguous: in some (admittedly rare) cases you can have multiple matching elements for a SID reference and the spec doesn’t tell you how to decide between them. There are also two types of SID references (which I call “animation-style SID refs” and “effect-style SID refs”) that have slightly different semantic behavior.
I would recommend trying to copy or reverse engineer the code in the DOM, but the implementation is very difficult to follow and it’s probably easier just working from the source material (i.e. the spec and release notes).
Good luck, and post back if you have any further questions.
Forgot to answer your question:
They can show up at different levels.
I see the spec has been updated to a 2nd edition which includes the release notes, so the separate release notes doc is no longer necessary. All the info you need is in the spec.