For reasons, I had to recently delete a hierarchy where all 1726 nodes in the hierarchy were locked ha. So a quick google popped up Tyler Hurd's blog post. Really super useful so I thought I'd post it here too, so I can find it easily if I need it.
Side note....I need to figure out how to get code to format properly on Weebly haha.
Side note....I need to figure out how to get code to format properly on Weebly haha.
import pymel.core as pm
for obj in pm.selected() :
if pm.lockNode(obj,q=1,l=1)[0] :
pm.lockNode(obj,l=0)
print '%s unlocked.'%obj
else :
print '%s not locked.'%obj
for obj in pm.selected() :
if pm.lockNode(obj,q=1,l=1)[0] :
pm.lockNode(obj,l=0)
print '%s unlocked.'%obj
else :
print '%s not locked.'%obj