Forcing SceneWidget refresh after geometry change #7432
-
|
I have a SceneWidget displaying a mesh, and receiving mouse and key events. The key event handler does various manipulations (e.g. translation/rotation) on the mesh, then does a remove_geometry/add_geometry to (re)render the updated mesh. Randomly, the SceneWidget does NOT update until the mouse moves. It's annoying but not critical, given that the mouse is sensitive enough to generate a triggering event most of the time, but I suspect that it will be a lot less random on a touchpad-equipped laptop. I've tried various combinations of CONSUMED vs HANDLED on the event and force_redraw() after the geometry update, but the problem persists. Is this normal behavior? And if so, is there a workaround? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
This feels like a Godzilla-sized kludge, but it appears to work... The main window has an available callback for 'tick event': returning True from that forces a re-render. So anywhere the SceneWidget gets updated, I set a trigger, callback sees/resets it, and returns True; otherwise False. In init: In the callback: Mind you, I'm not quite sure why it works or why it's necessary, but so it goes. |
Beta Was this translation helpful? Give feedback.
This feels like a Godzilla-sized kludge, but it appears to work...
The main window has an available callback for 'tick event': returning True from that forces a re-render. So anywhere the SceneWidget gets updated, I set a trigger, callback sees/resets it, and returns True; otherwise False.
In init:
In the callback:
Mind you, I'm not quite sure why it works or why it's necessary, bu…