Notifications
Clear all

[Closed] Create/delete node during playback?

I’m trying to create some helper nodes during timeline playback and then clean them up (delete them) when the user stops playback.

Creating the nodes is easy but I can’t get them to actually display during playback…

Take this example code:


fn thefn = 
(
	t = teapot()
	t.pos.x = currenttime	
)

unregistertimecallback thefn
registertimecallback thefn

When that callback is added and the play button is pressed, the teapots don’t appear until the stop button is pressed. I’ve tried RedrawViews, ForceCompleteRedraw, etc…but I can’t find a way to update the viewports with the new objects during playback…any ideas?

7 Replies

Hmm…this also only seems to be a problem in 2017…

Try disabling the transform cache, have a quick google and you should find it.

I’ve already got that disabled – no luck

The problem goes away if I switch to OpenGL, or max 2016…appears to be a Nitrous bug in 2017.

probably it’s not a bug. it’s a ‘feature’ as ususally
nitrous caches scene for quicker playback. we need to reset this ‘cache’ somehow.

Figured out a workaround to this max 2017 nitrous bug. In case anybody has the same problem…just execute the MXS command “max tool zoomregion” (either in MXS itself, or SDK using ExecuteMAXScriptScript) in your animation-play or time change callback. You only need to call it once after animation has begun. The command doesn’t do anything other than switch max command mode to the zoom region tool. I guess some internal function clears the Nitrous cache when you call that.

Other tool commands (“max truck”, “max pan accel”, etc) have a similar effect, except when the viewport is a camera viewport, they’ll stop playback entirely…so stick with “max tool zoomregion” for the best result in all cases.

have you tried nodeInvalRect?

Yes, it has no effect on this bug. Neither does invalidateTM, redawviews, forceCompleteRedraw, etc.