What is the best way to stay an array of names (string) with a maxfile?
I tried persistent globals but those did not seem to work.
Thanks
JokerMartini
Forum topic · General Scripting
By JokerMartini · 2011-07-24
What is the best way to stay an array of names (string) with a maxfile?
I tried persistent globals but those did not seem to work.
Thanks
JokerMartini
Comments (9)
Comment policy
here is...
It was array of strings stored there so something like this:
Cheers!
Awesome
Thanks Anubis, I've got it working now. It's coming together great.
One last question...for now atleast is how to do a check like this.
if rootNode.Names.theNames == true then print "yes" else print "no"
rootNode.Names.theNames
If you use
instead, keep in mind that it is new in Max 2011.
Add
So I've been able to add it to the scene But I do not understand how to get names placed into the parameter as well as getting them.
rootNode.names.main.theNames.default??
Then do i have to add this
custAttributes.add rootscene CA
CA = attributes Names
(
parameters main
(
theNames type:#stringTab tabSizeVariable:true
)
)
custAttributes.add rootNode CA
custAttributes.add rootscene CA
Storing Names
This is what I'm trying to do. Saving the dropdown list items names with the maxfile.
try(destroyDialog rlTestStore)catch()
rollout rlTestStore "Store with Maxfile"
(
local lstNamesArr = #()
fn fnUpdateNames =
(
rlTestStore.dlNames.items = lstNamesArr
)
button btnAddName "Add Name"width:124 height:18 pos:[10,6]
dropdownlist dlNames items:#() pos:[10,28]
on btnAddName pressed do
(
try(destroyDialog rlNewName)catch()
rollout rlNewName "New Name"
(
edittext etNewName "New Name: "
on etNewName entered txt do
(
appendifUnique lstNamesArr txt
fnUpdateNames()
try(destroyDialog rlNewName)catch()
)
)
createDialog rlNewName
)
)
createDialog rlTestStore 150 54
link ref
Check this script, it store materials to the rootNode, but am sure you'll find inside all what you looking for ;)
Those seem to store on objects which in the end save with the max file but if those objects are deleted then the information is lost.
Hey John
You has another (2) options to add custom attributes:
Cheers!
CustomAttributes.