Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Undoing on object with -notUndoable polyColorPerVert changes, makes it disappear

asdfgasd
Participant

Undoing on object with -notUndoable polyColorPerVert changes, makes it disappear

asdfgasd
Participant
Participant

Undoing on an object that has -notUndoable polyColorPerVertex changes applied to it inbetween other operations on the shapenode (such as bevel), makes the object disappear (Disabling history doesnt help.)

 

To properly see the problem, its required to execute these steps one by one, not as a whole block, because maya then undos the whole block as one:

 

REPRODUCTION METHOD 1:

 

// make a cube
string $testcube[] = `polyCube`;

// set white color per vertex on it globally
polyColorPerVertex -notUndoable -colorRGB 1 1 1 $testcube[0];

// bevel it - this step perhaps starts the problem, as it alters the shape node or something
polyBevel $testcube[0];

// set white color per vertex again
polyColorPerVertex -notUndoable -colorRGB 1 1 1 $testcube[0];

-> now try undo a few times to get rid of the bevel, something goes wrong about the object, it still exists but invisible

 

 

REPRODUCTION METHOD 2:

// make a cube
string $testcube[] = `polyCube`;

// instead of using -notUndoable on the colorpervertex change, we temporarily disable the undo queue for this step instead, without flushing the queue
undoInfo -stateWithoutFlush off;
polyColorPerVertex -colorRGB 1 1 1 $testcube[0];
undoInfo -stateWithoutFlush on;

// bevel
polyBevel $testcube[0];

// apply colorpervertex again
undoInfo -stateWithoutFlush off;
polyColorPerVertex -colorRGB 1 1 1 $testcube[0];
undoInfo -stateWithoutFlush on;

-> try undo the bevel now, object disappears again but exists

 

 

FURTHER OBSERVATIONS / WHAT WORKS:
if there is absolutely no construction history on the object and i disable construction history and delete any new history thats on the object prior to doing another -notUndoable vertexcolor change, then it works fine, because the colorchange doenst create another history node, but when theres a deformer on the object already for example which needs to stay on it, then even if i disable construction history, the colorpervertex changes will still create history even if its turned off and the problem will appear again, so i cant workaround by temporarily disabling history for the colorchange.


so iam looking for some workaround that would allow me to make colorpervertex changes without hogging undo queue and still being able to have some history on it, such as lattice or skinning. i tried using the polycolorpervertex on the shape node and also specifically on the faces/verts instead of the whole object, but its still the same

Reply
340 Views
1 Reply
Reply (1)

trs_andre
Collaborator
Collaborator

Hi!

Sounds like a real juggle with history nodes...

I guess the use of the -notUndoable flag is necessary to increase performance?

 

I thought about directly deleting the history nodes... does it seem to help?

For example, in your code, to undo the bevel:

 

select -addFirst polyBevel1 ;
channelBoxCommand -deleteNode;

 

I guess you could use this for other nodes as well? Maybe...

André Moreira

Game Developer / Technical Artist

LinkedIn

0 Likes