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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

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.

×