Created
February 23, 2016 03:16
-
-
Save JokerMartini/0ecb792d5c33f0f7ba5b to your computer and use it in GitHub Desktop.
Maxscript: This demonstrates a simple way to save data to a max file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CA = attributes MyData | |
( | |
parameters main | |
( | |
theNames type:#stringTab tabSizeVariable:true | |
nodes type:#nodeTab tabSizeVariable:true | |
) | |
) | |
--// variant #1 > add to rootNode to store with file | |
custAttributes.add rootNode CA | |
--// variant #2 > add to a new track to store with file | |
newTrackViewNode "yourCustomName" -- create new track | |
custAttributes.add (trackViewNodes [#yourCustomName]) CA | |
-- save data to attributes | |
if isProperty rootNode "MyData" do | |
rootNode.MyData.nodes = objects as array | |
-- retrieve data | |
names = ( | |
if isProperty rootNode "MyData" then | |
rootNode.MyData.theNames as array | |
else #() | |
) | |
nodes = ( | |
if isProperty rootNode "MyData" then | |
rootNode.MyData.nodes as array | |
else #() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment