On 24/01/2013 at 06:10, xxxxxxxx wrote:
While still on same topic, where should I put UNDO steps? I tried few versions with no good result - I have to press UNDO twice to get to previous state.
def GetVirtualObjects(self, op, hierarchyhelp) :
doc = c4d.documents.GetActiveDocument()
doc.StartUndo()
myData = op.GetDataInstance()
scale = myData.GetReal(RADIUS)
baseNull = c4d.BaseObject(c4d.Onull)
sphere = c4d.BaseObject(c4d.Osphere)
sphere.InsertUnder(baseNull)
sphere.SetPhong(True, 1, utils.Rad(80.0))
doc.AddUndo(c4d.UNDOTYPE_CHANGE, op)
sphere[c4d.PRIM_SPHERE_RAD] = scale*100
doc.EndUndo()
print "Virtual END"
return baseNull