Reading render-time mesh

Reading render-time mesh

Anonymous
Not applicable
573 Views
2 Replies
Message 1 of 3

Reading render-time mesh

Anonymous
Not applicable

I'm working on a render plugin for 3DS Max and I'm having problems reading the render-specific object meshes, e.g. MeshSmoothed mesh with a different number of smooth iterations (using Render Values).

 

I seem to be stuck with the mesh visible in the viewport.

 

I'm using this procedure to get the final mesh:

meshNode = <the object's INode>
Object * object = meshNode->EvalWorldState(time).obj;
GeomObject * geomObject = (GeomObject *)object;
Mesh * mesh = geomObject->GetRenderMesh(time, meshNode, *(View *)&nullView, needDelete);

 Then I read out the geometry data and save it in the renderer's specific storage.

 

Can anyone see where the problem is?

Thanks

0 Likes
574 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

you just need to make sure all proper notifications were sent to the scene objects prior to parsing, like BeginRender, Update, NOTIFY_PRE_RENDERFRAME, etc. Just copy the calls from cjrender example

0 Likes
Message 3 of 3

Anonymous
Not applicable

Díky :),

I was missing the RenderBegin and RenderEnd calls on INodes. It's kind of unfortunate though that the objects with render-specific settings lose their cache and get rebuilt every time they make the switch from viewport to render and vice versa - this makes listening for mesh changes quite a tedious process as these rebuilds get in the way 😕

0 Likes