Jump to content

Setting render mode from plug-in


JBenghiat

Recommended Posts

I have a button that changes to a 3D view based on the plug-in's orientation.

 

I can't get the render mode to change.  I've tried:

 

gSDK->SetRenderMode(gSDK->GetActiveLayer(), renderOpenGL, true, true);

 

gSDK->NewCurrentViewMatrix(viewMatrix, true);

 

WorldRect drawRect;

ViewRect windowRect;

gSDK->GetScreenSize(windowRect);

gSDK->ViewRect2WorldRect(windowRect, drawRect);

gSDK->RedrawRect(drawRect);

 

in various orders, but the render mode always stays as is.  The RW camera successfully changes render modes, so this must be possible...

Link to comment
  • 2 weeks later...
  • 3 weeks later...

Ok, figured it out.  This works:

        gSDK->SwitchFromPlanTo3DView();
        gSDK->SetViewMatrixByVector(lookFrom, lookTo, WorldPt3(0, 0, 1), viewMatrix);
        gSDK->SetRenderMode(gSDK->GetActiveLayer(), renderOpenGL, true, true);
        gSDK->NewCurrentViewMatrix(viewMatrix, false);
        gSDK->RefreshRenderingForSelectedObjects();

I didn't take the time to test whether SwitchFromPlanTo3DView() or RefreshRenderingForSelectedObjects() or both are what makes it work, but it's been reliable so far.

Link to comment
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...