Notifications
Clear all

[Closed] custom attributes and expression ctrl

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”

2 Replies

b.rotation.controller.z_rotation.controller.addScalarTarget "brot" a.customattrib[#radius]

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 !