MCOMMAND_JOIN



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

    On 09/03/2011 at 10:01, xxxxxxxx wrote:

    Hi there,

    I'll post this here again, because it's only about Python now.

    I want to join the hierarchy of the selected Object to one.
    But The next objects are added, too, even they are NOT in the list ?! 🤢🤢😠

    import c4d  
    from c4d import utils  
      
    def GetHNext(op, start = None) :  
      if not op: return  
      if op.GetDown() :  
          return op.GetDown()  
      while (not op.GetNext()) and (op.GetUp()) :  
          op = op.GetUp()  
      if start == op:   
          return  
      
      return op.GetNext()  
      return  
      
    def GetHierarchyInList(op) :  
      lst = list()  
      sop = op  
      while op:  
          lst.append(op)  
          op = GetHNext(op,sop)  
      return lst  
      
    def main() :  
      lst = GetHierarchyInList(op)    ## Get the Hierarchy of op  
      if not lst[0]: return  
      for i in lst:                   ## print all Objects in the list  
          print i.GetName()  
      obj = utils.SendModelingCommand(## Use modeling command  
                              command = c4d.MCOMMAND_JOIN,  
                              doc = doc,  
                              list = lst )  
      obj[0].SetAbsPos(c4d.Vector(0,250,0))  
      doc.InsertObject(obj[0])        ## Insert new Object  
      doc.SetActiveObject(obj[0])  
      obj[0][c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(130/255.0,255/255.0,100/255.0)  
      c4d.EventAdd()  
      
    if __name__=='__main__':  
      main()
    

    I have the following Hierarchy:

    I select the Cube and in the list obtained by GetHierarchyInList(op) there is only the Cube and the Sphere, as wanted.

    But at the end, all objects are collapsed by MCOMMAND_JOIN.
    Any Idea ?

    Here an example scene, so you don't have to set up your own.
    click

    Thanks, nux



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

    On 13/03/2011 at 05:06, xxxxxxxx wrote:

    *push*



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

    On 14/03/2011 at 08:37, xxxxxxxx wrote:

    Unfortunately I can't give you an answer on this right now. I have to check whats going on here.



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

    On 14/03/2011 at 10:00, xxxxxxxx wrote:

    There seems to be some SendModelingCommand options that are broken.

    https://plugincafe.maxon.net/topic/5538/5558_mcommandjoin-bug

    -ScottA



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

    On 16/03/2011 at 08:46, xxxxxxxx wrote:

    Thanks, i hope you can figure the problem out.

    Unfortunately I can't use the CallCommand in my Plugin. 😵


Log in to reply