LumaPictures / pymel

Python in Maya Done Right
Other
490 stars 131 forks source link

Vertex / Edge / Face components no longer hashable in Maya 2022, unusable as dictionary keys #444

Open Cal0n opened 3 years ago

Cal0n commented 3 years ago

This works in Maya 2020:

import pymel.core as pm
cube = pm.polyCube()[0]
print(cube.vtx[2].__hash__())

But in Maya2022 it results in:

# Error: 'NoneType' object is not callable
# Traceback (most recent call last):
#   File "<maya console>", line 3, in <module>
# TypeError: 'NoneType' object is not callable # 

Because: cube.vtx[2].__hash__ == None

This prevents users from storing for example MeshVertex objects as keys in dictionaries. Is this change intentional?

jhultgre commented 2 years ago

I'm running into the same issue trying to compare sets of components.