selecting types of lights


#1

hi …

i am searching a way to select types of lights…

pseudo:
select -all -type “pointLight”;
select -all -type “spotLight”;


thaaanks.


#2

select -r ls -type spotLight;


#3

sometimes just a little info is needed…

i checked the docs for similar commands, but i did not know that “spotLight” is actually considered as a maya specific type like “nurbsSurface” or “mesh”…

thank you !


#4

a little code so far… this will help me editing my lights in the scene … :slight_smile:

// lightEditWin V1; deadalvs, august 2008
////////////////////////////////////////////////////////////////////////////////////// start GUI

if (window -exists "lightEditWin" == 1){deleteUI “lightEditWin”;}

window -t “lightEditWin V1” lightEditWin;
columnLayout -adjustableColumn 1;

frameLayout -label “info” -cll true -collapse 1 randCamTranslateInfoLayout;
columnLayout -adjustableColumn 0;
text -l “”;
setParent …;
setParent …;

frameLayout -label “randCamTranslateSettings” -cll true -collapse 0 randCamTranslateSettingsLayout;
columnLayout -adjustableColumn 1;
text -l “”;
button -h 25 -l “select all lights” -command “select -r (ls -lt);”;
button -h 25 -l “select point lights” -command “select -r ls -type pointLight;”;
button -h 25 -l “select spot lights” -command “select -r ls -type spotLight;”;
text -l “”;
text -l “* * *”;
text -l “”;
button -h 25 -l “set DMap resolution to” -command “setDmapResolution();”;
intField -width 300 -v 512 setDmapResolution_intField;
text -l “”;
button -h 25 -l “set filter size to” -command “setFilterSize();”;
intField -width 300 -v 2 setFilterSize_intField;
text -l “”;
button -h 25 -l “emit diffuse (1/0)” -command “setEmitDiffuse();”;
intField -width 300 -v 1 setEmitDiffuse_intField;
text -l “”;
button -h 25 -l “emit specular (1/0)” -command “setEmitSpecular();”;
intField -width 300 -v 1 setEmitSpecular_intField;
setParent …;
setParent …;

showWindow lightEditWin;

//////////////////////////////////////////////////////////////////////

string $selectionArray[] = ls -sl;

for ($eachLight in $selectionArray){

setAttr ($eachLight + “.dmapResolution”) 256;

//end
};

//////////////////////////////////////////////////////////////////////
global proc setDmapResolution(){
string $selectionArray[] = ls -sl;
for ($eachLight in $selectionArray){
setAttr ($eachLight + “.dmapResolution”) (intField -q -v setDmapResolution_intField);
}
}
//////////////////////////////////////////////////////////////////////
global proc setFilterSize(){
string $selectionArray[] = ls -sl;
for ($eachLight in $selectionArray){
setAttr ($eachLight + “.dmapFilterSize”) (intField -q -v setFilterSize_intField);
}
}
//////////////////////////////////////////////////////////////////////
global proc setEmitDiffuse(){
string $selectionArray[] = ls -sl;
for ($eachLight in $selectionArray){
setAttr ($eachLight + “.emitDiffuse”) (intField -q -v setEmitDiffuse_intField);
}
}
//////////////////////////////////////////////////////////////////////
global proc setEmitSpecular(){
string $selectionArray[] = ls -sl;
for ($eachLight in $selectionArray){
setAttr ($eachLight + “.emitSpecular”) (intField -q -v setEmitSpecular_intField);
}
}


#5

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.