LumaPictures / pymel

Python in Maya Done Right
Other
479 stars 130 forks source link

face with no connected faces raises error when using MeshFace.connectedFaces() #367

Closed svenneve closed 8 years ago

svenneve commented 8 years ago

When passing a face with no connected faces pymel raises an error when using MeshFace.connectedFaces()

Is this intended by design or is this indeed a bug? I find it hard to believe this would be by design, shouldn't it rather return None or an emtpy list?

import pymel.core as pm

plane = pm.polyPlane(sx=1, sy=1)[0]
face = plane.f
face.connectedFaces()

gives as result:

# Error: Unable to determine Pymel type for []
# Traceback (most recent call last):
#   File "<maya console>", line 5, in <module>
#   File "C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages\pymel\core\general.py", line 5237, in connectedFaces
#     return MeshFace( self, self._sequenceToComponentSlice( [ array[i] for i in range( array.length() ) ] ) )
#   File "C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages\pymel\core\general.py", line 2083, in __new__
#     pymelType, obj = _getPymelType( argObj, name )
#   File "C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages\pymel\core\general.py", line 113, in _getPymelType
#     raise ValueError( "Unable to determine Pymel type for %r" % (arg,) )
# ValueError: Unable to determine Pymel type for [] # 
pmolodo commented 8 years ago

fixed in https://github.com/LumaPictures/pymel/commit/e187864765119a0313719dcb827ec65b57b8c2cc