Page 1 of 1

Problem with the turntable animation script

PostPosted: Mon Dec 08, 2014 2:56 am
by grimm
This is about the official one, not the one I did. :D It looks like the script is calculating the time incorrectly. I was testing it with my animated texture script and the texture rendered out 4 times too slow. I think that the number of frames per second is getting swapped with the number of frames in the animation. Which in my case I set to 100, which looks like the turntable script was taking it as 100 frames per second. I had set all the settings to 24 frames per second in the Alembic file, my animated texture script, and the turntable script. These two lines (483 and 486) look suspicious to me (I was wondering why number of frames was defaulting to 25). ;)

Code: Select all
        -- update the time for the next frame
        currentTime = frame * (1 / nbFrames)

        -- update the progress bar
        progressBar.progress = frame / nbFrames


Jason

Re: Problem with the turntable animation script

PostPosted: Thu Dec 11, 2014 10:22 pm
by stratified
Hey Jason,

I played around with the turntable animation here but I don't see anything wrong. Can you post a .orbx file which I can use to reproduce this. Are you using the exact frame rate everywhere (script, texture animation & abc file)?

cheers,
Thomas

Re: Problem with the turntable animation script

PostPosted: Mon Dec 15, 2014 1:19 am
by grimm
Hi Thomas,

Did my PM make sense? Do you need anything more? Thanks, :)

Jason

Re: Problem with the turntable animation script

PostPosted: Mon Dec 15, 2014 9:51 pm
by stratified
Hi Jason,

Yep, what you said makes total sense.

The turntable and daylight animation work correctly but the problem is they configure their animators over a normalized time interval (time in [0,1]). This means they calculate their own frame rate ignoring the one configured in the project. And that's the reason why they don't play nice with your script. Your script makes the (reasonable) assumption that the frame rate is respected but then all of the sudden something is updating the time in way smaller increments than the agreed frame rate dictates.

Attached are updated versions of both daylight and turntable scripts. They will also ship in the next release.

turntable-animation.lua
(19.24 KiB) Downloaded 310 times

daylight-animation.lua
(17.9 KiB) Downloaded 307 times


thanks,
Thomas

Re: Problem with the turntable animation script

PostPosted: Mon Dec 15, 2014 11:53 pm
by grimm
Cool, thanks Thomas. :)