Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 17-01-2019 , 07:08 AM
Registered User
Join Date: Jan 2019
Posts: 1

Help with old Script

Hi
Im following a old maya 2013 tutorial.
Atm i try to build write a FK /IK snap script.

$r_upperArm = `xform -query -worldSpace -rotation leftUpperArm_FK_snap_JNT`;
xform -worldSpace -rotation $r_upperArm[0] $r_upperArm[1] $r_upperArm[2] leftUpperArm_FK_CTRL;

This is the old script.

xform -query -worldSpace -rotation leftUpperArm_FK_snap_JNT this part was working fine. But when i wanna store the xform into $r_upperArm its not working anymore.

Im using maya 2018 and tryed this version:

$r_upperArm = xform ("-query -worldSpace -rotation L_upperArm_FK_snap_JNT");
xform -worldSpace -rotation $r_upperArm[0] $r_upperArm[1] $r_upperArm[2] L_upperArm_FK_CTRL;

But im getting the error:
// Error: xform -worldSpace -rotation $r_upperArm[0] $r_upperArm[1] $r_upperArm[2] L_upperArm_FK_CTRL; //
// Error: Line 2.54: "$r_upperArm" is not an array. //
// Error: xform -worldSpace -rotation $r_upperArm[0] $r_upperArm[1] $r_upperArm[2] L_upperArm_FK_CTRL; //
// Error: Line 2.69: "$r_upperArm" is not an array. //
// Error: xform -worldSpace -rotation $r_upperArm[0] $r_upperArm[1] $r_upperArm[2] L_upperArm_FK_CTRL; //
// Error: Line 2.91: "$r_upperArm" is not an array. //

I new to mel scripting and rly hope somebody can help me ;D

best regards

# 2 30-01-2019 , 12:17 AM
Subscriber
Join Date: Mar 2014
Posts: 4
Hi, I don't script in MEL, but the double quotes in this statement might be an issue $r_upperArm = xform ("-query -worldSpace -rotation L_upperArm_FK_snap_JNT"); In C# the double quotes would mean you are trying to store text into an array. I hope this helps ( I haven't done any programming for a long time and I am rusty).

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads