Export of geometry with modifiers.

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  5 Days Ago
Export of geometry with modifiers.

Hello.
I'm trying to export geometry through my visualization plugin (c++). Geometry is exported, but visibility modes of viewport / renderer for modifiers do not work. Separate values ​​of smoothing iterations do not work (for example, for viewport = 0 iteration, for renderer = 2) in the meshsmooth modifier. That is, geometry always gets what is seen in the viewport.
The documentation says that this is done via GetRenderMesh(). For a spline this works - ican get a different view for the viewport and render. But for geometry there is not.I will be grateful for any help.
Here's what's happening here:

if (os.obj->SuperClassID() == SHAPE_CLASS_ID)
{
ShapeObject* shape = static_cast<ShapeObject*>(os.obj);
shape->GenerateMesh(t, GENMESH_RENDER, mesh);
mesh = shape->GetRenderMesh(t, node, theView, delMesh);
}
else
{
tri = GetTriObjectFromNode(node, t, needDel);
if (tri == nullptr) return false;
mesh = tri->GetRenderMesh(t, node, theView, delMesh);
}

GetTriObjectFromNode(INode *node, TimeValue t, int &deleteIt)
{
deleteIt = FALSE;
Object *obj = node->EvalWorldState(t).obj;

if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0)))
{
TriObject *tri = (TriObject *) obj->ConvertToType(t, Class_ID(TRIOBJ_CLASS_ID, 0));
// Note that the TriObject should only be deleted
// if the pointer to it is not equal to the object
// pointer that called ConvertToType()
if (obj != tri) deleteIt = TRUE;
return tri;
}
elsereturn nullptr;
}
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:24 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.