PDA

View Full Version : IExprctrl...help in set expresion...


Polimeno
08-20-2008, 02:24 PM
hey all,

please, i need i little help to understand this :

IExprctrl / Expression Controllers

"
<boolean>SetExpression <&TSTR>Expression
Expression is In parameter
Sets the expression string to the string passed by-reference. Returns true on success, false otherwise.
"

i donīt know how the line should look like in SET EXPRESSION....


Ik1 = $obj_wrist
Ik2 = $obj_shoulder
Conval = distance Ik1 Ik2

for bone in selection do
(
F_exp = Float_Expression ()
bone.transform.controller.FK_Sub_Control.Position.controller.Zero_Pos_XYZ.X_Position.controller = F_exp
F_exp.AddScalarConstant "con" ConVal
F_exp.AddVectorNode "pt1" Ik1
F_exp.AddVectorNode "pt2" Ik2
---------------------------------------- MY QUESTION
F_exp SetExpression = "if ((length (pt1-pt2)-con)/2>0, (length (pt1-pt2)-con)/2,0)"
---------------------------------------- MY QUESTION
)

Bobo
08-20-2008, 03:17 PM
Same logic, it is a method (a function exposed by the controller), so no =

F_exp.SetExpression "if ((length (pt1-pt2)-con)/2>0, (length (pt1-pt2)-con)/2,0)"

Polimeno
08-20-2008, 04:03 PM
thks Bobo !

EDIT:


Ik1 = $obj_wrist
Ik2 = $obj_shoulder
Conval = distance Ik1 Ik2

for bone in selection do
(
F_exp = Float_Expression ()
bone.transform.controller.FK_Sub_Control.Position.controller.Zero_Pos_XYZ.X_Position.controller = F_exp
F_exp.AddScalarConstant "con" ConVal
F_exp.AddVectorNode "pt1" Ik1
F_exp.AddVectorNode "pt2" Ik2
F_exp.SetExpression "if ((length (pt1-pt2)-con)/2>0, (length (pt1-pt2)-con)/2,0)"
F_exp.SetDescription "IK_strech by length"
)


working for me now =)

CGTalk Moderation
08-20-2008, 04:03 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.