Page 1 of 1

wondering what's possible with LUA

PostPosted: Thu May 31, 2018 12:30 am
by chrisw69
Hi All,

I'm fairly new to Octane, we are rolling it out across the team at work. I was hoping to get some functionality added via some LUA scripting, but before I embark on it I thought I would post here, just in case the things I'm going to try do do are already done by someone, or just are not possible with Octanes LUA implementation.

Camera switcher - I want to make a node (I assume a LUA Scripted node?) that has a variable amount of Camera inputs, with an integer slider that switches between them, and a single camera output to pass through the selected camera as an output.

Instance node - This one I want to make a node that lets you pick a target node, then the scripted node takes on all the properties & outputs of the target node (and updates as the target node changes, allowing you to instance nodes between node graphs or just without having a drawn connection (to tidy up instancing in complex scenes - like the wireless node in Fusion or the instancing of nodes in Nuke)

I'm also adding some scripts to do things like add placement & group nodes after the selected node, I've got as far as creating the new node and wiring the output of the selected node to the input of the placement node, but it would be ideal to then connect the output of the newley created node to the input the selected node was connected to. Effectively so it adds the node 'inline'

Thanks in advance for any help or suggestions! :)

Re: wondering what's possible with LUA

PostPosted: Thu May 31, 2018 5:38 am
by bepeg4d
Hi and welcome :)
Please, have a look at which scripts are already available on the forum:
viewtopic.php?f=73&t=57252
At a first look, and if I remember well, it seems that what you want to do is missing.
ciao Beppe

Re: wondering what's possible with LUA

PostPosted: Sun Jul 15, 2018 3:17 pm
by Notiusweb
Could LUA over a timeline blend values between 2 separate nodes of a same node type, in their entirety?
Like if I had some 'node bridge' with two inputs , and LUA could be told to have a channel ID per input, say channel 1 and channel 2, and then it could be told that the start node's values are that of node channel 1, and the finish node would be that of node channel 2. So, kine of like the SG Animate, but not for a single float value, more like a snapshot of the node's entire value set at a start point, and an end point.

So, say I have a sphere mesh, and a cube mesh, and I assign them to a 'node-bridge' on the NGE, kind of like a Geometry Group. Only here it would be so that only 1 version of the 2 nodes appears , dependent on a timeline.
And Lua would calculate the start values of the sphere, and the finish values of the cube, and divide them so that it generates a morph from the one shape to another at a different point in the timeline.

Something like:

@START
Total Sphere Value = 1
Total Cube Value = 0
Time=0

@FINISH
Total Sphere Value = 0
Total Cube Value = 1
Time = 10 (say if 10 seconds), you would enter this into some input

@MIDPOINT
Total Sphere Value = 0.5
Total Cube Value = 0.5
Time = Finish-Time /2

Then LUA could do the math and assign a Total Sphere Value and a Total Cube Value per-second on the timeline


IE - LUA would then calculate:

@2 SECONDS
Total Sphere Value = 0.8
Total Cube Value = 0.2
Time = 2


I guess with a mesh, you could link an opacity movement to 'fake' a morph, and it could ghost between 2 shapes connected by a Geometry Group....
But I don't want that.

I'm wondering if it is possible to actually *reshape* the mesh by adjusting correlating values that both meshes share, in Octane, between the 2 START and FINISH "Total Mesh" value points. IE, a true blend between shared values.
And if the meshes are too different, still, it would be cool to morph between the 2 Total Values. Because you could have meshes that are nearly identical. Or even, with meshes that are identical - materials, movements, positions, etc, being the only things that are changed, but all at once, not separately programmed in as a 'SG Animate'-type change.

:shock:

Thanks for any thoughts!