Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

MFnMesh::createInPlace display issues (minimal example included)

MFnMesh::createInPlace display issues (minimal example included)

Anonymous
Not applicable
502 Views
1 Reply
Message 1 of 2

MFnMesh::createInPlace display issues (minimal example included)

Anonymous
Not applicable

Hello everyone,

 

I am still quite a newbie when it comes to the Maya C++ API and I am having trouble properly using the MFnMesh::createInPlace method. I end up with some nasty display issues in the viewport every time I attempt to change a shape with this method. And those issues happen even with the most basic of examples (such as the one attached with this post). Attached images somehow manage to show the effect.


I am running a Maya 2015 SP5 on Windows 7.

 

Am I missing something (like calling the method incorrectly or forgetting some necessary updating calls) ?


Any help or insight would be greatly welcome. Thanks a lot.

Cheers,
   Pierre.

0 Likes
503 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I have not used that function -- I think I tried it once before and had no luck with it.

 

Funny I just answered another persons question with this... so maybe it will help

 

Hi

 

In the past this is what I have done to create Meshes in Maya:

 

First create a Transform object -- because all Meshes need a transform reference:

Then I created a Mesh via MFnMesh.

Then I updated the DGModifier  and it worked for me.

 

MObject meshTransformObj = dgModifier.createNode("transform");

MFnDependencyNode dpNode(meshTransformObj);
dpNode.setName("meshTransform");

 

MFnMesh mesh;
mesh.create((int)uniquePositionsList.size(), (int)triangles, mPointArray, polygonCounts, polygonConnects, uArray, vArray, meshTransformObj);

mesh.setName("Mesh");

 

...

 

dgModifier.doIt();

0 Likes