Jump to content
JBenghiat

Setting render mode from plug-in

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...

Share this post


Link to post

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.

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...