[Closed] Storing Scripted Materials Rollout RolledUp State?
I’m having difficulty in storing the rolledUp state of rollouts in a Scripted Custom Material. I’m trying to maintaint the rolledUp state between Max sessions, or even when clicking back and forth between multiple materials.
Storing a boolean in the parameter block that is used during the rollout definition seems not to work as the variable is inaccesible to the rollout at definition time.
I also can’t seem to find an event handler that could be used to set the rolledUp state when swapping materials in the material editor…
Anyone have any idea?!
Thanks in advance!
could you not just store the info in a data file and get your script to read that file on startup ?
I thought about that briefely originallly, but storing scripted material data in an external data file seems a bit impractical. Not only would it add an additional file to track with asset managment, but having a discreet data file for every custom material in any given scene might be a bit cumbersome…
Here's some sample code that *doesn't* work but conveys what I'm trying to do...
plugin material testMaterial
name:"Test Material"
classID:#(0x10093868, 0xc9e1d78)
extends:Standard replaceUI:true version:1
(
parameters general rollout:generalRollout
(
rollState type:#boolean default:false
)
rollout generalRollout "General" rolledUp:rollstate
(
button test "test"
)
on generalRollout rolledUp theState do rollState = theState
)
This code is invalid because rollState is not accesible to the rollout defenition.