if (size($word)) print("Not empty.\n");
is perfectly valid. however $word isnt defined as a array type. so youd need to define it! (maya does do variable chekking on compile hence the error // Error: "$word" is an undeclared variable. //)
float $word[]; now this would obviously produce false so set some values to it such as
$word={1.0,1.2};
so executing:
CODE
$word={1.0,1.2};
if (size($word)) print("Not empty.\n");
results in:
Not empty.
as does:
CODE
$word={1.0,1.2};
if (size $word
) print("Not empty.\n");
and
CODE
$word={1.0,1.2};
if (size($word)
) print("Not empty.\n");
This wont work:
CODE
if (-query -radius "mySphere"
== 5)
because theres no command or procedure associated to it flags are just modifiers for the commands themselves. Also most likely my Sphere isnt a valid target for querying either. See maya woks on a peculiar early object centric vocabulary.
This manifests itself in mel in a design way where each node has a correspondent utility function (if the developper bothered to make one), or gnereic data mining commands.
for example:
sphere -n mySphere;
// Result: mySphere makeNurbSphere5 //
now the node coupled with sphere command is makeNurbSphere5 not mySphere, and the sphere command only ever works on node types makeNurbsSphere
you could now querry:
if (sphere -q -r makeNurbSphere5
==5)
it woudl be valid as would be:
if (sphere("-q","-r","makeNurbSphere5")==5)
theese 2 forms being equal. however wouldn't work on poly sphere wich operates on the accessory polySphere
in practice you wouldn't use accessories to ever querry node parameters because its not practical. Also you wouldnt bet on knowing the name of the history node either. But youd traverse the history for a occourence of the node and use getAttr to querry the value. Actually you never need the accessories they are just for convience in hooking up the default but rather bring alternate connections.
PS: your second example is also perfectly valid:
string $word2 = "wow";
if (size $word2
) print("Not empty.\n");
Not empty.
are you sure you use backtics ` and do not use ' or