Grimm's take on the turntable anim script

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

Ok fixed that bug, new version posted on the first post. :D
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
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Ok, new version posted in the first post. Added live preview, thanks Tugpsx! :D Added a reset button to reset the settings to their original values. Fixed some more bugs. Enjoy! :)
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
pixelrush
Licensed Customer
Posts: 1618
Joined: Mon Jan 11, 2010 7:11 pm
Location: Nelson, New Zealand

Thanks for your labours @grimm.
some UI comments -
I think some of the slider values could be changed.
For instance I doubt if people will make more than a 60 sec turntable, and therefore also frames could be 7200 max. Still a lot of rendering!
Preview samples could be 400 max I think, it is a preview after all.
Possibly include a slider to render only every n th frame rather than render them all. 1-30?
Possibly too the render resolution could optionally be 1/2 size?
Probably people just want a quick check that things are generally ok before a full render.
Keep up the good works. ;)
Soon you finish and I don't need to learn to code :P
i7-3820 @4.3Ghz | 24gb | Win7pro-64
GTS 250 display + 2 x GTX 780 cuda| driver 331.65
Octane v1.55
User avatar
bepeg4d
Octane Guru
Posts: 10352
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi grimm,
thanks for the update, is turning out very well :)
there is an issue if the thin lens camera node is grouped:
Capture-st123-02.JPG
Capture-st123-02b.JPG
the spiral option is very nice, and setting the angles to 0, it's easy to move the camera forward and backward :)
it would be wounderful if we could change the axis independently for both the primal rotation and spiral movement, for a basic but efficient camera motion system ;)
p.s.i'm not able to save or load any configuration on both, mac and pc :roll:
ciao beppe
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

pixelrush wrote:Thanks for your labours @grimm.
some UI comments -
I think some of the slider values could be changed.
For instance I doubt if people will make more than a 60 sec turntable, and therefore also frames could be 7200 max. Still a lot of rendering!
Preview samples could be 400 max I think, it is a preview after all.
Possibly include a slider to render only every n th frame rather than render them all. 1-30?
Possibly too the render resolution could optionally be 1/2 size?
Probably people just want a quick check that things are generally ok before a full render.
Keep up the good works. ;)
Soon you finish and I don't need to learn to code :P
What, coding is fun. ;) Thanks this kind of feedback is very useful. :D

I can make the changes to the duration, frames, and the preview samples, those would be nice defaults.

You can render every other frame with-in the same duration by halving the frame rate or 1 out of every 3 by dividing the frame rate by 3 so I'm not sure that a special slider would help much in this case? Also since Octane doesn't write out an actual animation formated file you can play around with the timing ect. in the package that you use to combine the frames to the final animation file.

I will have to check on changing the render resolution and get back to you on that (I'm sure it can be done). :)

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

bepeg4d wrote:hi grimm,
thanks for the update, is turning out very well :)
there is an issue if the thin lens camera node is grouped:

the spiral option is very nice, and setting the angles to 0, it's easy to move the camera forward and backward :)
it would be wounderful if we could change the axis independently for both the primal rotation and spiral movement, for a basic but efficient camera motion system ;)
p.s.i'm not able to save or load any configuration on both, mac and pc :roll:
ciao beppe
Thanks Beppe,

The thin lens problem is a bit out of my league right now so hopefully Thomas or Roeland will chime in.

I would like to be able to rotate the path, etc., but I'm going to have to get back up to speed on the math to do it. :)

That is strange that the save and load doesn't work on the Mac, I was worried about the PC, but the Mac's OS is very close to Linux in how it works? This should be solved when the 1.24 version of Octane is released. Then I can point the script to it's own subdirectory and the defaults file can be written there which should make all platforms happy.

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

grimm wrote:
bepeg4d wrote:hi grimm,
thanks for the update, is turning out very well :)
there is an issue if the thin lens camera node is grouped:

the spiral option is very nice, and setting the angles to 0, it's easy to move the camera forward and backward :)
it would be wounderful if we could change the axis independently for both the primal rotation and spiral movement, for a basic but efficient camera motion system ;)
p.s.i'm not able to save or load any configuration on both, mac and pc :roll:
ciao beppe
Thanks Beppe,

The thin lens problem is a bit out of my league right now so hopefully Thomas or Roeland will chime in.

I would like to be able to rotate the path, etc., but I'm going to have to get back up to speed on the math to do it. :)

That is strange that the save and load doesn't work on the Mac, I was worried about the PC, but the Mac's OS is very close to Linux in how it works? This should be solved when the 1.24 version of Octane is released. Then I can point the script to it's own subdirectory and the defaults file can be written there which should make all platforms happy.

Jason
Hi there,

The render target node is not connected to the camera directly but to the output linker node of the graph (of type octane.NT_OUT_CAMERA). Remember, linker nodes aren't anything special or scary. The only thing they do is provide for the connections between nodes outside the graph and nodes inside the graph.

What you need to do is: if the render target is connected to a linker, you should skip it. By skipping I mean trying the node that's connected to this linker node. You keep doing this until you hit nil (no connected node) or a non-linker node. In turntableG_anim.lua you would add this function:

Code: Select all

-- Returns the connected node, skipping all the linker nodes in between.
-- So it returns the "Real" input node.
local function getInputNode(node, pinId)
    local connected = node:getConnectedNode(pinId)
    -- no node connected to pin
    if connected == nil then return connected end
    -- a regular node connected to the pin
    if not connected:getProperties().isLinker then return connected end
    -- a linker node, return the node connected to the input pin of the linker
    return getInputNode(connected, octane.P_INPUT) 
end
In getSceneCopy() you would use this function:

Code: Select all

-- check if a thin lens camera is connected to the render target
local copyCam = copyRt:getInputNode(octane.P_CAMERA)
if not copyCam or copyCam :getProperties().type ~= octane.NT_CAM_THINLENS then
    showError("TurntableG Error!","no thinlens camera connected to the render target", true)
end
We'll add a function getInputNode() to the API in 1.24. I'll create a seperate post afterwards to explain the difference between getInputNode and getConnectedNode because I guess a lot of people are going to hit this problem (i.e. where there scripts suddenly fail when graphs are involved).

I hope this helps for now.

cheers,
Thomas
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Thanks Thomas! :D I will update the script.

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

Hi Thomas,

Still have some problems with the code fix: :oops:

Did you mean:

Code: Select all

local copyCam = getInputNode(copyRt, octane.P_CAMERA)
instead of:

Code: Select all

local copyCam = copyRt:getInputNode(octane.P_CAMERA)
Even with changing that line of code I'm still getting an error:

"attempt to call method 'getConnectedNode' (a nil value)"

on this line:

Code: Select all

local connected = node:getConnectedNode(pinId)
Now my test scene is real simple, all I have is a mesh node with two render targets connected to it. To test this I grouped both of the target nodes, would this work?

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
pixelrush
Licensed Customer
Posts: 1618
Joined: Mon Jan 11, 2010 7:11 pm
Location: Nelson, New Zealand

Diverting this thread momentarily,
Thomas,
I was wondering about reading in camera xyz points to a table, either obtained from excel as interpolated points on a best fit curve or obtained from a CAD program or say Maple/Mathematica. Excel might allow a quick way to come up with a smooth path between known points without getting overly serious about providing this inside Octane. I know this is getting more complex for animation than you wanted though. Aside from the possibility of a simple custom list of sequential camera shots for oneself I was thinking of a user shared library of std paths. Elliptical orbit , or shallow parabolic flyby come to mind. I know that instance data can be inserted into Octane so I guess those or camera positions ought to be loadable from Lua as well?
i7-3820 @4.3Ghz | 24gb | Win7pro-64
GTS 250 display + 2 x GTX 780 cuda| driver 331.65
Octane v1.55
Post Reply

Return to “Lua Scripting”