Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Color mismatch when generating UserData from .ass

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Shawn_Kearney1
282 Views, 3 Replies

Color mismatch when generating UserData from .ass

I have a script that reads ass files and writes the user data nodes into an XML file such that UI can be easily and quickly generated. It seems to be working well, but the value from AiNodeGetRGB() does not seem to reflect the values in the shader network. When read back, the Color User Data generated reflects the values in the XML, not those in the shader. It seems that there is a gamma applied, maybe?

I've extracted the rgb values using:

default = AiNodeGetRGB( node, "default" )

default_r = str(default.r)
default_g = str(default.g)
default_b = str(default.b)

default = "{" + default_r + "," + default_g + "," + default_b + "}"

Tags (1)
Labels (1)
3 REPLIES 3
Message 2 of 4

I think it is a gamma correction judging by the values I remember. I'll give that a try tomorrow.... Is this a C4D thing??

Message 3 of 4

The color widget in C4D is in sRGB color space by default, while Arnold needs them in linear color space. A simple gamma correction is a good approximation, or you can use the ColorProfileConverter class from the C4D SDK.

Message 4 of 4

Cool thanks. That works just fine. I couldn't immediately figure out how to use ColorProfileConvert (still trying to wrap my head around the C4D API), but I was able to convert to sRGB using some code I found.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report