How to write a expression with python in Maya

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  05 May 2018
How to write a expression with python in Maya

I'm kind of new in python and I'm struggling with a expression because I don't know how to write it . I'm writing a code to build and arm with stretch and squash. The expression is to connect the FK and IK stretch to the primary chain.

This is the result when I created the expression in Maya, but I don't know how to translate it to python.

expression -s "if (IK_FK_Blend_Ctrl.Arm_state == 0){\n\tShoulder_bind_jnt.scaleX = Shoulder_Fk_jnt.scaleX;\n\tElbow_bind_jnt.scaleX = Elbow_Fk_jnt.scaleX;\n}else if (IK_FK_Blend_Ctrl.Arm_state == 1){\n\tShoulder_bind_jnt.scaleX = Shoulder_IK_jnt.scaleX;\n\tElbow_bind_jnt.scaleX = Elbow_IK_jnt.scaleX;\n}" -o "" -n "StretchArm" -ae 1 -uc all ;

Perhaps, it's a basic question but i'm really stuck with this and I would really appreciated your help.
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:38 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.