wondering what's possible with LUA

Forums: wondering what's possible with LUA
Forum for OctaneRender Lua scripting examples, discussion and support.

wondering what's possible with LUA

Postby chrisw69 » Thu May 31, 2018 12:30 am

chrisw69 Thu May 31, 2018 12:30 am
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! :)
Licensed Customer
Licensed Customer
Posts: 5
Joined: Sun Feb 18, 2018 10:31 pm

Re: wondering what's possible with LUA

Postby bepeg4d » Thu May 31, 2018 5:38 am

bepeg4d Thu May 31, 2018 5:38 am
Hi and welcome :)
Please, have a look at which scripts are already available on the forum:
At a first look, and if I remember well, it seems that what you want to do is missing.
ciao Beppe
User avatar
Octane Guru
Octane Guru
Posts: 6339
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: wondering what's possible with LUA

Postby Notiusweb » Sun Jul 15, 2018 3:17 pm

Notiusweb Sun Jul 15, 2018 3:17 pm
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:

Total Sphere Value = 1
Total Cube Value = 0

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

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:

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.


Thanks for any thoughts!
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan X, 1 Titan Xp
External: 6 Titan X Pascal - 1600W EVGA T2
Plugs: 3DSMax, C4D, Daz, Houdini, Lightwave, Sketchup
User avatar
Licensed Customer
Licensed Customer
Posts: 1031
Joined: Mon Nov 10, 2014 4:51 am

Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 2 guests

Tue Apr 23, 2019 10:57 am [ UTC ]