Problem with the turntable animation script

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

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
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

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
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Hi Thomas,

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

Jason
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

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 334 times
daylight-animation.lua
(17.9 KiB) Downloaded 328 times
thanks,
Thomas
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Cool, thanks Thomas. :)
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Post Reply

Return to “Lua Scripting”