Notifications
Clear all

[Closed] registerTimeCallback and animation playback

Can’t play animation while camSwitcher function is registered. Any ideas?
max 2014


delete objects
cam1 = Freecamera()
cam2 = Freecamera()
cam1.pos = [100,100,100]
cam2.pos = [-20,-100,150]
cam1.dir = normalize cam1.pos
cam2.dir = normalize cam2.pos
Teapot()

unRegisterTimeCallback camSwitcher

fn camSwitcher = (
    
    if currenttime > 50 then (
        
        viewport.SetCamera cam2
        
    ) else (
        
        viewport.SetCamera cam1
        
    )

)

registerTimeCallback camSwitcher
3 Replies

playback stops when you’re changing cams. I’m the dev op ProSequencer and it did require some tricks to make switching while playing work. (PS is opensouce, just unzip the mzp and find the ‘timeChange’ function. it’s some magic combination of stop/redraw/setcam/start animimation.) And in your function you are setting the cam @ every timechange, you might want to check it the viewport already had the right cam before switching. (that’s the reason why you can’t play animation, it’s at every timechange due to cam switch)

But by the looks of it you could just use ProSequencer to do it all

http://www.jdbgraphics.nl/prosequencer

(here is a newer version: https://www.dropbox.com/s/eb2fafad03n0byl/ProSequencer_2017-06-29_1.991b.mzp?dl=1 )

thanks, I’ll check it out.
I’ve never used proSequencer myself, so the only question i have is whether proSequencer allow multiple ranges on single track for a particular cam? Like in AE

In a way, you can assign the same camera to multiple tracks. That way you can have multiple ranges of the same cam.