Page 1 of 1

Node Selector Node Input number

Posted: Mon May 11, 2020 9:25 am
by blobbybarack
Can we set more than 8 pins with the selector node ?

Re: Node Selector Node Input number

Posted: Mon May 11, 2020 8:16 pm
by bassruettler
blobbybarack wrote:Can we set more than 8 pins with the selector node ?
If you want to switch textures/colors, then you could write an osl texture like this:

Code: Select all

shader Texture(
    color in0 = 0,
    color in1 = 0,
    color in2 = 0,
    color in3 = 0,
    color in4 = 0,
    color in5 = 0,
    color in6 = 0,
    color in7 = 0,
    color in8 = 0,
    color in9 = 0,
    output color c = 0)
{
    int i = 0;
    if (i == 0) { c = in0; }
    if (i == 1) { c = in1; }
    if (i == 2) { c = in2; }
    if (i == 3) { c = in3; }
    if (i == 4) { c = in4; }
    if (i == 5) { c = in5; }
    if (i == 6) { c = in6; }
    if (i == 7) { c = in7; }
    if (i == 8) { c = in8; }
    if (i == 9) { c = in9; }
}

Re: Node Selector Node Input number

Posted: Tue May 12, 2020 9:17 am
by juanjgon
Be aware that the node selector is not a standard Octane shading node. It is a tool created on the plugin side to physically rewire the shader node tree while building complex HDAs, like the render target.

In a shading workflow, probably the material mixer node, or an OSL solution like the one posted above could be better.

Thanks,
-Juanjo

Re: Node Selector Node Input number

Posted: Tue May 12, 2020 8:11 pm
by blobbybarack
Thank you juanjgon.
I still don't have the Osl reflex for now.
This is a very elegant way to takle this problem.