Created
August 29, 2015 11:26
-
-
Save SEVEZ/d8bd872afdc47cbc09f6 to your computer and use it in GitHub Desktop.
Check if object is referenced
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
selection = cmds.ls(sl = True) | |
for model in selection: | |
refcheck = cmds.referenceQuery(model, inr = True) | |
if (refcheck == 1): | |
reftodel = cmds.referenceQuery(model, f = True) | |
cmds.file(reftodel, rr = True) | |
cmds.file(newfile, r=True) | |
else: | |
cmds.delete(model) | |
cmds.file(newfile, i=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment