get info about undo

get info about undo

morten_bohne
Advocate Advocate
1,029 Views
2 Replies
Message 1 of 3

get info about undo

morten_bohne
Advocate
Advocate

Is there a way to get info about the next item in the undo stack? I would like to get the undo-label or something like that?

 

Thanks 🙂

0 Likes
Accepted solutions (1)
1,030 Views
2 Replies
Replies (2)
Message 2 of 3

kevinvandecar
Community Manager
Community Manager

 

Hi mortenbohneIOI,

 

well, first you did not say which programming environment you are in... MAXScript, Python, .NET, C++ SDK? or something we do not know abut yet? 😉

 

Undo/redo in 3ds Max programming is labeled as the "hold" (at lowest level, a C++ class object that manages undo/redo). In MAXScript for example, there is a keyword "HoldAll" to stop undo stack recording.  If we stick in the MAXScript environment, then you can find details here:

http://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_17BFEAAF_3395_4FFB_9F98_54767481AB0...

Those are a direct exposure of C++ SDK hold methods, so be careful. I do not think you can get the label for a hold group, however you can specify one for the operations you are performing.

 

See here for MAXScript performance recommendation, in case it helps:

http://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_A731E672_9B9A_4D5B_A8A7_EA584AD12FE...

 

The C++ SDK has a more complete overview of how it works:

http://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__developer_3ds_max_sdk_features_the_undo_and_re...

 

hope it helps,

kevin

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



Message 3 of 3

morten_bohne
Advocate
Advocate
Accepted solution

Hi kevinvandecar, thanks for your reply!
I am most comfortable working in python, but I felt i was so stuck on this issue that i might need to look at solutions in other languages 🙂

 

I am trying to build a pyside ui with some sliders that control scene-objects. My issue was that undoing sliderchanges didn't undo the slider position.
My plan from here is to use the pyside QUndoCommand and QUndoStack, if the undo label from max matches with the tool-name. If this seems totally backwards, or there is an easier way, please let me know, otherwise i think it might work 😉

 

Think i found something that fixes my issue:
http://help.autodesk.com/cloudhelp/2015/ENU/MAXScript-Help/files/GUID-C1F6495F-5831-4FC8-A00C-667C5F...

 

If anyone else is running into this issue, be aware of this bug in the pymxs undo in versions < 2018:
https://forums.autodesk.com/t5/3ds-max-programming/error-in-pymxsextend-py-undo/td-p/7116716

0 Likes