[Py] Bug? with InsertAfter



  • 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()
    

Log in to reply