[Closed] paramCollectorOps trouble
I am trying to write a simple script to add parameters to the parameter collector and I am having trouble getting it to work.
here is the script:
myBox = box length:50 width: 50 height:100
ParamCollectorOps.addNewRollout “Box” false
ParamCollectorOps.addParameter myBox.height 1 1
ParamCollectorOps.visible = true
According to the maxscript help, paramCollectorOps.addParameter only requires 3 arguments to be passed to it, the fpvalue (myBox.height), the collection index, and the rollout index.
When I execute the ParamCollectorOps.addParameter myBox.height 1 1 statement an error comes up saying that it was expecting 4 values when I only gave it 3.
Here is the error that comes up:
$Box:Box01 @ [0.000000,0.000000,0.000000]
OK
– Argument count error: addParameter wanted 4, got 3
So I have tried adding a fourth value. When I add an integer or boolean this error comes up:
– Unable to convert: 1 to type: String
Ok, so it wants a string. I change my script to this:
myBox = box length:50 width: 50 height:100
ParamCollectorOps.addNewRollout “Box” false
ParamCollectorOps.addParameter myBox.height 1 1 “Box Height”
ParamCollectorOps.visible = true
When I run this script here is what shows up in the listener window:
$Box:Box01 @ [0.000000,0.000000,0.000000]
OK
** system exception **
true
OK
So it is not working. The rollout gets added to the parameter collector but the parameter never gets added. Can anyone tell me why this isn’t working? I am running 3dsMax8.
Thanks
Anyone? Absolutely any help would be appreciated. Is my original post too long or badly formatted?
Hi Resbot,
You were almost there, the problem is that the parameter you are using as myBox.height is a value, you need to pass subAnims, so you need to add just the following:
myBox = box length:50 width: 50 height:100
myBox.height.controller = bezier_float() -- This Adds a controller to the height
ParamCollectorOps.addNewRollout "Box" false
ParamCollectorOps.addParameter myBox.height.controller 1 1 "Box Height" -- You are right, the fouth parameter is the name!
ParamCollectorOps.visible = true
The help is wrong in the number of parameters, and you are right to assume that the one missing is the Name. It clearly states though, that what is needs is Anim, not Value… with several other commands (wire parameter for instance) the error yields a message like “needed subAnims got 3.46” but in this case there is not such info, you just kinda have to know!
Hope this helps,
Rafael Polit Jr.
Quito, Ecuador.