MFnMesh setPoints setVertexNormals performace

MFnMesh setPoints setVertexNormals performace

Anonymous
Not applicable
756 Views
3 Replies
Message 1 of 4

MFnMesh setPoints setVertexNormals performace

Anonymous
Not applicable

Hi everyone.

I have done a custom node plugin that generates geometries every frame gathered from an external software. The IPC communication is done correctly. Anyway, updating the geometry in Maya has low performance.

1.- My node has an array of output meshes, and each frame i updated them. First time, if there is no meshOb associated with the outputHandle i generate a new mesh using MFnMeshData. Next times, i only update it if the mesh is there. (Similar to Alembic Node)

 

2.- Updating the geometry means setPoints and setVertexNormals. setPoints performance is really good (0.2 ms for 40.000 vertices), anyway, setVertexNormals takes about 3ms per output mesh.

 

Does anyone knows about setVertexNormals performance and how to achieve better times?????

Thank you in advance

0 Likes
757 Views
3 Replies
Replies (3)
Message 2 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

I didn't find any info about improving performance of setVertexNormals in our systems. Since you've mention that you are doing something similar to AlembicNode, I am wondering if it would be better to write your own geometry instead(e.g. abcCache, gpuCache, apiMeshShape.)

 

I think your use case might be more similar to apiMeshShape. It uses MPxGeometryData and MPxGeometryIterator to output geometry data for the custom shape node. There are two nodes in this sample, in apiMeshCreator, it creates its own geometry data structure as MPxGeometryData and use it in the apiMeshShape node.

 

Hope it helps.

 

Yours,

Li

0 Likes
Message 3 of 4

Anonymous
Not applicable

Lets give it a try. Thank you so much for your answer. I will update the post asap. 😉

0 Likes
Message 4 of 4

Anonymous
Not applicable

Well, the examples you pointed me to seems to be far more complicated. What i exactly need is:

1.- Create in Maya lots of geometries that i read through inter process communication and update their animation during frames. I don't need to let the user modify the geometries or access components, but i do need to assign them custom shader networks.

 

That's the main reason i was using the simple methods, because if i go to geometryOverride way, or surfaceShapes way or subSceneOverride, i would need to write my own drawing code, and it seems pretty complicated. Moreover, if i use this methods and i want to render in VRay or Arnold, i guess i need a translator too.

 

Hope there is a simpler way to do it 🙂

0 Likes