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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    NewBie Question: ObjectHierarchie sorted

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 262 Views
    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 Offline
      Helper
      last edited by

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

      On 10/01/2005 at 05:40, xxxxxxxx wrote:

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

      ---------
      Hello,
      i want to make a function which sort my doc new. I have many Objects with the same Name. They should be Grouped under a NullObject.
      My Problem is that not all Objects were taken.
      My function dosen't take Objects which are deeper in the Hierachie and I don't know why. Can anyone please help me?
      Here is my function:
      FindAndMove(ObName,NObName,op,doc){
      var ...
      parent = doc->FindObject(NObName);
      while(op){
      nam=op->GetName();
      if(nam=ObName){
      op->Remove;
      op->InsertUnter(parent);
      b=tostring(i);
      b+=ObName;
      //Rename the object, so that it would not be found a 2.time
      op->SetName(b)
      op->Message(MSG_UPDATE);
      }
      if(op->GetDown){
      FindAndMove(ObName,NObName,op,doc);
      }
      op=op->GetNext();
      }
      }

      Greetings Tim

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

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

        On 14/01/2005 at 08:18, xxxxxxxx wrote:

        If you're recursive function is too deep then there will be a stack error. You will have to turn one dimension of the recursion into a while-loop instead.

            
            
            Recurse(op)  
            {  
              while (op)  
              {  
                DoSomething(op);  
                Recurse(op);  
                op = op->GetNext();  
              }  
            }
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 17/01/2005 at 05:00, xxxxxxxx wrote:

          Thanks,
          i got an stack error. your functions works great!

          Greetings...

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