unhashable MObjects

neilrubieHFV88
Explorer
Explorer

unhashable MObjects

neilrubieHFV88
Explorer
Explorer

Hi there, I used to be able to use MObjects in a set in Maya 2020, but in 2022 it doesn't seem to work. Just wondering if this is expected or what caused this changed?

import maya.OpenMaya as om
mobject = om.MObject()
object_set = set([mobject])

# Error: unhashable type: 'MObject'
# Traceback (most recent call last):
#   File "<maya console>", line 3, in <module>
# TypeError: unhashable type: 'MObject' #

Thanks!

 

 

0 Likes
Reply
235 Views
0 Replies
Replies (0)