View Full Version : custom attributes and expression ctrl

02 February 2009, 12:40 PM
I want to change the value of my expression ctrl by using a custom attribute.
I dont find how to point the custom attributes value (here :????)
please help

a=box height:10 width:10
b=cylinder height:20 radius:10 sides:6

-- add custom attributes to a
newAttrib = attributes customattrib
Parameters main rollout:params
Radius Type:#float UI: Radius Default:30.0

Rollout params "cylinder ctrl"
spinner Radius "z rotation:" Type:#float Range:[0,10000,30]


custAttributes.add a newAttrib

--add expression ctrl to cylinder z rotation
b.rotation.controller.z_rotation.controller = Float_Expression()
b.rotation.controller.z_rotation.controller.addScalarTarget "brot" ????
b.rotation.controller.z_rotation.controller.setExpression "brot*4"

02 February 2009, 12:54 PM
b.rotation.controller.z_rotation.controller.addScalarTarget "brot" a.customattrib[#radius]

02 February 2009, 01:53 PM
wow thank you. After hours looking for this over the maxscript help and google you bring it to me in few minutes! THANK YOU ZeBoxx2 !

CGTalk Moderation
02 February 2009, 01:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.