Thanks for fixing that pasha_sevez That script seems to Uninstance all the instances in a scene very handy but I what i want to do select all instances in a scene or get a list of them. If that makes sense ? Not sure if that's really possible though.
Just call mc.select(getInstances()) instead, you don't need the uninstance function. Like so:
import maya.cmds as mc
import maya.OpenMaya as om
def getInstances():
instances = []
iterDag = om.MItDag(om.MItDag.kBreadthFirst)
while not iterDag.isDone():
instanced = om.MItDag.isInstanced(iterDag)
if instanced:
instances.append(iterDag.fullPathName())
iterDag.next()
return instances
mc.select(getInstances())
Just call mc.select(getInstances()) instead, you don't need the uninstance function.
Yup, forgot to mention ) Just fixed the code from the link above )) Btw, really handy code, saved it for myself too. It finds ALL instances and tries to make them copies instead.
Thanks for fixing that pasha_sevez That script seems to Uninstance all the instances in a scene very handy but I what i want to do select all instances in a scene or get a list of them. If that makes sense ? Not sure if that's really possible though.
As @Axi5 said, just use getInstances() - but adjust the usage a bit:
Replies
http://lesterbanks.com/2010/06/uninstance-all-instances-in-maya/
As @Axi5 said, just use getInstances() - but adjust the usage a bit:
That's because getInstances() returns you a list of shapes, not transforms.
When I use this, I only get this error...<bound method Instance_Tools.getInstances of <instanceTools.Instance_Tools object at 0x000002279E3FE888>>
any idea why?