autodesk-forks / MaterialX

MaterialX C++ and Python libraries
http://www.materialx.org/
Apache License 2.0
107 stars 23 forks source link

MATX-305 : OSL structured file input #1336

Closed kwokcb closed 2 years ago

kwokcb commented 2 years ago

Update #1297

Results Sample MTLX file (found in /resources/Materials/TestSuite/stdlib/color_management). filename_cm_test.mtlx.txt Sample OSL generated using new structure shaderref1.osl.txt Sample OSL generate using new structure and passing colorspace shaderref1_arnold.osl.txt shaderref1_osl

hodoulp commented 2 years ago

Change OSL filename syntax to be a structure. Current members include filename and colorspace but more can be added (such as for udim information which is currently additional arguments)

[Newbie comment] That's an excellent idea so any later changes/improvements can be smoothly integrated. I made a comment about the name but I would also to highlight that colorspace string is used by the structure for the color space of the file to import but also by the document for the working color space. Is that ok to use the same string?

kwokcb commented 2 years ago

Change OSL filename syntax to be a structure. Current members include filename and colorspace but more can be added (such as for udim information which is currently additional arguments)

[Newbie comment] That's an excellent idea so any later changes/improvements can be smoothly integrated. I made a comment about the name but I would also to highlight that colorspace string is used by the structure for the color space of the file to import but also by the document for the working color space. Is that ok to use the same string?

Missed answering this:

  1. There is a "colorspace" string member of the OSL source code structure.
  2. The value of this data member is set using the "colorspace" attribute value associated with the filename for the image node inside a MaterialX document. ( It will be set to an empty string if no colorspace value is specified in the MaterialX document. )

Hope this makes things clear.