CurveAdjust implementation missing
Hello! I'm writing a MaterialX Maya File Translator
And I just ran into a critical snag on the exporting of remap nodes as CurveAdjust.
The resulting example when loaded into MaterialXView yields an error.
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<surfacematerial name="Plastic" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="SR_plastic" />
</surfacematerial>
<standard_surface name="SR_plastic" type="surfaceshader">
<input name="base" type="float" value="1" />
<input name="base_color" type="color3" nodegraph="NG_remapColor1" output="out" />
<input name="specular_roughness" type="float" value="0.32467532157897949" />
</standard_surface>
<nodegraph name="NG_remapColor1">
<curveadjust name="remap1" type="color3">
<input name="in" type="color3" nodename="remapColor1" />
<parameter name="knots" type="vector2array" value="[0.0, 0.5], [1.0, 1.0]" />
</curveadjust>
<ramplr name="remapColor1" type="color3">
<input name="valuel" type="color3" value="0.0, 0.0, 0.0" />
<input name="valuer" type="color3" value="0.5, 0.0, 0.0" />
<input name="texcoord" type="vector2" defaultgeomprop="UV0" />
</ramplr>
<output name="out" type="color3" nodename="remap1" />
</nodegraph>
</materialx>

And when reading though the code it seems MaterialX does not actually have an implementation available and is commented out. Is this something actively being looked into with Autodesk or are you accepting PR's for curve lookups?
Best regards, -Sean
Hi Sean, Thanks for bringing this up and it is true there is no curveadjust support currently, and from the Autodesk side it is not actively being looked at.
It would be great if you have something to put up. If you don't have all the language backends we could do one first and add the rest after we have one reference implementation.
Sounds good Bernard, Created a PR Reference implementation of curveadjust I think I'm unable to link this Issue to the PR for some reason.
It sounds like the best path forward will be to integrate the recent work from SideFX on MaterialX ramp nodes, which was discussed at the MaterialX TSC on November 9th:
https://academysoftwarefdn.slack.com/archives/C0230LWBE2X/p1636486452084200
I'll leave this original issue open for now, and we can revisit this as the work from SideFX is refined and integrated into MaterialX v1.39.
That’s great news! I got stuck on the GLSL limitation of fixed-size array declaration. I have working shader code but it’s all pre-declared and does not accept dynamic inputs. Looking forward to the SideFX PR.
This subject was discussed in more depth at today's MaterialX TSC meeting, and I'll include a link for those following the topic:
https://academysoftwarefdn.slack.com/archives/C0230LWBE2X/p1655837092353349