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 input is sometimes not evaluated until graph was opened #1457

Closed marwie closed 1 year ago

marwie commented 1 year ago

I am not sure exactly when it happens but pretty often the nodegraph input doesnt update the material after loading a new mtlx material. I then have to open the nodegraph and exit it briefly and only after that the input property affects the output. See the video below

https://github.com/AcademySoftwareFoundation/MaterialX/assets/5083203/6d3a6e9d-f13f-473e-9b0f-36187bf12c02

the console window shows this in case its relevant image

attached is one graph as an example but I assume it also happens with other graphs?

<?xml version="1.0"?>
<materialx name="" version="1.38" >
    <nodegraph name="needle_shadergraph" >
        <!-- Color -->
        <input name="_Color" type="color4" value="1.0, 1.0, 1.0, 0.6745098" />
        <dot name="const__Color" type="color4" >
            <input name="in" type="color4" interfacename="_Color" />
        </dot>
        <convert name="convert_to_color3" type="color3" >
            <input name="in" type="color4" nodename="const__Color" />
        </convert>
        <output name="out" type="color3" nodename="convert_to_color3" />
        <!-- Smoothness -->
        <input name="_Smoothness" type="float" value="0.0" />
        <dot name="const__Smoothness" type="float" >
            <input name="in" type="float" interfacename="_Smoothness" />
        </dot>
        <convert name="convert_to_vector2" type="vector2" >
            <input name="in" type="float" nodename="const__Smoothness" />
        </convert>
        <constant name="Vector_2" type="vector2" >
            <input name="value" type="vector2" nodename="convert_to_vector2" />
        </constant>
        <swizzle name="swizzle_0_Vector_2" type="float" >
            <input name="in" type="vector2" nodename="Vector_2" />
        </swizzle>
        <output name="out_1" type="float" nodename="invert" />
        <invert name="invert" type="float" >
            <input name="in" type="float" nodename="swizzle_0_Vector_2" />
        </invert>
        <texcoord name="uv_0" type="vector2" >
            <input name="index" type="integer" value="0" />
        </texcoord>
        <input name="density" type="float" value="5.0" />
        <worleynoise2d name="worley" type="float" >
            <input name="texcoord" type="vector2" nodename="uv_0" />
            <dot name="" type="float" value="2.0" >
                <input name="in" />
            </dot>
        </worleynoise2d>
        <convert name="convert_to_color3_1" type="color3" >
            <input name="in" type="float" nodename="worley" />
        </convert>
        <output name="out_2" type="color3" nodename="convert_to_color3_1" />
    </nodegraph>
    <standard_surface name="needle_standard_surface" type="surfaceshader" >
        <!-- BaseColor -->
        <input name="base_color" type="color3" nodegraph="needle_shadergraph" output="out" />
        <!-- Metallic -->
        <input name="metalness" type="float" value="1.0" />
        <!-- Smoothness -->
        <input name="specular_roughness" type="float" nodegraph="needle_shadergraph" output="out_1" />
        <!-- Emission -->
        <input name="emission_color" type="color3" nodegraph="needle_shadergraph" output="out_2" />
    </standard_surface>
    <surfacematerial name="Default" type="material" >
        <input name="surfaceshader" type="surfaceshader" nodename="needle_standard_surface" />
    </surfacematerial>
</materialx>
kwokcb commented 1 year ago

@marwie , @jstone-lucasfilm This is fixed with the downstream propagation fix. https://github.com/AcademySoftwareFoundation/MaterialX/assets/49369885/345b1eef-702b-4b13-b42c-84e766618a42

jstone-lucasfilm commented 1 year ago

Thanks for the update, @kwokcb!