Page 1 of 1

Changing Image Texture's parm via python

Posted: Thu Jan 26, 2023 8:58 am
by lionlee19
I am writing some scripts changing the parameters of texture image
and I want to set the Color Space of it.

For example:
tnode.parm('colorSpace').set('Non-color Data')
tnode.parm('colorSpace').set('ACEScg')


but I get error on log when I load it into Octane.

Re: Changing Image Texture's parm via python

Posted: Thu Jan 26, 2023 10:32 am
by galleon27
lionlee19 wrote:I am writing some scripts changing the parameters of texture image
and I want to set the Color Space of it.

For example:
tnode.parm('colorSpace').set('Non-color Data')
tnode.parm('colorSpace').set('ACEScg')


but I get error on log when I load it into Octane.

Code: Select all

tnode.parm('colorSpace').set('NAMED_COLOR_SPACE_OTHER')
tnode.parm('colorSpace').set('NAMED_COLOR_SPACE_ACESCG')

Re: Changing Image Texture's parm via python

Posted: Thu Jan 26, 2023 5:08 pm
by lionlee19
galleon27 wrote:
lionlee19 wrote:I am writing some scripts changing the parameters of texture image
and I want to set the Color Space of it.

For example:
tnode.parm('colorSpace').set('Non-color Data')
tnode.parm('colorSpace').set('ACEScg')


but I get error on log when I load it into Octane.

Code: Select all

tnode.parm('colorSpace').set('NAMED_COLOR_SPACE_OTHER')
tnode.parm('colorSpace').set('NAMED_COLOR_SPACE_ACESCG')
Thank you Very much !
It works!
Where can I find these correct parameter names for each colorspace?

Re: Changing Image Texture's parm via python

Posted: Thu Jan 26, 2023 8:28 pm
by galleon27
Don't know if you can list them all. I just set it to whatever color space i need and do node.parm('colorSpace').eval() in the python shell and you'll get the name. That goes for whatever parameter you need.

Re: Changing Image Texture's parm via python

Posted: Fri Jan 27, 2023 2:15 pm
by lionlee19
galleon27 wrote:Don't know if you can list them all. I just set it to whatever color space i need and do node.parm('colorSpace').eval() in the python shell and you'll get the name. That goes for whatever parameter you need.
Thank you so much!