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

Return cryptomatte metadata in GetRenderStats #1178

Merged
merged 2 commits into from
Jun 15, 2022

Conversation

sebastienblor
Copy link
Collaborator

Changes proposed in this pull request
When rendering cryptomatte with husk, we need the new cryptomatte attribute custom_output_driver to be enabled, so that cryptomatte metadatas are authored in the HdArnoldDriver. Then, we need to return this metadata to Hydra through the virtual function GetRenderStats() where we return a dictionary of values that will be authored in the exr metadata.

In order, to do this, in this PR we register all the drivers associated to a cryptomatte AOV (crypto_asset, crypto_masterial, crypto_object) and then in GetRenderStats we check the attribute custom_attributes and return the cryptomatte metadata in the dictionary.

I could have registered the drivers by their AtNode pointer instead of their name, to avoid doing a node lookup, but I'd rather avoid crashes if/when some nodes got deleted during IPR sessions. So I'm storing the driver names.
Also, for now I'm looping over all of these drivers, even though in theory all the drivers for cryptomatte AOVs will have the same data, so we could just check the first one. But since GetRenderStats doesn't seem to be called very often, it looks like it's not a bottleneck.

Issues fixed in this pull request
Fixes #1164

@sebastienblor sebastienblor self-assigned this Jun 14, 2022
jhodgson
jhodgson previously approved these changes Jun 15, 2022
@sebastienblor sebastienblor merged commit e04a694 into Autodesk:master Jun 15, 2022
@sebastienblor sebastienblor deleted the pr/1164_b branch June 15, 2022 17:07
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.

Support cryptomatte in Hydra final frame rendering
2 participants