Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Hierachy hopping

    SDK Help
    0
    3
    302
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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
      
      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post