PDA

View Full Version : How do I make the viewport redraw itself and reupdate the objects in it?


Shulin
10-24-2007, 10:51 PM
I currently have a shader editor program that I wrote that interacts with my 3ds plugin that modifies the material used on an object in the scene. The plugin is not MaxScript, it was done from the SDK in c++.

Right now, in order for the user to see the changes that have occured behind the scenes, they have to modify the scene in some way (pan the camera, turn wireframe on/off, etc.). I would like to know what functions I need to call in order to update the viewports so that the changes are shown immediately. I really just need to know how to clear the cache of the objects so that they get redrawn with the new data.


Thanks for the help.

Here's things I have tried:

Attempt 1: GetCOREInterface()->ForceCompleteRedraw(false);
This didn’t work out so well. While it did accomplish what I was looking for, it caused 3DSMax to crash pretty often.

Attempt 2: GetCOREInterface()->SetTime(GetCOREInterface()->GetTime(), TRUE);
Didn’t really work out so well. Didn’t update fast enough, or when it did update, the whole viewport wasn’t being redrawn so I was having weird pieces missing.

Attempt 3: GetCOREInterface()->RedrawViews(GetCOREInterface()->GetTime());
Didn’t work at all.

Shulin
10-29-2007, 05:58 PM
Noone has any ideas here or on the 3ds max forums? Jeeze.

Shulin
12-12-2007, 11:14 PM
bump 'cause I still need an answer.

Gravey
12-13-2007, 09:32 AM
have you had a look in the sdk help? i just typed 'redraw' and found this one you havn't mensioned:

virtual void Interface7::RedrawViewportsNow ( TimeValue t, DWORD vpFlags = VP_DONT_SIMPLIFY ) [pure virtual]

CGTalk Moderation
12-13-2007, 09:32 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.