PDA

View Full Version : Need help with null....


rhoffm22
08-14-2003, 01:44 PM
if(`ls -sl`==null)
{
EPCurveTool;
}
else
{
boundary -ch 1 -or 0 -ep 0 -rn 0 -po 0 -ept 0.01 `ls -sl`;
layerEditorAddObjects Head_surfaces;
select -cl;
EPCurveTool;
}

When I run this Mel script is says
// Error: if(`ls -sl`==null)
//
// Error: Invalid use of Maya object "null". //

How do I say to it that if the selection has nothing then just run the EPCurveTool....

Thanks

wrend
08-14-2003, 03:08 PM
my usual method:

if (!size(`ls -sl`)) {
}

rhoffm22
08-14-2003, 03:17 PM
Thanks a lot I didn't think about using a attribute to test.

wrend
08-14-2003, 03:22 PM
no probs.

not sure what you mean by attribute though?

ls returns a string array, size returns how many elements the array has, if it has 0 (ie, nothing selected), and you ! that, your in!

CGTalk Moderation
01-15-2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.