MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Shader Generation Regression: Real world units on filenames + target unit not working

Open kwokcb opened this issue 1 month ago • 0 comments

Issue

It seems that units set on filenames does not work (anymore) ? This is a sample from unit tests:

<?xml version="1.0"?>
<materialx version="1.38">
  <!--
  Image unit test with one image node for each variation in input type which can support distance units.
  -->
  <output name="image1_output" type="float" nodename="image1" />
  <image name="image1" type="float">
    <input name="file" type="filename" value="resources/Images/grid.png" unit="foot" unittype="distance" />
  </image>
  <output name="image2_output" type="vector2" nodename="image2" />
  <image name="image2" type="vector2">
    <input name="file" type="filename" value="resources/Images/grid.png" unit="meter" unittype="distance" />
  </image>
  <output name="image3_output" type="vector3" nodename="image3" />
  <image name="image3" type="vector3">
    <input name="file" type="filename" value="resources/Images/grid.png" unit="mile" unittype="distance" />
  </image>
  <output name="image4_output" type="vector4" nodename="image4" />
  <image name="image4" type="vector4">
    <input name="file" type="filename" value="resources/Images/grid.png" unit="centimeter" unittype="distance" />
  </image>
</materialx>

I assume this worked before but I don't think they are part of render tests anymore so unknown when this may have broken. Units on floats and vectors seem to work.

Unknown what has come of target unit setting but it also appears broken at least from testing with MaterialXlXView -- as it does nothing when setting the target unit and reloading the file. Tried this programmatically from Python API and also does not seem to work.

kwokcb avatar May 31 '24 18:05 kwokcb