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

Use product name for render templates #841

Merged
merged 21 commits into from
Aug 21, 2024

Conversation

antirotor
Copy link
Member

@antirotor antirotor commented Aug 8, 2024

Changelog Description

This is fixing the issue where product names for render products were hardcoded. Old behavior is enabled by default, but deprecation warning is issued. New behavior (where product name templates are used) is controlled by option in the settings:

ayon+settings://core/tools/creator/product_name_profiles/use_legacy_for_renders

Note

This is continuation and refactor of #447 - look there for previous discussions.

Additional info

Old behavior was bypassing any template set in ayon+settings://core/tools/creator/product_name_profiles. With this change, one can set template like this:

{product[type]}<{Renderlayer}><_{Aov}>

resulting in:

renderMainlayer_normal

It is up to TD to set correctly such template to make sure, product name will be stable enough. As a side-effect, optional keys can be used now in product name templates adding flexibility (and perhaps some danger of misuse).

Warning

To make use of this feature, renderlayer need to be set on the instance along with aov and is then collected to anatomy data. This is not in the scope of this PR (apart of the collection) and it must be implemented if following PRs to individual host addons.

It can be used in template formatting so you can use template for renders like:

{root[work]}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/{@version}/<{renderlayer}/>

Note

Already collected anatomy data (when available) could be passed to get_product_name() to allow even more keys to be used, but is there any real use case for it?

Also, as a point for discussion - there is variant that is now ignored in this case. It could be reasonable to use it exactly for this and move templating to "variant templates" but maybe it is breaking settings to even smaller unmanagable bits.

Testing notes:

  1. Set product name template to use renderlayer or aov keys (can be optional using<{key}> syntax)
  2. Publish renders from DCC supporting setting of these keys (like Maya and Houdini)
  3. Use {renderlayer} or {aov} in anatomy templates

Testing notes:

Main points:

a) It should behave as before without any changes.
b) When option is set in the settings, new behavior should kick-in and renders should start to use product name templates.

Testing steps:

  • To test a) simply publish any render to farm. Product names of the result should stay the same as before.
  • To test b), you'll need yet non-existent PRs in host addons. Stay tuned! :) - correction: with Maya it should already work.

this is fixing issue where product name templates were hardcoded. Old behavior is enabled by default but deprecation warning is issued
@antirotor antirotor added the type: enhancement Improvement of existing functionality or minor addition label Aug 8, 2024
@antirotor antirotor self-assigned this Aug 8, 2024
@ynbot ynbot added type: feature Adding something new and exciting to the product size/S labels Aug 8, 2024
@antirotor antirotor added the sponsored This is directly sponsored by a client or community member label Aug 8, 2024
@antirotor
Copy link
Member Author

This needs to solve group_name still

@antirotor
Copy link
Member Author

So I've tested it in Houdini and it works. There is one specific question about the product group names - strings that are used to group related publishes together in the UI.

So far the product group names were hardcoded - basically original hardcoded product name. This didn't include AOV names as they are added when render job is published so it correctly grouped together all renderpass AOVs. But with this PR, you can define product names with templates and so the group name itself cannot be that static. In this PR, I've made decision to explicitly "drop' aov name from the template data. So if you have product name template like so:

{product[type]}{Task[name]}<{Renderlayer}><_{Aov}>

and you have render layer called Main with beauty, diffuse and z AOVs, your resulting product names wil basically follow the previous behaviour (when you work on the task Lighting):

renderLightingMain_beauty
renderLightingMain_diffuse
renderLightingMain_z

and all of them will be grouped under renderLightingMain (because aov is not in template data and in template it is set as optional token).

But at the end, we should probably have something more robust, like templates for the group name itself. This is topic for another potential PR.

@antirotor antirotor marked this pull request as ready for review August 9, 2024 12:34
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

I have tested both the legacy workflow and the templated workflow within maya and arnold renderer.

All seems working fine...my rendered files and folders follows the template and also using tokens renderlayer and aov and also for product name.

Here is my output with using those tokens within folderpath:

Screenshot 2024-08-12 173515

server/settings/tools.py Outdated Show resolved Hide resolved
antirotor and others added 9 commits August 19, 2024 15:01
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
@antirotor
Copy link
Member Author

@LiborBatek could you please test it quickly for one last time? Thanks

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

All good. Tested in both legacy mode and with publishing profiles.

Here is my output folder with published renders following my publish template and also from the legacy mode.
image

Product names also follow these, so all good!

@antirotor antirotor merged commit eaf05a0 into develop Aug 21, 2024
1 check passed
@antirotor antirotor deleted the feature/AY-5185_render-product-templates branch August 21, 2024 10:32
Comment on lines +73 to +76
description="Use product naming templates for renders. "
"This is for backwards compatibility enabled by default."
"When enabled, it will ignore any templates for renders "
"that are set in the product name profiles.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This description seems a bit awkward. First it states "use product naming templates for renders." but if this is enabled, it does not do that, but it does the opposite...

So the description is actually "Ignore product naming templates for renders but use a hardcoded template. This is for backwards compatibility..." etc. ?

check your product name templates to ensure that resolved names are
sufficiently unique. You can find that settings:

ayon+settings://core/tools/creator/product_name_profiles
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be epic if somehow we can make this a hyperlink in the UI that actually links to the AYON web frontend at those settings? @dee-ynput ?

Comment on lines +14 to +16
Remove the offending instances or rename to have a unique name. Also, please
check your product name templates to ensure that resolved names are
sufficiently unique. You can find that settings:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Admittedly as a user I wouldn't know 'what to do' at those settings to ensure the resolved uniqueness. Nothing critical - but if anyone gets this invalidation message I have a feeling we might start getting questions about this. Let's see what comes up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition type: feature Adding something new and exciting to the product
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants