Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jaforsgren/6c8b7c25f953debfbb861be7065fb533 to your computer and use it in GitHub Desktop.
Save jaforsgren/6c8b7c25f953debfbb861be7065fb533 to your computer and use it in GitHub Desktop.
Maxscript: This demonstrates a simple way to save data to a max file.
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