MPxGeometryOverride with a simple triangle in viewport 2.0


Hi everyone,
I wrote a simple class derived from MPxGeometryOverride and applied it to a triangle, only to see it disappear. updateDG(), updateRenderItems(), populate geometry() are all being called. Maya creates 6 default render items,; 2 StandardShadedItems, 2 FlatShadedItems, 2 OSDAdaptiveShadedItems. I have registered it with string drawdb/geometry/mesh. My scene contains a single triangle. As soon as I load the plugin, it disappears. Not even the outline is drawn. The geometry requirements given to me asks for two vertex buffers viz position, normal and surprisingly asks for zero index buffers. Now, I know that I haven’t given an awful lot of information but what could possibly go wrong for a triangle? Any ideas as to how I can proceed with debugging?


Alright. I solved the issue. Thought the index buffer requirements are zero, you need to create an index buffer and associate it with each render item.