Dealing with example splitUVCmd plugin undo/redo limitations

Dealing with example splitUVCmd plugin undo/redo limitations

olarn
Advocate Advocate
744 Views
1 Reply
Message 1 of 2

Dealing with example splitUVCmd plugin undo/redo limitations

olarn
Advocate
Advocate

Hello

 

The polygon modifier convenience base class, polyModifierCmd, used devkit plugin examples (splitUVCmd and meshOpCmd) states that Undo/Redo ability will not be supported in "No History / History turned on"  scenario (see link below).  I've compiled and verified that this is still the case.

 

Manual deleting duplicated mesh via api, adding mel delete commands to the undo process or deleting it manually after executing plugin commands as the code comment suggests also breaks the undo stack or wipes all redo stack which isn't the intended behavior.

 

Since other maya polygon commands doesn't seems to have this issue, is there an official solution to this?

 

http://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=__cpp_ref_split_u_v_cmd_2poly_modifier_cmd_8h_ex...

 

 

//      1) History
//
//          For history, there are 4 cases that need to be considered:
//
//          (a) History (yes)   -   RecordHistory (yes)
//          (b) History (yes)   -   RecordHistory (no)
//          (c) History (no)    -   RecordHistory (yes)
//          (d) History (no)    -   RecordHistory (no)
//

 

// Limitations:
//
//      There is one limitation in polyModifierCmd:
//
//      (1) Duplicate mesh created under the "No History / History turned on" case not undoable
//
//      Case (1):
//
//          Under the "No History / History turned on" case, history is allowed so the DG
//          is used to perform the operation. However, every polyModifierNode requires
//          an input mesh and without any prior history, a mesh input needs to be created.
//          polyModifierCmd compensates for this by duplicating the meshNode and marking
//          it as an intermediate object.
//
//          The problem with this duplication is that the only duplicate method in the
//          Maya API resides in MFnDagNode, which does not have an associated undo/redo
//          mechanism. Attempting to manually delete the node by use of a DGmodifier or
//          the MEL delete command will break the undo/redo mechanism for the entire
//          command. As a result, this duplicate mesh is a remnant of each instance of the
//          command excluding undo/redo.
//
//          To work past this limitation, a manual delete from the MEL command line is
//          required.
//

 

0 Likes
745 Views
1 Reply
Reply (1)
Message 2 of 2

olarn
Advocate
Advocate

Never mind, solved.

0 Likes