pymxs undo (basic python)

pymxs undo (basic python)

Anonymous
Not applicable
733 Views
0 Replies
Message 1 of 1

pymxs undo (basic python)

Anonymous
Not applicable

Hi guys, I just read document(https://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__developer_pymxs_api_introduction_html)and try following code.

 

 

 

# main.py
import pymxs
rt = pymxs.runtime

with pymxs.undo(False):
    t = rt.Teapot()

with pymxs.undo(True):
    t.pos = rt.Point3(20,20,20)

pymxs.run_undo() # undo the position

 

 

Teapot should be located in 0,0,0 but It's location is still 20, 20, 20

The reason is I am try using python.ExecuteFile in Maxscript like below image

In main.py, pymxs.run_undo() is done first.. I don't know why 

Jereno413_0-1607578552293.png

Everything is works! like below image (0,0,0)

df.PNG

Why not operate normally using 'pythonExecuteFile'?

I want use pythonExecuteFile. Do you have any good ideas?

Please give me some advice.

0 Likes
734 Views
0 Replies
Replies (0)