Notifications
Clear all
[Closed] Selecting light targets only
Mar 12, 2010 3:49 pm
on btn_selectByName_LightTargets pressed do
(
fn target_filt obj = isKindOf obj TargetObject
theTargetObjects = selectByName title:“Select Target objects” buttonText:“OK” filter:target_filt showHidden:true single:false
if theTargetObjects != undefined do
if theTargetObjects.count != 0 then select theTargetObjects else clearSelection()
)
I would like to filter this further so that only light targets show up in the select dialog, not camera targets.
Any thoughts ?
4 Replies
2 Replies
if you want to collect all light targets the easiest and most accurate way to do it is:
for obj in lights where iskindof obj TargetObject collect obj
Mar 12, 2010 3:49 pm
How about something like this?
(superclassof (refs.dependentNodes obj firstOnly:true)) == Light
So your filter function could look like this:
function lightTargetfilter obj =
(
(classof obj) == Targetobject AND (superclassof (refs.dependentNodes obj firstOnly:true)) == Light
)
1 Reply