View Full Version : assign objects to displaylayers if not in default display

06 June 2007, 12:24 PM
My script is supposed to assign objects to displaylayers "NotAssignedObjects"
if they are not on a layer already, therefore they are in the default display layer with layerID = 0. Unfortunately this sometimes ignores that objects are already on a layer so i end up with everything on "NotAssignedObjects". What could be wrong?

string $Obj[] =`ls -geometry`;
string $geoObj[] = `listRelatives -p -f $Obj`;

for ($i= 0; $i < size($geoObj); $i++)
string $curLayer =`objectLayer $geoObj[$i]`;
int $layerID =`getAttr ($curLayer+ ".id")`;
if ($layerID == 0)
catch(`editDisplayLayerMembers "NotAssignedObjects" $geoObj[$i]`);

06 June 2007, 09:25 AM
i try to select the objects in the default layer directly.
Doesnt work either. Very strange.

objectLayer nurbsTorusShape1;
// Result:defaultLayer//

string $obj[]=`editDisplayLayerMembers -q defaultLayer`;
// Result: //

CGTalk Moderation
06 June 2007, 09:25 AM
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.