if cmds.ls(["foo", "bar", "baz"]):
print "at least one exists"
names = ["foo", "bar", "baz"]
found = cmds.ls(names)
if len(found) == len(names):
print "all objects exist"
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e54bc6c2-7fea-47ee-a3ce-a9e35bb8f568%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks a lot Justin it really helps.
I don t need it right now but for sure would be nice to seee how you handle the case where some object exist and some don't.
For now, let see if am able to convert that to mel.
Thanks a lot again
Carlos
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/BY2PR11MB0552CAD7BC2BFAAB0BFACAA6DB0C0%40BY2PR11MB0552.namprd11.prod.outlook.com.
Thanks a lot Justin it really helps.
I don t need it right now but for sure would be nice to seee how you handle the case where some object exist and some don't.
items = ["foo", "biz", "baz"]
for item in items:
if cmds.objExists(item):
print item, "exists"
else:
print item, "does not exist"