Setting color space pin value

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
MB
Licensed Customer
Posts: 168
Joined: Tue Jan 15, 2013 3:41 am
Location: Washington, D.C.
Contact:

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)
Windows 11, 2x Intel I9, 64GB Ram, 2x GTX 1080 TI, 1 x RTX 380 TI, Oculus Quest 2
User avatar
bepeg4d
Octane Guru
Posts: 10292
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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
User avatar
jobigoud
OctaneRender Team
Posts: 243
Joined: Sat Aug 15, 2015 1:28 pm

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).
User avatar
MB
Licensed Customer
Posts: 168
Joined: Tue Jan 15, 2013 3:41 am
Location: Washington, D.C.
Contact:

Thank you all, that worked well.
Windows 11, 2x Intel I9, 64GB Ram, 2x GTX 1080 TI, 1 x RTX 380 TI, Oculus Quest 2
Post Reply

Return to “Lua Scripting”