I am trying to find the difference between two lists - charLs and rigLs but
as I tried to use the list and set methods as I found online, it is giving
me very different results.
In the example below, I should be seeing *female01* and *elderly01* in the
diff1 results but yet I am getting *male01*
Even as I switched around the set, like in diff2, this time round it is
giving the list of the 3 rigs that was in the scene.
Am I doing anywhere wrong or using the wrong code commands?
pubObj = cmds.ls(type = "publishedRef")
rigLs = []
for item in pubObj:
nameSplit = item.split(':')
rigLs.append(nameSplit[0])
grpNode = cmds.ls("SceneGrp", type=grpNode.name())
check = cmds.objExists("|SceneGrp|characterRig")
charLs = cmds.listRelatives("|SceneGrp|characterRig", c=True)
# Assumingly the following are the items appended into the list
# rigLs : [u'male01', u'female01', u'elderly01']
# charLs :[u'male01']
diff1 = list(set(charLs)-set(rigLs))
# Results : [u'male01']
diff2 = list(set(rigLs)-set(charLs))
# Results : [u'male01', u'female01', u'elderly01']
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/35777d5c-62d6-4341-880b-9f3e5bd123e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.