[Closed] help with assigning ca variable to float script
Hey,
I’ve been trying to get a hang of the new script controllers in max 8. I’m in the process of automating the rigging process for myself however i’ve run into a little problem.
Basically I want to add a float script to an IK Chain and assign variables to it.
IKChainAnkle = is my ik chain
ControllerIKCAnkle = IKChainAnkle.Transform.controller.swivelAngle.controller = float_script()
ControllerIKCAnkle.addTarget “FootRotate” FootCTRL.Rotation.controller.Z_Rotation.controller
The above works fine but when i try and assign a variable to a slider in my custom attribute, it starts to give me errors.
ControllerIKCAnkle.addTarget “FootCntrlSwivel” FootCTRL.modifiers[#‘PEN_Attribute_Holder 2’].LegControlsCA.kneeSwivel
The line above gives me the error:
Runtime error: IScriptCtrl::AddTarget – Target needs to be object or subAnim, got: 0.0
How would I fix this? Is there some type of syntax error on my end?
Thanks
FootCTRL.modifiers[#'PEN_Attribute_Holder 2'].LegControlsCA.kneeSwivel
the problem is that this code returns the value of the float parameter, which is 0.0, you need to pass it’s subAnim or controller to the .addTarget() function
try the following:
theCA = FootCTRL.modifiers[#'PEN_Attribute_Holder 2'].LegControlsCA[#kneeSwivel]
this return the subAnim of the kneeswivel parameter
if you’re just starting to get into scripted rigging it’s very important to know the differences between these different types of values, e.g. object properties, subAnim values, controller values, and the ways to access them, how they relate to each other.
if your not 100% certain about those, you should read up on them (look in the reference for getProperty/setProperty/getPropNames, as well as subAnim values and the associated functions.)
Will Do, I’ve actually been getting into the reference file quite a bit, however it does not contain much info on the float script. But I will look into those properties – need to learn more about them.Thanks a lot for your help. Much Appreciated.
-sheefy
Wow, every body that uses the PEn Attribute Holder please raise their hands.
I really do wish I could do a pole and find out how many shops and people are using this script now. I really do need to get back to completing version 3 but I fear that is a ways off at the moment.