undo setUserProp not working

undo setUserProp not working

morten_bohne
Advocate Advocate
922 Views
3 Replies
Message 1 of 4

undo setUserProp not working

morten_bohne
Advocate
Advocate

I'm having some problems with undoing setUserProp in max2017 (after changing pymxsExtend.py as mentioned here):

 

import pymxs
rt = pymxs.runtime
mybox = rt.box()
with pymxs.undo(True, "setUserProp on box"):
	rt.setUserProp(mybox, "userProp", 5)

The value gets set, but no undo is registered

 

 

I'm getting the same result in maxscript:

 

mybox = box()
undo "setUserProp on box" on
	(
 mybox "userProp" 5
	)

and just to test that undo works:

 

mybox = box()
undo "Move box" on
	(	
		mybox.pos = [10,0,0]
	)

 any ideas on how to get around this, or maybe someone has an estimate if it will be fixed in future versions? (@drew_avis mentioned in an earlier post that some bugs with undo should be fixed in 2018?)

0 Likes
923 Views
3 Replies
Replies (3)
Message 2 of 4

drew_avis
Autodesk
Autodesk

Hi, thanks for posting this.  I tested in 2018, and undo does not capture setting user properties in MAXScript or Python.  You also cannot undo setting node user properties in the UI, so this action may just not be "undoable".  However, I've logged a defect in case this can be addressed.  

 

The defect that was fixed in 2018 is the typo in the pymxsExtend.py file that breaks undo.

 

Regards,

Drew



Drew Avis
Content Experience Designer
0 Likes
Message 3 of 4

denisT.MaxDoctor
Advisor
Advisor

setUserProp and setUserPropBuffer have never been undoable  

0 Likes
Message 4 of 4

morten_bohne
Advocate
Advocate

Hi, thanks for the replies. Sad to hear it still doesn't work in 2018, but good to know what to expect, so thanks for testing!

 

Great that you logged it, hope someone will have time to revisit it at some point!

0 Likes