Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 25-06-2021 , 03:53 AM
Registered User
Join Date: Jun 2021
Posts: 2

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!

user added image

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