Skip to content

MaterialXView and MaterialXWebViewer: Nodes with spaces and parentheses are incorrectly matched with materialassign #2448

Open
@hybridherbst

Description

@hybridherbst
Contributor

Both MaterialXView and MaterialXWebViewer struggle with binding looks to node names containing spaces and/or parentheses. They apply different renamings, and do the geomexpr matching differently, so the results are somewhat random. Note that not only both renderings below are wrong, they are also wrong in different ways due to these different approaches.

Test file: bugreport-materialX-bindings.zip

Tool Result
MaterialXView Image
MaterialXWebViewer Image
MaterialXView with node names that don't use (). This is the expected result. Image

Some preliminary analysis on what's going wrong:

Naming issues in MaterialXView

  • CgltfLoader.cpp renames "Sphere (1)" to "Sphere__1_", but materiassign does not rename anything, so names don't match.
  • For some reason, isMatching() in Geom.h returns true when testing "Sphere (1)" and "Sphere (2)".
  • The GeomExts spec mentions that partitions should be separated with / (so they are leaf nodes), but MaterialXView does not add a ?/, it just adds an index to the node name (e.g. Sphere, Sphere2, Sphere3 for three partitions – note the first one omits the /1 as well).

Naming issues in MaterialXWebViewer

Workaround

The workaround is to not use spaces or parentheses anywhere, but I don't think that's a good workaround at all, as it would potentially require users to change their files; not all industries have strict naming conventions for files/nodes/materials.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hybridherbst

        Issue actions

          MaterialXView and MaterialXWebViewer: Nodes with spaces and parentheses are incorrectly matched with `materialassign` · Issue #2448 · AcademySoftwareFoundation/MaterialX