Debugging OSL

Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderators: ChrisHekman, aoktar

Post Reply
User avatar
blastframe
Licensed Customer
Posts: 178
Joined: Wed May 21, 2014 6:01 am
Location: Los Angeles, CA USA

Hello,
I am trying to teach myself OSL using the spec, the OctaneRender OSL documentation, and this training series.

I have a simple OSL shader where I am trying to print to the OSL console.

Code: Select all

color AddColors(
    color a,
    color b)
{
    return a + b;
}

shader NewColor(output color d=0)
{
    color x = AddColors(color(0.5,0.2,0.4),color(0.2,0.1,0.2));
    printf ("x = %g", x);
    d = x;
}
That leads to this error:

Code: Select all

<node 'Osl Texture'>:5: error: Unsupported feature: printf()
printf is not listed in the Unsupported features. I would only want this to print once, though, and my .osl experiments in Blender with printf in the Shader function call it every draw of the Viewport.

How do I debug my shaders in Octane (e.g. printing their variables to the console once)?
Post Reply

Return to “Maxon Cinema 4D”