AcademySoftwareFoundation / MaterialX

MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.
http://www.materialx.org/
Apache License 2.0
1.83k stars 336 forks source link

Graph Editor: nodegraph inputs are not evaluated anymore #1473

Closed marwie closed 1 year ago

marwie commented 1 year ago

The following material has a nodegraph with an vector4 input. When changing the values of the input it seems to be not evaluating the nodegraph anymore See video below. This is the viewer built from 2d12c1687887f793609133cadf192bf4b29e9502

https://github.com/AcademySoftwareFoundation/MaterialX/assets/5083203/24d57928-6b78-4f5c-b409-6276167d7dc8

<?xml version="1.0"?>
<materialx version="1.38" >
    <nodegraph name="needle_shadergraph" >
        <!-- Vector3 -->
        <input name="_Vector3" type="vector4" value="0.0, 0.0, 0.0, 0.0" />
        <dot name="dot__Vector3" type="vector4" >
            <input name="in" type="vector4" interfacename="_Vector3" />
        </dot>
        <separate3 name="Split" type="multioutput" >
            <input name="in" type="vector3" nodename="vector4_to_vector3" />
        </separate3>
        <invert name="invert" type="float" >
            <input name="in" type="float" output="outy" nodename="Split" />
        </invert>
        <convert name="float_to_color3" type="color3" >
            <input name="in" type="float" output="outx" nodename="Split" />
        </convert>
        <convert name="vector4_to_vector3" type="vector3" >
            <input name="in" type="vector4" nodename="dot__Vector3" />
        </convert>
        <output name="base_color" type="color3" nodename="float_to_color3" />
        <output name="specular_roughness" type="float" nodename="invert" />
    </nodegraph>
    <standard_surface name="needle_standard_surface" type="surfaceshader" >
        <input name="base_color" type="color3" nodegraph="needle_shadergraph" output="base_color" />
        <input name="specular_roughness" type="float" nodegraph="needle_shadergraph" output="specular_roughness" />
    </standard_surface>
    <surfacematerial name="Default" type="material" >
        <input name="surfaceshader" type="surfaceshader" nodename="needle_standard_surface" />
    </surfacematerial>
</materialx>
marwie commented 1 year ago

I just tried this with another very simple material which yields the same result

<?xml version="1.0"?>
<materialx name="" version="1.38" >
    <nodegraph name="needle_shadergraph" >
        <!-- MyColor -->
        <input name="_MyColor" type="color4" value="0.8113207, 0.5396048, 0.5396048, 1.0" />
        <constant name="const__MyColor" type="color4" >
            <input name="value" type="color4" interfacename="_MyColor" />
        </constant>
        <convert name="convert_to_color3" type="color3" >
            <input name="in" type="color4" nodename="const__MyColor" />
        </convert>
        <output name="out" type="color3" nodename="convert_to_color3" />
        <convert name="convert_to_color3_1" type="color3" >
            <input name="in" type="float" value="5.0" />
        </convert>
        <multiply name="mult" type="color3" >
            <input name="in1" type="color3" nodename="convert_to_color3" />
            <input name="in2" type="color3" nodename="convert_to_color3_1" />
        </multiply>
        <output name="out_1" type="color3" nodename="mult" />
    </nodegraph>
    <standard_surface name="needle_standard_surface" type="surfaceshader" >
        <!-- Base Color(3) -->
        <input name="base_color" type="color3" nodegraph="needle_shadergraph" output="out" />
        <!-- Emission(3) -->
        <input name="emission_color" type="color3" nodegraph="needle_shadergraph" output="out_1" />
        <!-- Metallic(1) -->
        <input name="metalness" type="float" value="1.0" />
    </standard_surface>
    <surfacematerial name="Default" type="material" >
        <input name="surfaceshader" type="surfaceshader" nodename="needle_standard_surface" />
    </surfacematerial>
</materialx>

https://github.com/AcademySoftwareFoundation/MaterialX/assets/5083203/dcf60852-deaf-4bb5-9485-4abbbcb23109

kwokcb commented 1 year ago

Hi @marwie , Thanks for catching this right away. There was some code which was supposed to be removed but got missed. Apologies. A patch PR is up now.

marwie commented 1 year ago

Great to hear!