Selecting second objects in scene


#1

string $sel[] = ls -typ "mesh";
select $sel[1];

I want to select second object in the scene without using select command is it possible.


#2

You want to select something without selecting someting? Hmmm… that’s a problem :). I suppose you want to modify the object and you want to select the object to modify it like this:

select "pCube1";
move -r 1 0 0;

In most cases you can add the objects as an argument to the command:

move -r 1 0 0 "pCube1";

Of course just in case that’s what you want to do…


#3

i want to select second object poly in the scene and apply shader using ls command


#4

Assinging shaders work with the sets() command. Here you can:

string $obj[] = `ls -sl -type "mesh"`;
sets -addElement $obj[1] yourShadingGroupName;