Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cal0n opened this issue Jun 30, 2021 · 1 comment

Comments

@Cal0n
Copy link

Cal0n commented Jun 30, 2021

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?

@Cal0n Cal0n changed the title Vertex / Edge / Face components no longer hashable in Maya 2022 Vertex / Edge / Face components no longer hashable in Maya 2022, unusable as dictionary keys Jun 30, 2021
@jhultgre
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants