Linking GeomStaticSmoothedMesh to GeomStaticMesh

Hi,
I have a geomStaticMesh plugin that I would like to smooth.
Seemingly the GeomStaticSmoothedMesh need to be used, However I can’t find any example on how to link the mesh parameter of GeomStaticSmoothedMesh to my geomStaticMesh plugin.

        smoothGeomPlugin=newPlugin("GeomStaticSmoothedMesh");
        DefPluginListParam *meshParam=new DefPluginListParam("mesh");
        meshParam->setPlugin(0,baseGeomPlugin); // baseGeomPlugin is my GeomStaticMesh plugin
        smoothGeomPlugin->setParameter(&meshParam);

This doesn’t even compile.
Any suggestion on what to correct in the code to smooth my mesh ?
Thanks.

smoothGeomPlugin->setParameter(meshParam);

Thanks, I can compile & execute now.
However the result is not the same than when rendering a “real” mesh. See both pictures attached.
One has a Maya-native Cube rendered with VRay Smooth/Subdivision, and the 3 items behind are the Cubes rendered with my SmoothMesh code. And same for the other picture with spheres. Any parameter I would have forgotten ? Thanks.


It seems to me that the issue is in your mesh data. Subdivision needs proper mesh topology to work properly. You have passeed probably 6 planes, not a proper cube mesh.

I indeed gave 12 triangles to one geomstaticmesh plugin. What would be the difference with a proper cube mesh ? Common vertices shared among different faces ?
Thanks !

Yes, of course.

Can you show us the GeomStaticMesh and GeomStaticSmoothedMesh plugins in your vrscene?
It should just work.
Do you set other parameters than mesh in your GeomStaticSmoothedMesh instance?

Putting a proper geometry (common vertices) made it work like a charm. Thanks !!