Iterate Through All Objects In Scene



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

    On 06/12/2010 at 11:10, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:    
    Platform:      
    Language(s) :

    ---------
    Hi All,

    I am trying to use COFFEE to scan all the objects in the scene.
    I want to examine each object's name and if a match, then operate on it.
    The operation is to Add a TAG to the object if the TAG is not present.

    Is this possible in COFFEE node of expresso?

    If so, what would the code look like?



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

    On 07/12/2010 at 02:51, xxxxxxxx wrote:

    It's quite easy to do with a recursive function call.

    Example code browsing through all objects and printing the name of each object.

      
    BrowseScene(op)  
    {  
      while (op)  
      {  
          println(op->GetName());    //prints the object's name  
      
          BrowseScene(op->GetDown());    //recusive call of BrowseScene  
      
          op = op->GetNext();  
      }  
    }  
      
    main(doc,op)  
    {  
      BrowseScene(doc->GetFirstObject());  
    }  
    

    cheers,
    Matthias



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

    On 07/12/2010 at 06:17, xxxxxxxx wrote:

    Thank you , Matthias.

    So how would I make use of this in a COFFEE node? For instance, what if I want to output all the objects into a list so other xpresso nodes can process them?

    Is this practical, or is it best to just remain inside the COFFEE node and try to write one massive process?


Log in to reply