- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm attempting to set persistent global variables in 3ds Max 2018 using pymxs. Is this currently possible? I have had a hard time finding any examples of this.
Here are some things that I have tried. Each of these results in an "unsaveable file". If I hit save after any of these Max crashes.
import pymxs
pymxsRt = pymxs.runtime
pymxsMp = getattr(pymxsRt, '%make_persistent')
global gTest
gTest = []
gTest.append('qwer')
gTest.append('asdf')
gTest.append('zxcv')
pymxsRt.persistents.append(gTest)
import pymxs
pymxsRt = pymxs.runtime
pymxsMp = getattr(pymxsRt, '%make_persistent')
global gTest
gTest = []
gTest.append('qwer')
gTest.append('asdf')
gTest.append('zxcv')
pymxsMp( gTest, pymxsRt.persistents )
import pymxs
pymxsRt = pymxs.runtime
pymxsMp = getattr(pymxsRt, '%make_persistent')
global gTest
gTest = []
gTest.append('qwer')
gTest.append('asdf')
gTest.append('zxcv')
pymxsMp( gTest )
I'm trying to avoid going between python and MaxScript since I have a PySide2 GUI and I have to pass data back and forth.
Also, are persistent global variables not advised for any reason?
Solved! Go to Solution.