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

Setting an element's colorspace attribute to empty string has unexpected behavior #1833

Open
mdjurev opened this issue May 23, 2024 · 0 comments

Comments

@mdjurev
Copy link

mdjurev commented May 23, 2024

This concerns MaterialXCore/Element.h:

Currently, when querying getActiveColorSpace, the code goes through the element's parents and calls hasColorSpace() on them.
An empty string set anywhere in the hierarchy is interpreted as having a color space and prevents further traversal.

This leads to the situation where getting the color space of an element with no color space and setting it back to the same element changes behavior.

There is also no removeColorSpace() method, so the only way to undo this is to call removeAttribute(COLOR_SPACE_ATTRIBUTE); directly.

Attaching a diff with a unit test that illustrates the issue.

mx_element_test.patch

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

1 participant