PDA

View Full Version : Setting Attributes/Keyframes in Commands with Undo


Buexe
01-15-2009, 07:00 AM
Hi,
I would like to create a command that supports undo/redo. Now generally, MDagModifier would be a good idea I guess and I have successfully created one except for the fact that I didn`t find a way to specify single values for the MFnNummericData Function set, so I use a MEL string with a "setAttr" in it. The same goes for adding keyframes where I use "setKeyframe" for the MDagModifier::commandToExecute thingy. This works okay, but since it can easily happen that I need to set Attributes on a couple of hundred Attributes at once, this mechanism is a little bit slow ( takes a few seconds to execute ). Would it be a better idea to store/restore all the attribute values "manually" ( w/o relying on the MDagModifier ) in my command even if it means more labour for me, or does someone here have a better Idea for a fast undo/redo for lots of attribute valus changed and keyframes added?
Thanks in advanced,
buexe

Buexe
01-15-2009, 10:24 AM
okay, recording and restoring values "manually" in an undo/redo command isn`t that hard to code and much faster than the MEL variant.

CGTalk Moderation
01-15-2009, 10:24 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.