Different behavior of float and matrix data type


#1

hello!

I’ve got a load of nodes with some custom attributes of type Boolean.

If i do

float $temop = `getAttr "object.boolattribute"`;

It comes out as 1, but if I’m using a matrix and I do

$myMatrix[0][0] = `getAttr "object.boolattribute"`;

It returns 0.

I don’t understand but hopefully one of you does!

Thanks


#2

It seems that the implicit typecasting doest not work properly with matrices. If you do a

float $f = `getAttr someboolean`;

The boolean is cast to a float. However a conversion from boolean to matrix seems not to exist so explicit cast can help:

matrix $m[4][4];
$m[0][0] = (float)`getAttr someboolean`;

#3

i seeeee, thanks!