Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Settings: Move imageio from project anatomy to project settings #3909

Closed
wants to merge 5 commits into from

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Sep 23, 2022

Brief description

This implements #3865 by moving imageio settings per host from project anatomy to project settings.

Before:

project_anatomy/imageio/{app}

After:

project_settings/{app}/imageio

Description

Currently untested - no backwards compatible or fallbacks implemented. Basically your old project anatomy customized settings will be lost. 🔥 - So as #3865 we'll need to look into how we'll want to transfer those settings over automagically 🪄 .

Additional info

Note that each imageio group has now set is_group to True as such changing one setting in the imageio for a host will now override that full imageio block of settings for the project. It's up for discussion whether we want that - if we want to change around we'll need to add some labels to some of the settings (required for is_group to be False) but that should be fine.

It could be that some documentation might also need to be updated along.

Copying ImageIO settings from Anatomy to Project Settings

Any potential backwards compatible "updating" would only need to basically 'copy the settings values' from project_anatomy/imageio/{app} on top of project_settings/{app}/imageio to transfer the exact settings. So in essence it is:

for app in anatomy["imageio"]:
    value = app.value
    project_settings[app.key]["imageio"].set(value)
    project_settings.save()

I'm not awaiting the moment this PR gets 'assigned' to me and I get all the blame in the future. 🗡️

Testing notes:

  1. 🔥 🚒 Get your fire extinguishers ready
  2. Test color management related features across the hosts
  • Flame
  • (and Flare?)
  • Maya
  • Nuke
  • Hiero
  • (Did Resolve have any? I couldn't find it. If it didn't, let's check this box and continue our ignorance.)

Comment on lines 26 to 28
"imageio": {
"type": "object"
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can we just remove this? Are old projects ever checked against this schema and invalidated if it finds an entry that isn't in this config?

It's not a required key so that helps, but still.

Comment on lines -319 to -334
def _project_anatomy_backwards_compatible_conversion(project_anatomy):
# Backwards compatibility of node settings in Nuke 3.9.x - 3.10.0
# - source PR - https://github.com/pypeclub/OpenPype/pull/3143
value = project_anatomy
for key in ("imageio", "nuke", "nodes", "requiredNodes"):
if key not in value:
return
value = value[key]

for item in value:
for node in item.get("knobs") or []:
if "type" in node:
break
node["type"] = "__legacy__"


Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Had no use with this move of the settings as far as I know - so burned it down to the floor.

Copy link
Member

Choose a reason for hiding this comment

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

@iLLiCiTiT
Copy link
Member

I would keep schemas for openpype/settings/defaults/project_anatomy/imageio.json so you can copy->paste values on update without loosing them on update.

@BigRoy
Copy link
Collaborator Author

BigRoy commented Sep 24, 2022

I would keep schemas for openpype/settings/defaults/project_anatomy/imageio.json so you can copy->paste values on update without loosing them on update.

Since we are matching the settings 1-to-1 wouldn't it be much nicer if it'd automatically transfer the settings from Project Anatomy somehow? I feel from a User perspective that'd be much nicer than still having to "fix" each project manually (even though sure, you could copy/paste the values - but similarly we could offer a "click here and it's fixed button" by copying the data project anatomy in database to the settings?

I'm mostly worried about having both setting visible and the user misunderstanding that those in Project Anatomy essentially do nothing. We could put in a big deprecation label in the UI, but still. If the intend is for production to notice the least the settings should be copied over thus it sounds like we should just make that happen.

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Sep 24, 2022

I'm mostly worried about having both setting visible and the user misunderstanding that those in Project Anatomy essentially do nothing. We could put in a big deprecation label in the UI, but still. If the intend is for production to notice the least the settings should be copied over thus it sounds like we should just make that happen.

The problem is that you will loose all those data from anatomy on first save of project setting. So if you're "testing" new version in production you will actually break all projects on project settings save.

NOTE: We're first testing OpenPype as staging before full deploy to production.

@BigRoy
Copy link
Collaborator Author

BigRoy commented Sep 29, 2022

Question:

Should we maybe swap these around so the settings are

  • project_settings/imageio/{app}

instead of

  • project_settings/{app}/imageio?

The benefit I'd see from that is that we can just make one MASTER config setting that sets OCIO env var as a hook based on the config path set in project_settings/imageio/config_path. Potentially still allowing apps to have an explicit project_settings/imageio/app/override_config_path like setting?

Or is it very likely that the different applications should use different OCIO configs in a project.

What do we feel is the most sensible 'project setting'? @mkolar @maxpareschi


Of course this is very related to Colorspace Distribution and Management

@iLLiCiTiT
Copy link
Member

That is ultimate goal but we can't do it at this moment. Nuke imageio has totally different settings then Maya or Flame or Hiero. We need this PR to move the settings from anatomy to project setting so we can possibly change their behavior from version to version with versioned settings which is not possible if they're in anatomy.

@BigRoy
Copy link
Collaborator Author

BigRoy commented Sep 29, 2022

Great - then I suspect this PR should be ok to start that transition.

@BigRoy BigRoy marked this pull request as ready for review September 29, 2022 10:49
@@ -563,7 +563,7 @@ def get_node_path(path, padding=4):


def get_nuke_imageio_settings():
return get_anatomy_settings(Context.project_name)["imageio"]["nuke"]
return get_project_settings(Context.project_name)["nuke"]["imageio"]
Copy link
Member

Choose a reason for hiding this comment

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

I believe there should be some backward compatibility check. Some clients might have Anatomy ImageIO set from 3.9 and they didn't change __legacy__ type yet. We would need to go trough all projects and do this manually (impossible).
For those projects it doesnt even make sense to copy paste it from Anatomy to ./nuke/imageio.

I will do the changes in separate PR. Please could you return the ___legacy__ check (#3909 (comment))

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

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

good for merge.. tested Nuke, Hiero. Resolve is not done anyway. Flame should be fine, too.

@jakubjezek001
Copy link
Member

good for merge.. tested Nuke, Hiero. Resolve is not done anyway. Flame should be fine, too.

huh.. just realized that the __legacy__ (#3909 (comment)) needs to be returned before the merge..

Copy link
Member

@iLLiCiTiT iLLiCiTiT left a comment

Choose a reason for hiding this comment

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

We need explicit backwards compatibility in project settings. @jakubjezek001 can you do required changes in new branch (sourcing from this) and create new PR?

@jakubjezek001
Copy link
Member

This PR is closing in favor of #3959

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants