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

    [Py] Bug? with InsertAfter

    Scheduled Pinned Locked Moved Bugs
    1 Posts 0 Posters 408 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 25/02/2012 at 12:55, xxxxxxxx wrote:

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

      ---------
      c4d.GeListNode.InsertAfter does not work successfully when the object given as argument is not yet inserted into the document. In contrast, c4d.GeListNode.InsertBefore does!

      As you can see after executing this script, the Cube object, which should be the last child of the Null, is missing. This will work if the Root-object is inserted before calling InsertAfter().

      import c4d  
        
      def main() :  
        root = c4d.BaseObject(c4d.Onull)  
        op0  = c4d.BaseObject(c4d.Onull)  
        op1  = c4d.BaseObject(c4d.Ocube)  
        op2  = c4d.BaseObject(c4d.Osphere)  
        
        # doc.InsertObject(root)  
        
        op0.InsertUnder(root)  
        op1.InsertAfter(op0)  
        op2.InsertBefore(op0)  
          
        doc.InsertObject(root)  
        c4d.EventAdd()  
          
      main()
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post