Grimm's take on the turntable anim script

Forums: Grimm's take on the turntable anim script
Forum for OctaneRender Lua scripting examples, discussion and support.

Re: Grimm's take on the turntable anim script

Postby grimm » Tue Feb 04, 2014 5:43 pm

grimm Tue Feb 04, 2014 5:43 pm
Thanks Thomas, I suspected that was the case. I was able to trim the code down to load the values by a lot using a for loop with the pairs function:

Code: Select all
local tempTable = tableLoad(defaultsName)
for item, value in pairs(tempTable["__octane.shadow"]) do
    defaultsTable[item] = value
end


which works really well and makes it easy to update.

I have also updated the code to version 0.10, so anyone who had problems before, please try this version and see if it works better now. :) I'm playing around with adding advanced camera movement options in the new advanced tab. Currently I just have an option to tilt the camera path plane, try it out and see how you like it. Soon I will add more options to the tab. Thanks,

Jason
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby r-username » Tue Feb 04, 2014 6:32 pm

r-username Tue Feb 04, 2014 6:32 pm
grimm wrote:I'm playing around with adding advanced camera movement options in the new advanced tab.


Thank you very much.
I have to say I would be dead in the water without this script.

What if the advanced tab had 3 input boxes for x y and z camera rotation, that can have positive or negative values

x [ 0.00 ]
y [ 0.00 ]
z [ 1.00 ]
default rotate once around the z axis using the specified time or frames paramater.

dolly zoom [ 0.00 ]

---
Thanks again
i7 960 - W7x64 - 12 GB - 2x GTX 780ti
http://www.startsimple.com/ - http://www.gigavr.com/
r-username
Licensed Customer
Licensed Customer
 
Posts: 217
Joined: Thu Nov 24, 2011 3:39 pm

Re: Grimm's take on the turntable anim script

Postby grimm » Tue Feb 04, 2014 7:56 pm

grimm Tue Feb 04, 2014 7:56 pm
Thanks, no problem. :D Unfortunately it's not that simple. :? Lets see if I can explain it without making myself look silly. Because we don't know how the user will position the target mesh or the camera we can't just move the camera on a particular axis. Currently the script looks at the scene and determines where the camera is and where it is looking (this is done with some vector math). This becomes the initial frame of reference, so all movement from this point is relative to it. To do a pan with the camera it needs to move tangentially from this initial frame, either left and right or up and down. So to do this I need to figure out some more math and how to set up the movement so it works within this framework. There are some other issues with how the camera's target needs to work, or how peoples expectations might be different than what the script actually does. I need to consider it a bit more before doing the code.

You can already do a pan towards the target and away from the target now. Just set the Degrees slider to 0 (zero) and set the spiral in/out slider to the rate you want. You can also adjust the angle you are panning from by changing the Start Angle.

Jason
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby r-username » Thu Feb 06, 2014 12:59 pm

r-username Thu Feb 06, 2014 12:59 pm
grimm wrote:Currently the script looks at the scene and determines where the camera is and where it is looking (this is done with some vector math).


Thanks for the details.

I have used the latest script several times and it's working great.
i7 960 - W7x64 - 12 GB - 2x GTX 780ti
http://www.startsimple.com/ - http://www.gigavr.com/
r-username
Licensed Customer
Licensed Customer
 
Posts: 217
Joined: Thu Nov 24, 2011 3:39 pm

Re: Grimm's take on the turntable anim script

Postby bepeg4d » Fri Feb 07, 2014 4:21 pm

bepeg4d Fri Feb 07, 2014 4:21 pm
hi grimm,
big thanks for the update, finally it works as expected alsp with nested rt :)
Capture-st129-02.JPG

little note: on mac all is perfect, on win if you select the rt4 the script start but the rt1 is selected, absolutly not a big issue ;)
the advanced tab is super cool, great, but the tilt seems to give only little movement, maybe there is a scale issue :roll:
last thing, the shortcut alt+t still work only on mac, but i have tried the MB's script and it works on both mac and win with ctrl+3.
maybe you need only to switch from alt to ctrl for multiplatform shortcats :roll:
ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 7310
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Grimm's take on the turntable anim script

Postby grimm » Fri Feb 07, 2014 11:51 pm

grimm Fri Feb 07, 2014 11:51 pm
bepeg4d wrote:hi grimm,
big thanks for the update, finally it works as expected alsp with nested rt :)


Excellent! :D

bepeg4d wrote:little note: on mac all is perfect, on win if you select the rt4 the script start but the rt1 is selected, absolutly not a big issue ;)


Yes, your milage may vary on this. I don't have any control of the order in which the render targets will be found. You will probably see the same problem with the mac as well. Also you might want to make sure you name your groups and the render targets nodes differently. It may be that some of the problems you are having is because they have the same name?

bepeg4d wrote:the advanced tab is super cool, great, but the tilt seems to give only little movement, maybe there is a scale issue :roll:


Now that I think about it, I should probably limit the tilt slider some more. Setting it to more than 90 or less than -90 will not make it go more. For instance if you set it to 170 it's the same as setting it to -10. I will limit it to -90 to 90 degrees on the next version.

bepeg4d wrote:last thing, the shortcut alt+t still work only on mac, but i have tried the MB's script and it works on both mac and win with ctrl+3.
maybe you need only to switch from alt to ctrl for multiplatform shortcats :roll:
ciao beppe


It appears in Windows that Alt+{a-z} shortcuts are used to move quickly to menu/pulldown items. Either that or you have set a custom shortcut on your Windows system, is anyone else having the problem? I can move it to CTRL+t and see if that works better.

Thanks Beppe

Jason
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby pixelrush » Sun Feb 09, 2014 8:58 am

pixelrush Sun Feb 09, 2014 8:58 am
small slider mistake - should be 14400
Attachments
error.jpg
i7-3820 @4.3Ghz | 24gb | Win7pro-64
GTS 250 display + 2 x GTX 780 cuda| driver 331.65
Octane v1.55
User avatar
pixelrush
Licensed Customer
Licensed Customer
 
Posts: 1618
Joined: Mon Jan 11, 2010 7:11 pm
Location: Nelson, New Zealand

Re: Grimm's take on the turntable anim script

Postby grimm » Sat Mar 22, 2014 12:44 am

grimm Sat Mar 22, 2014 12:44 am
New version on the first post... :)
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby grimm » Sat Jun 14, 2014 7:33 am

grimm Sat Jun 14, 2014 7:33 am
I updated the script so it will work with Octane 1.55 and 2.0, enjoy. :D

Jason
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby gmillas » Mon Jun 23, 2014 7:58 am

gmillas Mon Jun 23, 2014 7:58 am
At first thanks for the script

Please add a collectgarbage() in the loop
at turntableG_anim.lua
Code: Select all
-- start rendering out each frame
    local currentTime = 0
    for frame=1,nbFrames do

   collectgarbage()

        -- set the time in the scene
        sceneGraph:updateTime(currentTime)
.
.
.


because it consumes the memory with unfreed garbage octane.exe process rached 2gb instead of 80mb ! ( LUA is a garbage colletion language ) ;)
gmillas
Licensed Customer
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
PreviousNext

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Thu Jul 02, 2020 8:55 am [ UTC ]