I am coming from Maya, and using 3Dmax 2014 for a project.
I am using a script to hide/unhide some layers according to a slider UI object value.
I am not sure how to connect this interaction other than using wiring parameter.
In order to use the slider.value parameter, I had to plug it to some null object just for the sake of having a place to write my function.
Because of “reasons” (explained below) I am trying to hardcode the function inside wiring parameters. It partially works, but I am curious why I can’t run more than one function (or subfunctions). Below, is the code:
layers = #(
"a_arm",
"a_body"
) as string
global layersLs = execute layers
fn main i = (
if(i>0) then ( -- i wanted to put below in a function
-- unhide()
for i = 1 to layersLs.count do
(
l= LayerManager.getLayerFromName layersLs[i]
l.ishidden = false
)
)else (
--same here: hide()
for i = 1 to layersLs.count do
(
l= LayerManager.getLayerFromName layersLs[i]
l.ishidden = true
)
)
)
/*
fn unhide = (
for i = 1 to layersLs.count do
(
l= LayerManager.getLayerFromName layersLs[i]
l.ishidden = false
)
)
*/
main( X_position ) -- wire to anything just as excuse to run a function
10 -- return any value to a dummy object
Originally I had made a maxScript file, and wiring parameters was just calling that custom function while slider was being manipulated. But every time I reset max, I have to run that script again, and I couldn’t manage a way to open it with an specific scene (not with max, just the scene which uses that function).