Hello Dilen, 
sorry for rising this old post, anyway I am encountering the same problem: 
I have to iteratively eliminate group of faces from a mesh. Using 
MFnMesh.deleteFaces() is horribly slow for each face and using extractFaces 
doesn't work properly (faces eliminated in the last iteration re-appear in 
the next iteration). So how did you reconstruct the mesh using only the 
faces that you needed?

Il giorno venerdì 12 giugno 2015 14:12:16 UTC+2, Dilen Shah ha scritto:
>
> Hey Janos,
>
> Thought so, it seems bugged so that's a relief. Well I actually tried that 
> already which was working but was not giving me the result I needed.
>
> So well I chose a safer path of reconstructing the mesh without those 
> faces and thus have a cleaner mesh.
>
> Thanks for your help!
>
> D.
>
> On Friday, June 12, 2015 at 1:26:32 PM UTC+2, Janos Hunyadi wrote:
>>
>> Ok I think I remember now. I checked one of my plugins where I had to 
>> delete some faces. And the API does seem to be bugged. Here's how I did it 
>> :D
>> Little hack but it should work.
>>
>> Extract the faces with MFnMesh extractfaces, than use MFnMesh 
>> collapseFaces on the extracted faces. After you collapsed them and do an 
>> Updatesurface maya "deletes" those faces.
>>
>> :D
>>
>> Cheers,
>> J
>>
>> On Thursday, June 11, 2015 at 4:29:03 PM UTC+2, Dilen Shah wrote:
>>>
>>> Hey Janos,
>>>
>>> Hahahahah, you know what I just did try it couple of hours that, but it 
>>> still doesn't do anything.
>>>
>>> D.
>>>
>>>
>>> On Thursday, June 11, 2015 at 3:59:10 PM UTC+2, Janos Hunyadi wrote:
>>>>
>>>> What you can do it is put it into a plugin. Compute it inside your 
>>>> plugin and output the mesh as a plug. It should work that way.
>>>> J
>>>>
>>>> On Wednesday, June 10, 2015 at 5:45:34 PM UTC+2, Dilen Shah wrote:
>>>>>
>>>>> Hey Janos,
>>>>>
>>>>> I am using Maya 2014, and it doesnt do it for me, I tried it on a 
>>>>> plane and tried to deleteFace, deleteEdge but it didnt do it for me and I 
>>>>> am using normal viewport and not viewport 2.0. I am using Python API.
>>>>>
>>>>> I got no clue why it isnt doing it for me.
>>>>>
>>>>> D.
>>>>>
>>>>>
>>>>>
>>>>> On Tuesday, June 9, 2015 at 8:28:26 PM UTC+2, Janos Hunyadi wrote:
>>>>>>
>>>>>> Works for me in Maya 2016. I just replaced the outputShape with a 
>>>>>> simple subdivided plane-s output shape "pPlaneShape1" and it deleted it. 
>>>>>> It 
>>>>>> might be something with Viewport 2.0. What maya version are you using? 
>>>>>> 2015 
>>>>>> If I recall correctly might have some update issues with VP 2.0 in 
>>>>>> python.
>>>>>>
>>>>>> J
>>>>>>
>>>>>> On Monday, June 8, 2015 at 11:29:02 AM UTC+2, Dilen Shah wrote:
>>>>>>>
>>>>>>> Hey guys,
>>>>>>>
>>>>>>> I am trying to delete faces from my Mfnmesh using 
>>>>>>> MFnMesh.deleteFace() command but it seems to be not working.
>>>>>>>
>>>>>>> Here is my code:
>>>>>>>
>>>>>>> import maya.OpenMaya as OpenMaya
>>>>>>>
>>>>>>> name = "outputShape"
>>>>>>>
>>>>>>> list = OpenMaya.MSelectionList()
>>>>>>> node = OpenMaya.MObject()
>>>>>>> list.add(name)
>>>>>>> list.getDependNode(0, node)
>>>>>>>
>>>>>>> meshFn = OpenMaya.MFnMesh(node)
>>>>>>>
>>>>>>> meshFn.deleteFace(14)
>>>>>>> meshFn.updateSurface()
>>>>>>>
>>>>>>> It does absolutely nothing, can anyone tell me if there is another 
>>>>>>> way to do it in API or am I doing something wrong?
>>>>>>>
>>>>>>> Thank you.
>>>>>>>
>>>>>>> D.
>>>>>>>
>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/8ef5216a-6af5-407f-b5cb-a2eb61c9c0c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to