Skip to content
New issue

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

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

Already on GitHub? # to your account

Changing purpose doesn't mark the render tags on a prim dirty #1243

Closed
williamkrick opened this issue Jun 12, 2020 · 5 comments
Closed

Changing purpose doesn't mark the render tags on a prim dirty #1243

williamkrick opened this issue Jun 12, 2020 · 5 comments

Comments

@williamkrick
Copy link
Contributor

Description of Issue

I'm working on getting the Vp2RenderDelegate to respect render tags (also known as purpose) correctly in MayaUSD.

We've got things working reasonably well when we include the changes in Autodesk/maya-usd#558. But while I was working on this I discovered that changing purpose marks a prim's visibility dirty rather than its render tags.

I found the code in https://github.com/PixarAnimationStudios/USD/blob/master/pxr/usdImaging/usdImaging/gprimAdapter.cpp#L437, where when the purpose property changes the visibility is dirtied rather than DirtyRenderTag. Maybe both should be dirtied, or just render tags?

I think this may also be a part of the reason for HdChangeTracker::MarkRenderTagsDirty() exists. HdChangeTracker::MarkRprimDirty() is not called with DirtyRenderTag, so the code there never bumps the render tag version, so the extra call to MarkRenderTagsDirty() is needed. I didn't dive into it but maybe MarkRenderTagsDirty() can be removed if UsdImagingGprimAdapter::ProcessPropertyChange returned DirtyRenderTag.

I'm able to work around the issue by checking & clearing the visibility flag instead of render tags so this issue isn't blocking for me, but I think it is worth understanding anyway.

usd-interest link:
https://groups.google.com/forum/#!topic/usd-interest/9pzFbtCEY-Y

Steps to Reproduce

  1. Be in MayaUSD which includes MAYA-104542 Handle rprim purpose changing to a hidden purpose correctly Autodesk/maya-usd#558 and MAYA-105284 Track changes to render tags more carefully to avoid setting the tags Autodesk/maya-usd#587. They should be included in the MayaUSD shipped with Maya PR116.
  2. Have a breakpoint in https://github.com/PixarAnimationStudios/USD/blob/master/pxr/usdImaging/usdImaging/gprimAdapter.cpp#L437
  3. Select an rprim and modify it's purpose.
  4. You should see ProcessPropertyChange called & set the visibility dirty not the render tags.

System Information (OS, Hardware)

Package Versions

USD v20.05

Build Flags

@spitzak
Copy link

spitzak commented Jun 12, 2020

See also #801

If the display purposes (renderTags in hd) are changed, this fact is not sent to the RenderDelegate until RenderPass:::_Prepare is called. This is after Sync() is callled, so even if the dirty flags are correct it will not have the current set of display purposes to compare against. However it only calls Sync() of prims that match the intended display purposes, so if you don't bother testing this in Sync() and make RenderPass hide any prims that have removed display purposes, the update is correct.

@jtran56
Copy link

jtran56 commented Jun 12, 2020

Filed as internal issue #USD-6123.

@sunyab
Copy link
Contributor

sunyab commented Jul 7, 2020

This should be fixed by 0a20c8e which is in the upcoming 20.08 release.

@williamkrick
Copy link
Contributor Author

Awesome, I will test it in the next few days.

@sunyab
Copy link
Contributor

sunyab commented Jul 21, 2020

Closing, this should be fixed in the 20.08 release. Thanks!

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

No branches or pull requests

4 participants