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

Fix parent/child handling in getGeometryBindings #1113

Merged

Conversation

kwokcb
Copy link
Contributor

@kwokcb kwokcb commented Oct 21, 2022

Fix #1109

Change

The matching logic (string) was "reversed" for membership so that parent assignments would override child assignments. That is the logic should be to check if the path of the assignment is completely contained within the path to the geometry being tested.

e.g.

  • The assignment string "/a/b" is contained in path to the geometry: "/a/b/c" so the material can be assigned to "/a/b/c"
  • The assignment string "/a/b" is contained in path to the geometry: "/a/b" so the material can be assigned to "/a/b"
  • The assignment string "/a/b/c" is not contained in path to the geometry: "/a/b" so the child's material cannot be assigned to the parent geometry.

Desktop

parent_child_assignment2

Web

parent_child_assignment

source/MaterialXCore/Look.cpp Show resolved Hide resolved
javascript/MaterialXView/source/viewer.js Show resolved Hide resolved
javascript/MaterialXView/source/viewer.js Outdated Show resolved Hide resolved
javascript/MaterialXView/source/viewer.js Outdated Show resolved Hide resolved
javascript/MaterialXView/source/viewer.js Outdated Show resolved Hide resolved
source/MaterialXCore/Look.cpp Show resolved Hide resolved
@jstone-lucasfilm jstone-lucasfilm changed the title Fix parent / child material assignment logic fix Fix parent/child handling in getGeometryBindings Oct 22, 2022
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @kwokcb!

@jstone-lucasfilm jstone-lucasfilm merged commit 0ee79b2 into AcademySoftwareFoundation:main Oct 22, 2022
@kwokcb kwokcb deleted the parent_child_assign branch October 23, 2022 17:22
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
…dation#1113)

The matching logic was reversed for membership, so that parent assignments would override child assignments. That is the logic should be to check if the path of the assignment is completely contained within the path to the geometry being tested.
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

Successfully merging this pull request may close these issues.

Material assignments to child objects
2 participants