SimplyMaya

Welcome back to SimplyMaya. Check out our latest training here.

MAYA TUTORIALS
MEL Scripts, Expressions & Programming Related Topics
 
Thread Tools
# 1 25-06-2021, 03:53 AM
gatopingado
Registered User
Join Date: Jun 2021
Posts: 1

Variable from the sum of two variables

Hi folks, I'm learning MEL and having trouble understating what's going on here.

I'm trying to get a variable from the sum of another two variables defined by object attributes, for example:

float $scaleY = `getAttr "pCube1.scaleY"`;
float $scaleX = `getAttr "pCube1.scaleX"`;
float $sum = ($scaleY + $scaleX);
print $sum;

This gives me the correct result, but I'm getting this warning:

// Warning: float $scaleX = `getAttr "pCube1.scaleX"`; //
// Warning: Line 2.42 : Redeclaration of variable "$scaleX" shadows previous declaration at line 1. Previous value will be overwritten by explicit initializer. //

Where exactly I'm redeclaring variable $scaleX? Is the syntax wrong? If anyone have any suggestions it would be highly appreciated. Thanks!


Reply to this thread
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