Specific Type in scene?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 24/07/2003 at 06:32, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.100 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    What is the fastest way to get a list of objects of a specific type in the current scene?
    I am currently using GetHighest() and then go through all objects in the scene and grab the specific objects. Is there a faster way?
    Thanks!
    Best
    Samir



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 25/07/2003 at 11:21, xxxxxxxx wrote:

    Since the objects aren't indexed in any way, I think the theoretical complexity is linear in the number of objects. So just going through each object in the scene would be the fastest way. (I don't think the actual algorithm used will affect the complexity, though it could be that a recursive search is more efficient since it doesn't need to walk upwards.)
    I assume that you have verified this as a bottle neck in your plugin. (Otherwise you have committed the sin of premature optimization... ;-) But I think you're out of luck if that's so. What kind of plugin is this btw?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 25/07/2003 at 13:48, xxxxxxxx wrote:

    Since the objects aren't indexed in any way, I think the theoretical complexity is linear in the number of objects. So just going through each object in the scene would be the fastest way. (I don't think the actual algorithm used will affect the complexity, though it could be that a recursive search is more efficient since it doesn't need to walk upwards.)
    ********
    Yes, I do have a recursive function in use right now...
    ********
    I assume that you have verified this as a bottle neck in your plugin. (Otherwise you have committed the sin of premature optimization... ;-)
    **********
    Hehe, no I haven´t and it´s actually really fast enough. Haven´t thought it would be so I guessed maybe there´d be a function I have overseen in the SDK like FindObjectType or something :)
    **********
    But I think you're out of luck if that's so. What kind of plugin is this btw?
    **********
    For sale promotional reasons I won´t go into details if you understand ;)) I need to find all cameras in a scene so I can list them. See my conf in fc for details :)
    Thank you!!
    Best
    Samir


Log in to reply