Results 1 to 8 of 8

Thread: SIDs - How best to locate the elements?

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    18

    SIDs - How best to locate the elements?

    Hi there,

    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?

    Many thanks,
    Richard.

  2. #2
    Member
    Join Date
    Dec 2007
    Location
    Costa Rica
    Posts
    42
    Use daeSIDResolver, check this thread.

  3. #3
    Junior Member
    Join Date
    Apr 2008
    Posts
    18
    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.

  4. #4
    Member
    Join Date
    Dec 2007
    Location
    Costa Rica
    Posts
    42
    Oh, sorry about that.

    If I am not mistaken, it can be located at a different level, different shading element, different profile, etc.

  5. #5
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    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.

    Steve

  6. #6
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Forgot to answer your question:
    Quote Originally Posted by richard
    Is it safe to assume that the newparam will always be located here? Or could it be located at a different level?
    They can show up at different levels.

  7. #7
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    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.

  8. #8
    Junior Member
    Join Date
    Apr 2008
    Posts
    18
    Many thanks guys!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •