Hierachy hopping



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

    On 15/03/2004 at 11:09, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.200 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;   XPRESSO  ;

    ---------
    I´m stepping through the hierachy and creating cubes depending on what object is is stepped on in the hierachy using this code

      
    while(stepObject){                 
    if(instanceof(stepObject,BoneObject))  
    {            
    CreateCube(stepObject->GetDown()); // function to create cubes                                
    }  
    stepObject=stepObject->GetNext();  
    }  
    [/code}  
      
    This stops working if a null is anywhere in the scene, is this normal? If yes how does one step properly with COFFEE through objects in the hierachy?  
      
    (sorry the formmating got messed up again by the browser)  
      
    Thanks
    


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

    On 15/03/2004 at 15:46, xxxxxxxx wrote:

    I dont' think its that code that is the problem. I think its a combination of things, try adapting your code to follow this

        
        
        
        
        ScanObjects(o)  
        {  
         while(o)  
         {  
           if(instanceof(o,BoneObject))  
          {  
          println(o->GetName());  
            }
        
        
        
        
           ScanObjects(o->GetDown());  
           o=o->GetNext();  
               
         }
        
        
        
        
        }
        
        
        
        
        main(doc,op)  
        {  
         var o = doc->GetFirstObject();  
          println("---");  
         ScanObjects(o);  
          println("---");  
        
        
        
        
        }
        
        
        
    

    that works fine, it finds every bone, and dont stop on nulls or anything



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

    On 15/03/2004 at 23:44, xxxxxxxx wrote:

    Thanks for the answer Geespot, I´l have to try it out. But maybe I have to clarify things a bit. The code iterates and carries out the CreateCube() function well with any number and any sort of object. It iterates through the hierachy but does not carry out the function only when a null is in the scene, very strange. Is there a reserved property, undocumented perhaps that could cause this problem?

    Thanks

    nhytro


Log in to reply