SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

SM Forums / Lounges / Maya Basics & Newbie Lounge / Help with old Script

Maya Basics & Newbie Lounge Please post in this section ONLY if your question doesn't fit in anywhere else on the forum, or if you're not sure which section it's relevant to. We also have Free streaming trial available.

Join the conversation. Reply to post
Thread Tools
17-01-2019, 07:08 AM   #1
Registered User
Join Date: Jan 2019
Posts: 1
Help with old Script
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
  Reply with quote
30-01-2019, 12:17 AM   #2
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).
  Reply with quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing the "Quick help" window size in the maya 2012 script editor. Jouri Programming 3 27-11-2011 06:15 AM
load pre-made script rejh2 Maya Basics & Newbie Lounge 3 28-02-2010 12:33 AM
GI_Joe script Blayd Maya Basics & Newbie Lounge 7 01-10-2006 10:07 PM
looking for a mel script on UV mapping junkyBob Maya Basics & Newbie Lounge 1 14-11-2005 03:21 AM
Simple script for you all.... ragecgi Programming 7 24-01-2003 03:34 AM