Created
October 30, 2013 20:43
-
-
Save bohdon/7239897 to your computer and use it in GitHub Desktop.
find unlinked lights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def getUnlinkedLights(): | |
linker = pm.selected()[0] | |
lonely = [] | |
for i in range(linker.link.numElements()): | |
ln = linker.link[i] | |
lights = ln.light.inputs() | |
objects = ln.object.inputs() | |
if len(lights) and not len(objects): | |
lonely.extend(lights) | |
return lonely | |
def getUnlinkedObjects(): | |
linker = pm.selected()[0] | |
lonely = [] | |
for i in range(linker.link.numElements()): | |
ln = linker.link[i] | |
lights = ln.light.inputs() | |
objects = ln.object.inputs() | |
if not len(lights) and len(objects): | |
lonely.extend(objects) | |
return lonely | |
pm.select(getUnlinkedLights()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment