OSL compile error with boolean widget

Sub forum for bug reports
Forum rules
Before posting a bug report, please check the following:
1. That the issue has not already been disclosed
2. That the issue is specific to this plugin, and not Octane in general (Try reproducing it in Standalone)
Bugs related to the Octane Engine itself should be posted into the Standalone Support sub-forum.


All bug reports should include the information below, along with a detailed description of the issue and steps to reproduce it.
A. Operating System, including version (i.e. Win 7, OSX 10.11.2, Ubuntu 14.04, etc.)
B. Graphics Card(s) model (i.e. GTX 580 - 3GB, TITAN, etc.)
C. RAM Capacity (i.e. 6 GB)
D. Nvidia driver version (i.e. 7.50, 7.5.22)
E. OctaneRender Standalone version, if installed (i.e. 2.24.2, 2.23, etc.)
F. OctaneRender plugin version (i.e. v2.25 - 2.21)
G. Host application version, including build number if available (i.e. 3ds Max 2016 Build 18.0)
Post Reply
User avatar
ChrisH
Licensed Customer
Posts: 103
Joined: Sun Mar 06, 2011 12:13 am
Location: Lidköping, Sweden
Contact:

Hi, I found a problem with OSL compilation.
I've tested this in both "Octane Blender" (27.16 / 3.5.1) and with the add-on (27.16.3 / 3.6.1)
(I've also tested the OSL script in the Octane Node Graph, and Cycles, where it works fine)

The problem is that you can't have an int as an boolean widget, you can't have it enabled by default.
Relevant line ("full" example bellow and attached):

Code: Select all

      int use_a = 1 [[string label = "Use A", string widget = "boolean"]], // This DOESN'T work!
//    int use_a = 0 [[string label = "Use A", string widget = "boolean"]], // This works

And it gives this error:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\chris\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\octane\nodes\base_osl.py", line 439, in invoke
    node.compile_osl_node(self.report)
  File "C:\Users\chris\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\octane\nodes\base_osl.py", line 392, in compile_osl_node
    reply_data = str(ET.fromstring(response).get("content"))
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\xml\etree\ElementTree.py", line 1342, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 3, column 127
Error: Python: Traceback (most recent call last):
  File "C:\Users\chris\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\octane\nodes\base_osl.py", line 439, in invoke
    node.compile_osl_node(self.report)
  File "C:\Users\chris\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\octane\nodes\base_osl.py", line 392, in compile_osl_node
    reply_data = str(ET.fromstring(response).get("content"))
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\xml\etree\ElementTree.py", line 1342, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 3, column 127
Example:

Code: Select all

shader Switch(
//    int use_a = 0 [[string label = "Use A", string widget = "boolean"]], // This works
    int use_a = 1 [[string label = "Use A", string widget = "boolean"]], // This DOESN'T work!
    color col_a = 0 [[string label = "A"]],
    color col_b = 1 [[string label = "B"]],
    output color out = 0 [[string label = "Output"]]
)
{
    if (use_a)
        out = col_a;
    else
        out = col_b;
}
Attachments
Test.osl
(423 Bytes) Downloaded 40 times
Windows 10 Pro - AMD Ryzen 7 2100X 8 core 3.70GHz - 32GB RAM - GeForce GTX 1080 8GB
Octane Prime - Blender Plugin user

Metal IOR values for Octane (with .blend library): https://chris.hindefjord.se/resources/rgb-ior-metals/
Post Reply

Return to “Bug Reports”