View Single Post
# 2 22-03-2010 , 12:07 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
The reason why that is happening, is because `ls -sl` returns an array of objects, not a single object. A nasty way to get around this, I say nasty as there are much "cleaner" ways to do it, but since you know that there will always be only one object in the selection list at a time, you can do this:

$spotList = `ls -sl`;
$spot = $spotList[0];

This will only use the first object in your selection array.

You will also get into trouble with your code to assign the colors to your spotlight. You can fix this by doing this:

setAttr ($spot + ".color") -type double3 $colorR $colorG $colorB;

Hope this help you out mate.


Imagination is more important than knowledge.