Hey all,
I have an odd expression issue currently and I’m not sure what’s going on. If you have any idea I’d love to hear your thoughts.
Below is the expression that’s not working in Maya 2016-
//////////////////
vector $pointA = pointPosition curve1.cv[1]
;
vector $pointB = pointPosition curve1.cv[0]
;
vector $distV = $pointA - $pointB;
float $TransValue = (mag($distV)/25)-1;
if ($TransValue > 1) $TransValue = 1;
if ($TransValue < 0) $TransValue = 0;
print $TransValue;
brush2.transparency1R = $TransValue;
brush2.transparency1G = $TransValue;
brush2.transparency1B = $TransValue;
//////////////////
when running this expression I get this error -
// Error: An execution error occured in the expression expression1. //
// Error: line 0: No object matches name: curve1.cv[1] //
Now I know for a fact that object curve1.cv[1] exists… I can select it with both melscript and python… The interesting part about all of this is if I turn off setting the brush transparency, everything works fine… “$TransValue” get’s calculated fine, no errors, and I can even set the transparency values of “brush2” with static integers and everything works fine…
but when driving the brush2.transparency with the $TransValue variable, Maya flips a tit. Any ideas?
I’m just confused because it either should not work at all or work in this instance… I shouldn’t be able to set the values of the “brush2.transparency” with static numbers OR “$TransValue” shouldn’t calculate correctly when I comment out the last 3 lines of the transparency setting.
Thanks guys and gals.