That’s a good idea!

For starters you shouldn’t be popping undo/redo methods otherwise it
immediately gets lost after you undo.

Indeed, was hoping to find a way around that, and it looks like what you’ve
got here should work. Didn’t know the command class was instantiated per
call, that is really helpful, as it means I can store stuff in the instance
and let Maya keep track of the order of calls itself.

Here is one possible way of doing it:

Aw shucks. Doesn’t appear to work on Windows..

# Traceback (most recent call last):#   File "<maya console>", line 1,
in <module>#   File "<string>", line 2, in apiUndo# RuntimeError:
Cannot convert argument 0 to float.# # Traceback (most recent call
last):# #   File "C:/.../apiundo/apiundo.py", line 73, in doIt# #
undo_id = long(args.asDouble(0))# # TypeError: Cannot convert argument
0 to float. #

Was also a little weary of _ctypes.

However I managed to remove the need to pop at least, by storing undo/redo
in the shared member, and passing them to the instance of the command class
like in your example!

   - Like this
   
<https://github.com/mottosso/apiundo/blob/f68590cfecd5a8dd0c1acdd58f9cea69d4ab33a2/apiundo.py#L85>

Thanks Serguei, making progress!

​
​

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBazke0eVtNDNpWYNkj8tSOkhx2kkLpafcb2N%3DyYXGVaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to