View Full Version : selecting types of lights


deadalvs
08 August 2008, 05:22 AM
hi ..

i am searching a way to select types of lights...

pseudo:
select -all -type "pointLight";
select -all -type "spotLight";

* * *

thaaanks.

greatPumpkin
08 August 2008, 05:39 AM
select -r `ls -type spotLight`;

deadalvs
08 August 2008, 05:45 AM
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 !

deadalvs
08 August 2008, 06:04 AM
a little code so far.. this will help me editing my lights in the scene .. :)

// 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`);
}
}

CGTalk Moderation
08 August 2008, 06:04 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.


1