Error: MFnMesh : no matching constructor found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried running this script on maya2022, but I am stuck with this error.
I created two spheres in the scene as a test and wanted to check the surface collusion using this script. ended up with the error which I have pasted below.
import maya.api.OpenMaya as OpenMaya
surface1_name = "pSphere1"
surface1_fn = OpenMaya.MFnMesh(surface1_name)
surface2_name = "pSphere2"
surface2_fn = OpenMaya.MFnMesh(surface2_name)
are_colliding = surface1_fn.collide(surface2_fn)
if are_colliding:
print("The surfaces are colliding")
else:
print("The surfaces are not colliding")
# Error: MFnMesh : no matching constructor found
# Traceback (most recent call last):
# File "<maya console>", line 4, in <module>
# ValueError: MFnMesh : no matching constructor found #
Kindly let me know the way forward