Hi,
This is a script node for Octane Standalone implementing a generic "Switch" functionality.
This node lets you create a selector between multiple variants. You can have several cameras or several geometries or several materials, etc. and change the one that is actually used in the scene by setting the "Selected option" variable. This avoids constantly disconnecting and reconnecting nodes when you need to go back and forth between various options.
Usage: set the type and number of options and plug your variants in the option list. If you need more than 32 options you can also daisy chain them indefinitely.
Installation: if you save the file in your script directory it will appear in the Nodegraph editor context menu under Other > Switch. Alternatively you can add it to any scene the normal way: Nodegraph menu Other > Scripted graph, then in the Node inspector "Load script from file", and point it to where you saved the lua script.
Let us know if you have any feedback or suggestions!
Thanks
Generic switch node
Very useful, many thanks! Now I can switch LUTs without losing sight of rendered image
A couple of UI/UX suggestions:
1. Is it possible to limit "Selected option" maximum value to selected "Number of options", not the maxCount=32 constant?
2. Can the "Selected option" control be implemented as dropdown selector (like for enums), for selecting value using up/down arrow keys?

A couple of UI/UX suggestions:
1. Is it possible to limit "Selected option" maximum value to selected "Number of options", not the maxCount=32 constant?
2. Can the "Selected option" control be implemented as dropdown selector (like for enums), for selecting value using up/down arrow keys?
AMD R7-2700/64Gb/RTX2080Ti 11Gb + RTX2080 8Gb/Win10 Pro x64/nV driver 451.67/Poser10, DS4.12, Blender2.79, Octane 4.05 Standalone
> Using RAM Disk with Octane <
> Using RAM Disk with Octane <
Sweet! 

Octane 2022.1.1 nv535.98
x201t - gtx580 - egpu ec
Dell G5 - 16GB - dgpu GTX1060 - TB3 egpu @ 1060 / RTX 4090
Octane Render experiments - ♩ ♪ ♫ ♬
x201t - gtx580 - egpu ec
Dell G5 - 16GB - dgpu GTX1060 - TB3 egpu @ 1060 / RTX 4090
Octane Render experiments - ♩ ♪ ♫ ♬
Good ideas! I made a change and updated the script in the OP.andw wrote:Very useful, many thanks! Now I can switch LUTs without losing sight of rendered image![]()
A couple of UI/UX suggestions:
1. Is it possible to limit "Selected option" maximum value to selected "Number of options", not the maxCount=32 constant?
2. Can the "Selected option" control be implemented as dropdown selector (like for enums), for selecting value using up/down arrow keys?
There is a weird behavior where the number of entries in the drop down may not update correctly at first. You have to click on a Render target at least once and after that it works normally.
Nice!jobigoud wrote: Good ideas! I made a change and updated the script in the OP.

All works as expected. The only thing we lost is selecting option with mouse wheel. But it isn't useful (IMHO).
There is also one more issue: when scene file, containing these switch nodes is opened, their UI (in Node inspector) doesn't initialized properly, need to click "Reload script file" button: May be some issues because of 4.05 version.
AMD R7-2700/64Gb/RTX2080Ti 11Gb + RTX2080 8Gb/Win10 Pro x64/nV driver 451.67/Poser10, DS4.12, Blender2.79, Octane 4.05 Standalone
> Using RAM Disk with Octane <
> Using RAM Disk with Octane <
You need to use C4D X-Presso for doing the same in c4doctane plugin.Delizade wrote:Hello,
How can I use this script in C4D Octane node editor?
ciao,
Beppe