Page 1 of 1

Setting color space pin value

PostPosted: Wed May 31, 2023 12:34 pm
by MB
How do I set the color space pin on an image node to linear sRGB + legacy gamma

Spent hours on this, getting nowhere, thanks for your help.
FYI, this runs, but appears to do nothing, I would prefer to set the pin value without actually creating a colorspace node and connecting it.

-- OCIO Color Space Node
print("Creating Color Space Node")
nodeColorSpace = octane.node.create{ type = octane.NT_OCIO_COLOR_SPACE, name = "OCIO Color Space", position = { 900, 200 } }
--nodeColorSpace:setPinValue(octane.P_COLOR_SPACE, 2, true)
nodeColorSpace:setAttribute(octane.A_OCIO_COLOR_SPACE_NAME , "Linear sRGB", true)

Re: Setting color space pin value

PostPosted: Thu Jun 01, 2023 6:56 am
by bepeg4d
Hi,
I have not tried, but, by default, the OCIO pin is set to None (sRGB) in the NT_IMAGER_CAMERA node, while the Linear color space is chosen in the Response curve popup:
IMG_8689.jpeg


So, try to only change the P_RESPONSE pin to Linear/off, in the NT_IMAGER_CAMERA node, without creating the NT_OCIO_COLOR_SPACE node.

ciao,
Bppe

Re: Setting color space pin value

PostPosted: Thu Jun 01, 2023 8:58 am
by jobigoud
MB wrote:I would prefer to set the pin value without actually creating a colorspace node and connecting it.


Something like this:

Code: Select all
local nodeImage = octane.project.getSelection()[1]

local nodeColorSpace = nodeImage:getConnectedNode(octane.pinId.P_COLOR_SPACE, false)
nodeColorSpace:setAttribute(octane.attributeId.A_COLOR_SPACE, octane.namedColorSpace.LINEAR_SRGB)

(first line just grabs the selection so select the image node to test this).

If the P_COLOR_SPACE might be nil you will need to create the node in advance. You can't use `setPinValue` on the image node because this is not a value type, it's more complex than a simple enum. (A hint is that it doesn't have a single A_VALUE attribute).

Re: Setting color space pin value

PostPosted: Thu Jun 08, 2023 6:23 pm
by MB
Thank you all, that worked well.