Is there an equivalent of requiresUpdate() in geometry overrides?


#1

Hello,

I’m working on a MPxSurfaceShape with both geometryOverride/subSceneOverride as VP2 classes. I am setting an animation by tweaking mControlPoints at several frames and recording the interpolated curves in between.

The problem is that, with geometry override, the vertex positions are not interpolated with respect to time. The point is, actually, that the scene is not being refreshed. With subscene override this does not happen though, because of this great method requiresUpdate() which sends a signal dirty to viewport when necessary. I would like to have the same method in geometry override.

According to the VP2 porting guide, “requiresUpdate() is called every refresh and indicates whether to call update(). This is a different update logic from that of geometry overrides,which are only called when a state has changed internally that, requires a render item or geometry update, or an explicit request is made to indicate a change”.

I wonder if, as it looks, I should go for only subscene to perform my animations, or whether I’m just not noticing something else even simpler.

Many thanks!!


#2

No there isn’t any equivalent of requiresUpdate() in geometryOverride and that’s the main reason I would advocate using subSceneOverride over geometryOverride unless you have a specific need to use geometryOverride. subSceneOverride is simply the interface with more direct control over your geometry updates.

That said, if you still need to use geometryOverride there is one workaround that might be of use to you. You can invoke MHWRender::MRenderer::setGeometryDrawDirty(…) to explicitly dirty your shape so that geometryOverride will fire. That might be a viable workaround if you have the opportunity/callback to invoke it at the right times.


#3

Hi Keilun,

It works! Thank you a lot :smiley:
Indeed, this MHWRender::MRenderer class is very useful.