Undo and Duplicate bug?

Seven193Seven193 Posts: 1,096

Why aren't duplicated items added to Undo?

Even when called from the main menu, Edit -> Duplicate -> Duplicate Node Hierarchies, duplicate items are not added to Undo.


(function() {

 var sourceNode = Scene.getPrimarySelection();
 if (!sourceNode) {
    MessageBox.critical( qsTr("Nothing selected."), qsTr("Warning"), qsTr("&OK") );
    return;
 }

 if(sourceNode.inherits("DzBone")) sourceNode = sourceNode.getSkeleton();

 if( !sourceNode.inherits("DzSkeleton")) {
    MessageBox.critical( qsTr("Selection is not a figure."), qsTr("Warning"), qsTr("&OK") );
    return;
 }

 beginUndo();

 var duplicateItem = sourceNode.duplicate(true);

 acceptUndo( qsTr("Duplicate Test") );

})();

 

I'm trying to create a batch duplicate script that will duplicate all clothing items and copy them from character A to character B.  And it would be convenient to insert a Undo action here.

 

Post edited by Seven193 on
Sign In or Register to comment.