Undo's and SendModelingCommand

  • I am not sure how to / where to place Undo's when using a CSTO.
    Should it be before (with an UNDOTYPE_CHANGE) or after (with an UNDOTYPE_NEW)?

            #doc.AddUndo(c4d.UNDOTYPE_CHANGE, poly)        
            objList = c4d.utils.SendModelingCommand(
                command = c4d.MCOMMAND_CURRENTSTATETOOBJECT,
                list = [poly],
                mode = c4d.MODELINGCOMMANDMODE_ALL,
                doc = doc,
            doc.AddUndo(c4d.UNDOTYPE_NEW, objList[0])

  • Hi @pim only UNDOTYPE_NEW is needed.

    Moreover, I would like to mention that SendModelingCommand offers the MODELINGCOMMANDFLAGS_CREATEUNDO flags in order to automatically creates undo.


Log in to reply