Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when loading / viewing an existing nodegraph into graph editor - related to swizzle node upgrade process #1940

Closed
jhubertubisoft opened this issue Jul 16, 2024 · 8 comments

Comments

@jhubertubisoft
Copy link

I try to load an existing nodegraph into graph editor.
Crashes when double clicking to open the node graph.
If I work around a crash in node display then I end up on a throw "cyclic dependency detection"
If I remove the swizzle nodes from the graph, everything is fine.
I suppose swizzle nodes upgrade process ends up in creating cycles ?

@jstone-lucasfilm
Copy link
Member

This sounds like a good catch, @jhubertubisoft!

Do you have an example MaterialX document that demonstrates this behavior? We've tested our upgrade process with a wide variety of documents containing swizzle nodes, but it sounds like there's an edge case that was not covered in our tests, and an example would be very helpful.

@kwokcb
Copy link
Contributor

kwokcb commented Jul 16, 2024

A simpler way to test where the issue may reside is to run the mxvalidate.py script (in the Python Scripts folder) on the document which performs the upgrade and checks for validity. You can post your sample file here to look at as well.

If this does not pass then the upgrade logic sounds like the issue. Otherwise it could be an editor issue.

@jhubertubisoft
Copy link
Author

unpack_normal.zip

Here is one on the files I have trouble with.

@ld-kerley
Copy link
Contributor

This certainly looks like a bug somewhere in the swizzle upgrade code to me - comparing before/after snippets for the 1.38 -> 1.39 upgrade for this document look like this...

1.38

    <swizzle name="swizzle_float_vector4" type="vector4" xpos="4.492754" ypos="1.250000">
      <input name="in" type="float" nodename="constant_float" />
    </swizzle>

1.39

    <combine4 name="swizzle_float_vector4" type="vector4" xpos="4.492754" ypos="1.250000">
      <input name="in1" type="float" nodename="swizzle_float_vector4" output="outx" />
      <input name="in2" type="float" nodename="swizzle_float_vector4" output="outx" />
      <input name="in3" type="float" nodename="swizzle_float_vector4" output="outx" />
      <input name="in4" type="float" nodename="swizzle_float_vector4" output="outx" />
    </combine4

It looks like the generated combine4 node is connecting its inputs to itself - which certainly doesn't look quite right. I didn't get chance to look at the code itself yet.

@jstone-lucasfilm
Copy link
Member

Good catch, @ld-kerley, and that looks like a straight-up bug in our version upgrade logic. This would definitely be worthwhile to address for 1.39.1, and I can also take a look if you don't get to it first.

@jstone-lucasfilm
Copy link
Member

I've written up a fix for this and am validating it now. Thanks for posting this issue, @jhubertubisoft, and it is indeed a case we'd never encountered in our repository before.

The novel case was a swizzle node with no channels string set, causing it to act like a convert node, propagating a scalar value to all channels of the destination type.

@jstone-lucasfilm
Copy link
Member

The fix for this issue has been posted as #1945.

@jhubertubisoft
Copy link
Author

Excellent. Thanks everybody for the quick answer / fix. Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants