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 subdivision when primvars are set in parent primitives #1983

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

sebastienblor
Copy link
Collaborator

Changes proposed in this pull request
The test done by HasAuthoredAttribute that is used to properly set subdivision attributes, is not seeing the primvars authored in parent primitives. I replaced these calls with a new function HasConstantPrimvar that looks for this primvar name in the context list of primvars.
I considered different approaches, for example extending HasAuthoredAttribute to invoke itself recursively on parent primitives.
However, it would be a bit expensive to search for an attribute based on its name (i.e. with a map search) through the whole hierarchy and for each node.

Here, even though we're doing a linear search over the list of primvars, it should be more efficient as TfTokens are fast to compare.

I also saw a few occurrences of HasAuthoredValue on attribute smoothing to enable it by default. This shouldn't be needed anymore since smoothing is now enabled by default in arnold polymeshes

Issues fixed in this pull request
Fixes #1982

cpichard
cpichard previously approved these changes Jul 15, 2024
@sebastienblor sebastienblor merged commit c3cecca into Autodesk:master Jul 15, 2024
9 checks passed
@sebastienblor sebastienblor deleted the pr/1982 branch July 15, 2024 15:21
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.

Incorrect subdivision when primvars are set in parent primitives
2 participants