Hi.
I’m new to OSL.
I’m trying to make something that converts RGB to HSV and get something else out of it.
However I’m stuck right here:
shader my_osl_node(color some_color_input = 0......, output float out_float= 1.0)
{
....
out_float = transformc("hsv", some_color_input)[0];
....
}
What I want here is to get Hue from RGB color.
- To get specific H, S, or V (R, G, or B) channel from color, in OSL: color[int].
- transformc returns color
- So I’m expecting transformc(“hsv”, some_color_input)[0] to return Hue of some_color_input.
However this part of code makes syntax error. There is error message in blender console, but it does not specify what is wrong.
ERROR: C:\\Users\\_____\\AppData\\Local\\Temp\\tmp206n04zh.osl:4: error: Syntax error: syntax error
Error: OSL script compilation failed, see console for errors