From b430d9f71db9699add0a07140af31c267a822ad9 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Mar 2023 21:05:56 +0100 Subject: [PATCH 001/207] cross hosts: enhancing imageio settings with Enable toggle also adding imageio settings to Max --- .../project_settings/aftereffects.json | 1 + .../defaults/project_settings/blender.json | 1 + .../defaults/project_settings/celaction.json | 1 + .../defaults/project_settings/flame.json | 1 + .../defaults/project_settings/fusion.json | 1 + .../defaults/project_settings/harmony.json | 1 + .../defaults/project_settings/hiero.json | 1 + .../defaults/project_settings/houdini.json | 1 + .../defaults/project_settings/max.json | 11 +++++++++ .../defaults/project_settings/maya.json | 1 + .../defaults/project_settings/nuke.json | 1 + .../defaults/project_settings/photoshop.json | 1 + .../defaults/project_settings/resolve.json | 1 + .../project_settings/traypublisher.json | 1 + .../defaults/project_settings/tvpaint.json | 1 + .../defaults/project_settings/unreal.json | 1 + .../project_settings/webpublisher.json | 1 + .../schema_project_aftereffects.json | 6 +++++ .../schema_project_blender.json | 6 +++++ .../schema_project_celaction.json | 6 +++++ .../projects_schema/schema_project_flame.json | 6 +++++ .../schema_project_fusion.json | 6 +++++ .../schema_project_harmony.json | 6 +++++ .../projects_schema/schema_project_hiero.json | 6 +++++ .../schema_project_houdini.json | 8 ++++++- .../projects_schema/schema_project_max.json | 23 +++++++++++++++++++ .../projects_schema/schema_project_maya.json | 6 +++++ .../schema_project_photoshop.json | 6 +++++ .../schema_project_resolve.json | 6 +++++ .../schema_project_traypublisher.json | 6 +++++ .../schema_project_tvpaint.json | 6 +++++ .../schema_project_unreal.json | 6 +++++ .../schema_project_webpublisher.json | 6 +++++ .../schemas/schema_nuke_imageio.json | 8 ++++++- 34 files changed, 148 insertions(+), 2 deletions(-) diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index 669e1db0b8..d1b2309d26 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/blender.json b/openpype/settings/defaults/project_settings/blender.json index 20eec0c09d..d9aabea9ad 100644 --- a/openpype/settings/defaults/project_settings/blender.json +++ b/openpype/settings/defaults/project_settings/blender.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/celaction.json b/openpype/settings/defaults/project_settings/celaction.json index 822604fd2f..10dfd70ac6 100644 --- a/openpype/settings/defaults/project_settings/celaction.json +++ b/openpype/settings/defaults/project_settings/celaction.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index 5a13d81384..f323af7496 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index f974eebaca..9130c9322c 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/harmony.json b/openpype/settings/defaults/project_settings/harmony.json index 3f51a9c28b..97c9cdf761 100644 --- a/openpype/settings/defaults/project_settings/harmony.json +++ b/openpype/settings/defaults/project_settings/harmony.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index 100c1f5b47..65d6da59f9 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 1b7faf8526..8d7f9865c5 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/max.json b/openpype/settings/defaults/project_settings/max.json index d59cdf8c4a..8df4d0ca57 100644 --- a/openpype/settings/defaults/project_settings/max.json +++ b/openpype/settings/defaults/project_settings/max.json @@ -1,4 +1,15 @@ { + "imageio": { + "enabled": false, + "ocio_config": { + "enabled": false, + "filepath": [] + }, + "file_rules": { + "enabled": false, + "rules": {} + } + }, "RenderSettings": { "default_render_image_folder": "renders/3dsmax", "aov_separator": "underscore", diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 2aa95fd1be..aa05ae145b 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -1,6 +1,7 @@ { "open_workfile_post_initialization": false, "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index c249955dc8..72f599c98b 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -9,6 +9,7 @@ } }, "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/photoshop.json b/openpype/settings/defaults/project_settings/photoshop.json index bcf21f55dd..9fd4fe54f1 100644 --- a/openpype/settings/defaults/project_settings/photoshop.json +++ b/openpype/settings/defaults/project_settings/photoshop.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/resolve.json b/openpype/settings/defaults/project_settings/resolve.json index 264f3bd902..3720dc54f4 100644 --- a/openpype/settings/defaults/project_settings/resolve.json +++ b/openpype/settings/defaults/project_settings/resolve.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index fdea4aeaba..311c5b0cfc 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/tvpaint.json b/openpype/settings/defaults/project_settings/tvpaint.json index 9173a8c3d5..5da63110be 100644 --- a/openpype/settings/defaults/project_settings/tvpaint.json +++ b/openpype/settings/defaults/project_settings/tvpaint.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/unreal.json b/openpype/settings/defaults/project_settings/unreal.json index 75cee11bd9..d83e090fae 100644 --- a/openpype/settings/defaults/project_settings/unreal.json +++ b/openpype/settings/defaults/project_settings/unreal.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/webpublisher.json b/openpype/settings/defaults/project_settings/webpublisher.json index e830ba6a40..a9dc9012eb 100644 --- a/openpype/settings/defaults/project_settings/webpublisher.json +++ b/openpype/settings/defaults/project_settings/webpublisher.json @@ -1,5 +1,6 @@ { "imageio": { + "enabled": false, "ocio_config": { "enabled": false, "filepath": [] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 8dc83f5506..2d48e06ccb 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index 725d9bfb08..2e4dcb4e31 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json index c5ca3eb9f5..efecb2a89c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index aab8f21d15..7c839037ad 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index 464cf2c06d..87856380ac 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "collapsible": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index e6bf835c9f..da80648a14 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index f44f92438c..3e9ac41b1c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -11,7 +11,13 @@ "label": "Color Management (ImageIO)", "is_group": true, "collapsible": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 24b06f77db..74ffbbe9f4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" @@ -35,4 +41,4 @@ "name": "schema_houdini_publish" } ] -} \ No newline at end of file +} diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index 4fba9aff0a..de7b4aca0b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -5,6 +5,29 @@ "label": "Max", "is_file": true, "children": [ + { + "key": "imageio", + "type": "dict", + "label": "Color Management (ImageIO)", + "is_group": true, + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "schema_imageio_config" + }, + { + "type": "schema", + "name": "schema_imageio_file_rules" + } + + ] + }, { "type": "dict", "collapsible": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index 47dfb37024..8373a57429 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -16,7 +16,13 @@ "label": "Color Management (ImageIO)", "collapsible": true, "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json index 0071e632af..95f402ca7c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json index b326f22394..da252dd9b1 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 2ef1d2a414..4bce299747 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json index 708b688ba5..3af5e7f5ca 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index 8988dd2ff0..b330fd600f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index 66ccca644d..d0c2145298 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -10,7 +10,13 @@ "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index 1cd6f0e67f..743b0d66a6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -4,7 +4,13 @@ "label": "Color Management (ImageIO)", "collapsible": true, "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "label", "label": "'Custom OCIO config path' has deprecated.
If you need to set custom config, just enable and add path into 'OCIO config'.
Anatomy keys are supported.." @@ -257,4 +263,4 @@ ] } ] -} \ No newline at end of file +} From 52f4b75b62b3776f7b1a3c4d65690b3e5b53cace Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Mar 2023 22:30:23 +0100 Subject: [PATCH 002/207] Flame: skip colorspace management if imageio is not enabled also set enabled to True by default since some productions are already using it --- openpype/hosts/flame/hooks/pre_flame_setup.py | 21 +++++++++++++++---- .../defaults/project_settings/flame.json | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/flame/hooks/pre_flame_setup.py b/openpype/hosts/flame/hooks/pre_flame_setup.py index 713daf1031..6367e132de 100644 --- a/openpype/hosts/flame/hooks/pre_flame_setup.py +++ b/openpype/hosts/flame/hooks/pre_flame_setup.py @@ -47,6 +47,13 @@ class FlamePrelaunch(PreLaunchHook): imageio_flame = project_settings["flame"]["imageio"] + colormanaged = True + # check if host settings are having enabled key and if it is False + if imageio_flame.get("enabled") and imageio_flame["enabled"] is False: + # if host settings are disabled return False because + # it is expected that no colorspace management is needed + colormanaged = False + # get user name and host name user_name = get_openpype_username() user_name = user_name.replace(".", "_") @@ -68,9 +75,7 @@ class FlamePrelaunch(PreLaunchHook): "FrameWidth": int(width), "FrameHeight": int(height), "AspectRatio": float((width / height) * _db_p_data["pixelAspect"]), - "FrameRate": self._get_flame_fps(fps), - "FrameDepth": str(imageio_flame["project"]["frameDepth"]), - "FieldDominance": str(imageio_flame["project"]["fieldDominance"]) + "FrameRate": self._get_flame_fps(fps) } data_to_script = { @@ -78,7 +83,6 @@ class FlamePrelaunch(PreLaunchHook): "host_name": _env.get("FLAME_WIRETAP_HOSTNAME") or hostname, "volume_name": volume_name, "group_name": _env.get("FLAME_WIRETAP_GROUP"), - "color_policy": str(imageio_flame["project"]["colourPolicy"]), # from project "project_name": project_name, @@ -86,6 +90,15 @@ class FlamePrelaunch(PreLaunchHook): "project_data": project_data } + # add color management data + if colormanaged: + project_data.update({ + "FrameDepth": str(imageio_flame["project"]["frameDepth"]), + "FieldDominance": str(imageio_flame["project"]["fieldDominance"]) + }) + data_to_script["color_policy"] = str( + imageio_flame["project"]["colourPolicy"]) + self.log.info(pformat(dict(_env))) self.log.info(pformat(data_to_script)) diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index f323af7496..5eb6ec2d2a 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -1,6 +1,6 @@ { "imageio": { - "enabled": false, + "enabled": true, "ocio_config": { "enabled": false, "filepath": [] From e09fea633417f5ca7d193e022673466a279bedc7 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Mar 2023 22:31:16 +0100 Subject: [PATCH 003/207] global: adding imageio enable switch to colorspace module --- openpype/pipeline/colorspace.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 2085e2d37f..e42838d9dd 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -336,6 +336,7 @@ def get_imageio_config( anatomy_data = get_template_data_from_session() formatting_data = deepcopy(anatomy_data) + # add project roots to anatomy data formatting_data["root"] = anatomy.roots formatting_data["platform"] = platform.system().lower() @@ -344,6 +345,12 @@ def get_imageio_config( imageio_global, imageio_host = _get_imageio_settings( project_settings, host_name) + # check if host settings are having enabled key and if it is False + if imageio_host.get("enabled") and imageio_host["enabled"] is False: + # if host settings are disabled return False because + # it is expected that no colorspace management is needed + return False + config_host = imageio_host.get("ocio_config", {}) if config_host.get("enabled"): From 75aee631c18d9dc2eb1cd9e31d6a4f1785a00cd2 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Mar 2023 22:31:50 +0100 Subject: [PATCH 004/207] Nuke: implementing imageio enable switch --- openpype/hosts/nuke/api/lib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 2a14096f0e..1296bca9b0 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2001,18 +2001,18 @@ class WorkfileSettings(object): "Attention! Viewer nodes {} were erased." "It had wrong color profile".format(erased_viewers)) - def set_root_colorspace(self, nuke_colorspace): + def set_root_colorspace(self, imageio_host): ''' Adds correct colorspace to root Arguments: - nuke_colorspace (dict): adjustmensts from presets + imageio_host (dict): adjustments from presets ''' - workfile_settings = nuke_colorspace["workfile"] + workfile_settings = imageio_host["workfile"] - # resolve config data if they are enabled in host + # get config data if imageio is enabled config_data = None - if nuke_colorspace.get("ocio_config", {}).get("enabled"): + if imageio_host.get("enabled") and imageio_host["enabled"] is True: # switch ocio config to custom config workfile_settings["OCIO_config"] = "custom" workfile_settings["colorManagement"] = "OCIO" From 4f430c56bb9aeef4baeabdbe47bc862b10c6ae37 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Mar 2023 22:32:01 +0100 Subject: [PATCH 005/207] Maya: implementing imageio enable switch --- openpype/hosts/maya/plugins/load/load_image.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openpype/hosts/maya/plugins/load/load_image.py b/openpype/hosts/maya/plugins/load/load_image.py index b464c268fc..552bcc33af 100644 --- a/openpype/hosts/maya/plugins/load/load_image.py +++ b/openpype/hosts/maya/plugins/load/load_image.py @@ -273,6 +273,11 @@ class FileNodeLoader(load.LoaderPlugin): project_name, host_name, project_settings=project_settings ) + + # ignore if host imageio is not enabled + if not config_data: + return + file_rules = get_imageio_file_rules( project_name, host_name, project_settings=project_settings From f388fa3e1670342f2501bb2e5d0d5a670e4cc46a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Mar 2023 22:32:13 +0100 Subject: [PATCH 006/207] Fusion: implementing imageio enable switch --- openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py b/openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py index 6bf0f55081..4dfb4ef223 100644 --- a/openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py +++ b/openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py @@ -26,7 +26,9 @@ class FusionPreLaunchOCIO(PreLaunchHook): anatomy_data=template_data, anatomy=self.data["anatomy"] ) - ocio_path = config_data["path"] - self.log.info(f"Setting OCIO config path: {ocio_path}") - self.launch_context.env["OCIO"] = ocio_path + if config_data: + ocio_path = config_data["path"] + + self.log.info(f"Setting OCIO config path: {ocio_path}") + self.launch_context.env["OCIO"] = ocio_path From 56a775710fd2fc4f1dec8051ed824e54062efab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Fri, 24 Mar 2023 14:22:18 +0100 Subject: [PATCH 007/207] Update openpype/hosts/flame/hooks/pre_flame_setup.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/hosts/flame/hooks/pre_flame_setup.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/flame/hooks/pre_flame_setup.py b/openpype/hosts/flame/hooks/pre_flame_setup.py index 6367e132de..019bf1adda 100644 --- a/openpype/hosts/flame/hooks/pre_flame_setup.py +++ b/openpype/hosts/flame/hooks/pre_flame_setup.py @@ -47,12 +47,9 @@ class FlamePrelaunch(PreLaunchHook): imageio_flame = project_settings["flame"]["imageio"] - colormanaged = True - # check if host settings are having enabled key and if it is False - if imageio_flame.get("enabled") and imageio_flame["enabled"] is False: - # if host settings are disabled return False because - # it is expected that no colorspace management is needed - colormanaged = False + colormanaged = imageio_flame.get("enabled") + if colormanaged is None: + colormanaged = True # get user name and host name user_name = get_openpype_username() From 5feee4cdff183b6dc119ffd25bbea9c15245b7ad Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 24 Mar 2023 14:30:49 +0100 Subject: [PATCH 008/207] hound --- openpype/hosts/flame/hooks/pre_flame_setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/flame/hooks/pre_flame_setup.py b/openpype/hosts/flame/hooks/pre_flame_setup.py index 6367e132de..a5cab84d0d 100644 --- a/openpype/hosts/flame/hooks/pre_flame_setup.py +++ b/openpype/hosts/flame/hooks/pre_flame_setup.py @@ -94,7 +94,8 @@ class FlamePrelaunch(PreLaunchHook): if colormanaged: project_data.update({ "FrameDepth": str(imageio_flame["project"]["frameDepth"]), - "FieldDominance": str(imageio_flame["project"]["fieldDominance"]) + "FieldDominance": str( + imageio_flame["project"]["fieldDominance"]) }) data_to_script["color_policy"] = str( imageio_flame["project"]["colourPolicy"]) From 4ee7604dd7518188f1a9c4662402463b2a558520 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 24 Mar 2023 14:46:30 +0100 Subject: [PATCH 009/207] hound --- openpype/hosts/flame/hooks/pre_flame_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/flame/hooks/pre_flame_setup.py b/openpype/hosts/flame/hooks/pre_flame_setup.py index c6db0d6462..3249fbfe9a 100644 --- a/openpype/hosts/flame/hooks/pre_flame_setup.py +++ b/openpype/hosts/flame/hooks/pre_flame_setup.py @@ -92,7 +92,7 @@ class FlamePrelaunch(PreLaunchHook): project_data.update({ "FrameDepth": str(imageio_flame["project"]["frameDepth"]), "FieldDominance": str( - imageio_flame["project"]["fieldDominance"]) + imageio_flame["project"]["fieldDominance"]) }) data_to_script["color_policy"] = str( imageio_flame["project"]["colourPolicy"]) From a1e57e54cdf11be787406fd61b91ee823d99a0e1 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 28 Mar 2023 22:19:22 +0200 Subject: [PATCH 010/207] more explicit condition for backward compatibility --- openpype/pipeline/colorspace.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index e42838d9dd..5c7442e1c9 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -345,8 +345,13 @@ def get_imageio_config( imageio_global, imageio_host = _get_imageio_settings( project_settings, host_name) - # check if host settings are having enabled key and if it is False - if imageio_host.get("enabled") and imageio_host["enabled"] is False: + # check if host settings group is having enabled key + imageio_enabled = imageio_host.get("enabled") + if imageio_enabled is None: + # it it does not have enabled key, use global settings + imageio_enabled = True + + if not imageio_enabled : # if host settings are disabled return False because # it is expected that no colorspace management is needed return False From f6ac8138b3649b4a6ad5239c094b8636c4dbcb88 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 28 Mar 2023 22:30:48 +0200 Subject: [PATCH 011/207] simplification of condition --- openpype/hosts/nuke/api/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 1296bca9b0..411c0afb8a 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2012,7 +2012,7 @@ class WorkfileSettings(object): # get config data if imageio is enabled config_data = None - if imageio_host.get("enabled") and imageio_host["enabled"] is True: + if imageio_host.get("enabled"): # switch ocio config to custom config workfile_settings["OCIO_config"] = "custom" workfile_settings["colorManagement"] = "OCIO" From 6f1f4046d3a9e957cb89087cc5caf84c806f6cdd Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 28 Mar 2023 22:48:32 +0200 Subject: [PATCH 012/207] creating global prelaunch hook for OCIO env var --- .../pre_ocio_hook.py} | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) rename openpype/{hosts/fusion/hooks/pre_fusion_ocio_hook.py => hooks/pre_ocio_hook.py} (80%) diff --git a/openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py similarity index 80% rename from openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py rename to openpype/hooks/pre_ocio_hook.py index 4dfb4ef223..ff16a8d174 100644 --- a/openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -4,9 +4,17 @@ from openpype.pipeline.colorspace import get_imageio_config from openpype.pipeline.template_data import get_template_data_with_names -class FusionPreLaunchOCIO(PreLaunchHook): - """Set OCIO environment variable for Fusion""" - app_groups = ["fusion"] +class OCIOEnvHook(PreLaunchHook): + """Set OCIO environment variable for hosts that use OpenColorIO.""" + + order = 0 + app_groups = [ + "fusion", + "blender", + "aftereffects", + "3dsmax", + "houdini" + ] def execute(self): """Hook entry method.""" From f58bcc8abbaf5d2de14ae31d67fe872c2fd74e0a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 28 Mar 2023 23:25:33 +0200 Subject: [PATCH 013/207] flame in line comments --- openpype/hosts/flame/hooks/pre_flame_setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/hosts/flame/hooks/pre_flame_setup.py b/openpype/hosts/flame/hooks/pre_flame_setup.py index 3249fbfe9a..b5939b168c 100644 --- a/openpype/hosts/flame/hooks/pre_flame_setup.py +++ b/openpype/hosts/flame/hooks/pre_flame_setup.py @@ -47,7 +47,10 @@ class FlamePrelaunch(PreLaunchHook): imageio_flame = project_settings["flame"]["imageio"] + # get host imageio settings enabled key if exists colormanaged = imageio_flame.get("enabled") + # if key was not found, set to True + # ensuring backward compatibility if colormanaged is None: colormanaged = True From 62eb6d269b82d19510d30d80a82878fa1042939d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 28 Mar 2023 23:29:45 +0200 Subject: [PATCH 014/207] making docstring more readable --- openpype/hosts/nuke/api/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 411c0afb8a..d183f2fea9 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2005,7 +2005,7 @@ class WorkfileSettings(object): ''' Adds correct colorspace to root Arguments: - imageio_host (dict): adjustments from presets + imageio_host (dict): host colorspace configurations ''' workfile_settings = imageio_host["workfile"] From 4c78f3044118c1623000e5a7f385d1041d0a7713 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 6 Apr 2023 15:42:02 +0200 Subject: [PATCH 015/207] maya: adding maya to global ocio prelaunch hook --- openpype/hooks/pre_ocio_hook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index ff16a8d174..f51e9f48d8 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -13,7 +13,8 @@ class OCIOEnvHook(PreLaunchHook): "blender", "aftereffects", "3dsmax", - "houdini" + "houdini", + "maya" ] def execute(self): From ae0d6dd1b5d80eec95958da110bc420b5cfc668b Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 12 Apr 2023 17:25:41 +0200 Subject: [PATCH 016/207] refactoring of settings for more explicitly communicated attributes --- .../project_settings/aftereffects.json | 6 ++-- .../defaults/project_settings/blender.json | 6 ++-- .../defaults/project_settings/celaction.json | 6 ++-- .../defaults/project_settings/flame.json | 6 ++-- .../defaults/project_settings/fusion.json | 6 ++-- .../defaults/project_settings/global.json | 1 - .../defaults/project_settings/harmony.json | 6 ++-- .../defaults/project_settings/hiero.json | 6 ++-- .../defaults/project_settings/houdini.json | 6 ++-- .../defaults/project_settings/max.json | 6 ++-- .../defaults/project_settings/maya.json | 6 ++-- .../defaults/project_settings/nuke.json | 11 ++---- .../defaults/project_settings/photoshop.json | 6 ++-- .../defaults/project_settings/resolve.json | 6 ++-- .../project_settings/traypublisher.json | 6 ++-- .../defaults/project_settings/tvpaint.json | 6 ++-- .../defaults/project_settings/unreal.json | 6 ++-- .../project_settings/webpublisher.json | 6 ++-- .../schema_project_aftereffects.json | 6 ++-- .../schema_project_blender.json | 6 ++-- .../schema_project_celaction.json | 6 ++-- .../projects_schema/schema_project_flame.json | 6 ++-- .../schema_project_fusion.json | 6 ++-- .../schema_project_global.json | 35 +++++++++++++++++-- .../schema_project_harmony.json | 6 ++-- .../projects_schema/schema_project_hiero.json | 7 ++-- .../schema_project_houdini.json | 6 ++-- .../projects_schema/schema_project_max.json | 6 ++-- .../projects_schema/schema_project_maya.json | 5 ++- .../schema_project_photoshop.json | 6 ++-- .../schema_project_resolve.json | 6 ++-- .../schema_project_traypublisher.json | 6 ++-- .../schema_project_tvpaint.json | 6 ++-- .../schema_project_unreal.json | 6 ++-- .../schema_project_webpublisher.json | 6 ++-- .../schemas/schema_imageio_config.json | 7 ++-- .../schemas/schema_imageio_file_rules.json | 7 ++-- .../schemas/schema_nuke_imageio.json | 19 ++-------- 38 files changed, 139 insertions(+), 133 deletions(-) diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index d1b2309d26..74bd519bbd 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/blender.json b/openpype/settings/defaults/project_settings/blender.json index d9aabea9ad..8328ceeda3 100644 --- a/openpype/settings/defaults/project_settings/blender.json +++ b/openpype/settings/defaults/project_settings/blender.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/celaction.json b/openpype/settings/defaults/project_settings/celaction.json index 10dfd70ac6..0e8b465118 100644 --- a/openpype/settings/defaults/project_settings/celaction.json +++ b/openpype/settings/defaults/project_settings/celaction.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index 5eb6ec2d2a..64021baeef 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": true, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} }, "project": { diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index 9130c9322c..fa44bbe3d4 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} }, "ocio": { diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index 4c4a7487cf..fccd02d130 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -7,7 +7,6 @@ ] }, "file_rules": { - "enabled": false, "rules": { "example": { "pattern": ".*(beauty).*", diff --git a/openpype/settings/defaults/project_settings/harmony.json b/openpype/settings/defaults/project_settings/harmony.json index 97c9cdf761..e6fb00a700 100644 --- a/openpype/settings/defaults/project_settings/harmony.json +++ b/openpype/settings/defaults/project_settings/harmony.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index df460e0d86..b7d5d9af23 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} }, "workfile": { diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 8d7f9865c5..2b7192ff99 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/max.json b/openpype/settings/defaults/project_settings/max.json index 8df4d0ca57..f6462c3d9a 100644 --- a/openpype/settings/defaults/project_settings/max.json +++ b/openpype/settings/defaults/project_settings/max.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 6016323b4b..fa3a7bc648 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -1,13 +1,13 @@ { "open_workfile_post_initialization": false, "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} }, "colorManagementPreference_v2": { diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 0573df028d..1dd0e5128a 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -9,13 +9,13 @@ } }, "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} }, "viewer": { @@ -27,11 +27,6 @@ "workfile": { "colorManagement": "Nuke", "OCIO_config": "nuke-default", - "customOCIOConfigPath": { - "windows": [], - "darwin": [], - "linux": [] - }, "workingSpaceLUT": "linear", "monitorLut": "sRGB", "int8Lut": "sRGB", diff --git a/openpype/settings/defaults/project_settings/photoshop.json b/openpype/settings/defaults/project_settings/photoshop.json index 9fd4fe54f1..47f397663b 100644 --- a/openpype/settings/defaults/project_settings/photoshop.json +++ b/openpype/settings/defaults/project_settings/photoshop.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/resolve.json b/openpype/settings/defaults/project_settings/resolve.json index 3720dc54f4..7379e74200 100644 --- a/openpype/settings/defaults/project_settings/resolve.json +++ b/openpype/settings/defaults/project_settings/resolve.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 311c5b0cfc..2668b5d638 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/tvpaint.json b/openpype/settings/defaults/project_settings/tvpaint.json index b649d56337..3c930b84eb 100644 --- a/openpype/settings/defaults/project_settings/tvpaint.json +++ b/openpype/settings/defaults/project_settings/tvpaint.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/unreal.json b/openpype/settings/defaults/project_settings/unreal.json index d83e090fae..d92d3403ed 100644 --- a/openpype/settings/defaults/project_settings/unreal.json +++ b/openpype/settings/defaults/project_settings/unreal.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/webpublisher.json b/openpype/settings/defaults/project_settings/webpublisher.json index a9dc9012eb..17d61ef028 100644 --- a/openpype/settings/defaults/project_settings/webpublisher.json +++ b/openpype/settings/defaults/project_settings/webpublisher.json @@ -1,12 +1,12 @@ { "imageio": { - "enabled": false, + "activate_host_color_management": true, "ocio_config": { - "enabled": false, + "override_global_config": false, "filepath": [] }, "file_rules": { - "enabled": false, + "override_global_rules": false, "rules": {} } }, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 2d48e06ccb..7bc20fed87 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index 2e4dcb4e31..dbba7dfdd2 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json index efecb2a89c..ab3acaf4a2 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 7c839037ad..5b96a49679 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index 87856380ac..fad6361119 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -10,12 +10,12 @@ "type": "dict", "label": "Color Management (ImageIO)", "collapsible": true, - "checkbox_key": "enabled", + "is_group": true, "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json index 6f31f4f685..f200c1722f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json @@ -27,8 +27,39 @@ ] }, { - "type": "schema", - "name": "schema_imageio_file_rules" + "key": "file_rules", + "type": "dict", + "label": "File Rules", + "collapsible": true, + "children": [ + { + "key": "rules", + "label": "Rules", + "type": "dict-modifiable", + "highlight_content": true, + "collapsible": false, + "object_type": { + "type": "dict", + "children": [ + { + "key": "pattern", + "label": "Regex pattern", + "type": "text" + }, + { + "key": "colorspace", + "label": "Colorspace name", + "type": "text" + }, + { + "key": "ext", + "label": "File extension", + "type": "text" + } + ] + } + } + ] } ] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index da80648a14..71f8cb4db2 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index af3ee713c4..5e42cb0a00 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -9,14 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", - "is_group": true, "collapsible": true, - "checkbox_key": "enabled", + "is_group": true, "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 74ffbbe9f4..14217c944e 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index de7b4aca0b..5c4b825872 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index 8373a57429..ef32f907ed 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -16,12 +16,11 @@ "label": "Color Management (ImageIO)", "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json index 95f402ca7c..53e59956eb 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json index da252dd9b1..16de175933 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 4bce299747..bc80562940 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json index b1a31b5c93..a0d94ad7dc 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index b330fd600f..87ba3d2d43 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index d0c2145298..f596c89686 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -9,13 +9,13 @@ "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", + "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json index e7cff969d3..bc65dd7826 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json @@ -3,12 +3,11 @@ "type": "dict", "label": "OCIO config", "collapsible": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "override_global_config", + "label": "Override global OCIO config" }, { "type": "path", @@ -18,4 +17,4 @@ "multipath": true } ] -} \ No newline at end of file +} diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json index a171ba1c55..e76c8a326f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json @@ -3,12 +3,11 @@ "type": "dict", "label": "File Rules", "collapsible": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" + "key": "override_global_rules", + "label": "Override global file rules" }, { "key": "rules", @@ -38,4 +37,4 @@ } } ] -} \ No newline at end of file +} diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index a46958e616..a986db1ade 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -4,16 +4,11 @@ "label": "Color Management (ImageIO)", "collapsible": true, "is_group": true, - "checkbox_key": "enabled", "children": [ { "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "label", - "label": "'Custom OCIO config path' has deprecated.
If you need to set custom config, just enable and add path into 'OCIO config'.
Anatomy keys are supported.." + "key": "activate_host_color_management", + "label": "Enable Color Management in host" }, { "type": "schema", @@ -108,19 +103,9 @@ }, { "cg-config-v1.0.0_aces-v1.3_ocio-v2.1": "cg-config-v1.0.0_aces-v1.3_ocio-v2.1 (14)" - }, - { - "custom": "custom" } ] }, - { - "type": "path", - "key": "customOCIOConfigPath", - "label": "Custom OCIO config path", - "multiplatform": true, - "multipath": true - }, { "type": "text", "key": "workingSpaceLUT", From 57e8722d7151e0343f20991dcd48b4a04bca304e Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 12 Apr 2023 17:50:46 +0200 Subject: [PATCH 017/207] redefining switches for imageio host activation and config overrides --- openpype/pipeline/colorspace.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index f1a50281d2..ed5c284faf 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -344,28 +344,31 @@ def get_imageio_config( imageio_global, imageio_host = _get_imageio_settings( project_settings, host_name) - # check if host settings group is having enabled key - imageio_enabled = imageio_host.get("enabled") - if imageio_enabled is None: - # it it does not have enabled key, use global settings - imageio_enabled = True + # check if host settings group is having activate_host_color_management + # it it does not have activation key then use global settings + # this is for backward compatibility + # TODO: in future rewrite this to be more explicit + activate_host_color_management = imageio_host.get( + "activate_host_color_management", True) - if not imageio_enabled : + if not activate_host_color_management: # if host settings are disabled return False because # it is expected that no colorspace management is needed return False config_host = imageio_host.get("ocio_config", {}) - if config_host.get("enabled"): + # get config path from either global or host_name + # depending on override flag + # TODO: in future rewrite this to be more explicit + config_data = None + override_global_rules = config_host.get("override_global_rules") + if override_global_rules: config_data = _get_config_data( config_host["filepath"], formatting_data ) else: - config_data = None - - if not config_data: - # get config path from either global or host_name + # get config path from global config_global = imageio_global["ocio_config"] config_data = _get_config_data( config_global["filepath"], formatting_data From 8f057e79d51b2e21586cb8733cf8aaff5c19f4fb Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 12 Apr 2023 21:26:25 +0200 Subject: [PATCH 018/207] fixing typo --- openpype/pipeline/colorspace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index ed5c284faf..098e2a02c6 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -362,8 +362,8 @@ def get_imageio_config( # depending on override flag # TODO: in future rewrite this to be more explicit config_data = None - override_global_rules = config_host.get("override_global_rules") - if override_global_rules: + override_global_config = config_host.get("override_global_config") + if override_global_config: config_data = _get_config_data( config_host["filepath"], formatting_data ) From 153810b919efae29db4d7afc84562ac20068e5f7 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 12 Apr 2023 21:45:53 +0200 Subject: [PATCH 019/207] adding hosts colorspace management switches into code --- openpype/pipeline/colorspace.py | 21 +++++++++++++------- openpype/pipeline/publish/publish_plugins.py | 15 +++++++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 098e2a02c6..b3774e5e90 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -92,6 +92,11 @@ def get_imageio_colorspace_from_filepath( ) config_data = get_imageio_config( project_name, host_name, project_settings) + + # in case host color management is not enabled + if not config_data: + return None + file_rules = get_imageio_file_rules( project_name, host_name, project_settings) @@ -354,6 +359,10 @@ def get_imageio_config( if not activate_host_color_management: # if host settings are disabled return False because # it is expected that no colorspace management is needed + log.info( + "Colorspace management for host '{}' is disabled.".format( + host_name) + ) return False config_host = imageio_host.get("ocio_config", {}) @@ -456,13 +465,11 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): frules_host = imageio_host.get("file_rules", {}) # compile file rules dictionary - file_rules = {} - if frules_global["enabled"]: - file_rules.update(frules_global["rules"]) - if frules_host and frules_host["enabled"]: - file_rules.update(frules_host["rules"]) - - return file_rules + override_global_rules = frules_host.get("override_global_rules") + if override_global_rules: + return frules_host["rules"] + else: + return frules_global["rules"] def _get_imageio_settings(project_settings, host_name): diff --git a/openpype/pipeline/publish/publish_plugins.py b/openpype/pipeline/publish/publish_plugins.py index 331235fadc..a3f8413979 100644 --- a/openpype/pipeline/publish/publish_plugins.py +++ b/openpype/pipeline/publish/publish_plugins.py @@ -331,6 +331,11 @@ class ColormanagedPyblishPluginMixin(object): project_settings=project_settings_, anatomy_data=anatomy_data ) + + # in case host color management is not enabled + if not config_data: + return None + file_rules = get_imageio_file_rules( project_name, host_name, project_settings=project_settings_ @@ -385,14 +390,14 @@ class ColormanagedPyblishPluginMixin(object): if colorspace_settings is None: colorspace_settings = self.get_colorspace_settings(context) + # in case host color management is not enabled + if not colorspace_settings: + self.log.warning("Host's colorspace management is disabled.") + return + # unpack colorspace settings config_data, file_rules = colorspace_settings - if not config_data: - # warn in case no colorspace path was defined - self.log.warning("No colorspace management was defined") - return - self.log.info("Config data is : `{}`".format( config_data)) From 6ae7b415330778d9588ef8a8bea2e0ca83f51881 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 12 Apr 2023 22:50:32 +0200 Subject: [PATCH 020/207] fixing tests --- .../openpype/pipeline/publish/test_publish_plugins.py | 10 +++++----- tests/unit/openpype/pipeline/test_colorspace.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/openpype/pipeline/publish/test_publish_plugins.py b/tests/unit/openpype/pipeline/publish/test_publish_plugins.py index 88e0095e34..bbeab2cc90 100644 --- a/tests/unit/openpype/pipeline/publish/test_publish_plugins.py +++ b/tests/unit/openpype/pipeline/publish/test_publish_plugins.py @@ -26,7 +26,7 @@ log = logging.getLogger(__name__) class TestPipelinePublishPlugins(TestPipeline): - """ Testing Pipeline pubish_plugins.py + """ Testing Pipeline publish_plugins.py Example: cd to OpenPype repo root dir @@ -37,7 +37,7 @@ class TestPipelinePublishPlugins(TestPipeline): # files are the same as those used in `test_pipeline_colorspace` TEST_FILES = [ ( - "1d7t9_cVKeZRVF0ppCHiE5MJTTtTlJgBe", + "1YinxOToVyAd3-jAMFgVf7EWQa2x8Ma-O", "test_pipeline_colorspace.zip", "" ) @@ -140,7 +140,7 @@ class TestPipelinePublishPlugins(TestPipeline): config_data, file_rules = plugin.get_colorspace_settings(context) assert config_data["template"] == expected_config_template, ( - "Returned config tempate is not " + "Returned config template is not " f"matching {expected_config_template}" ) assert file_rules == expected_file_rules, ( @@ -193,11 +193,11 @@ class TestPipelinePublishPlugins(TestPipeline): colorspace_data_hiero = representation_hiero.get("colorspaceData") assert colorspace_data_nuke, ( - "Colorspace data were not created in prepresentation" + "Colorspace data were not created in representation" f"matching {representation_nuke}" ) assert colorspace_data_hiero, ( - "Colorspace data were not created in prepresentation" + "Colorspace data were not created in representation" f"matching {representation_hiero}" ) diff --git a/tests/unit/openpype/pipeline/test_colorspace.py b/tests/unit/openpype/pipeline/test_colorspace.py index d064ca2be4..d0981723ad 100644 --- a/tests/unit/openpype/pipeline/test_colorspace.py +++ b/tests/unit/openpype/pipeline/test_colorspace.py @@ -31,7 +31,7 @@ class TestPipelineColorspace(TestPipeline): TEST_FILES = [ ( - "1d7t9_cVKeZRVF0ppCHiE5MJTTtTlJgBe", + "1YinxOToVyAd3-jAMFgVf7EWQa2x8Ma-O", "test_pipeline_colorspace.zip", "" ) @@ -120,7 +120,7 @@ class TestPipelineColorspace(TestPipeline): ) assert config_data["template"] == expected_template, ( f"Config template \'{config_data['template']}\' doesn't match " - f"expected tempalte \'{expected_template}\'" + f"expected template \'{expected_template}\'" ) def test_parse_colorspace_from_filepath( From b8ee128bc09922c97bedd71780111ab707db1043 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 17 Apr 2023 12:00:31 +0200 Subject: [PATCH 021/207] imageio: adding `use_ocio_config` toggle --- openpype/hooks/pre_ocio_hook.py | 21 +++++++++++++++-- openpype/pipeline/colorspace.py | 23 +++++++++++++++++++ .../project_settings/aftereffects.json | 1 + .../defaults/project_settings/blender.json | 1 + .../defaults/project_settings/fusion.json | 1 + .../defaults/project_settings/hiero.json | 1 + .../defaults/project_settings/houdini.json | 1 + .../defaults/project_settings/max.json | 1 + .../defaults/project_settings/maya.json | 1 + .../defaults/project_settings/nuke.json | 1 + .../defaults/project_settings/unreal.json | 1 + .../schema_project_aftereffects.json | 5 ++++ .../schema_project_blender.json | 5 ++++ .../schema_project_fusion.json | 5 ++++ .../projects_schema/schema_project_hiero.json | 5 ++++ .../schema_project_houdini.json | 5 ++++ .../projects_schema/schema_project_max.json | 5 ++++ .../projects_schema/schema_project_maya.json | 5 ++++ .../schema_project_unreal.json | 5 ++++ .../schemas/schema_nuke_imageio.json | 5 ++++ 20 files changed, 96 insertions(+), 2 deletions(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index f51e9f48d8..9038d57e9e 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -1,6 +1,9 @@ from openpype.lib import PreLaunchHook -from openpype.pipeline.colorspace import get_imageio_config +from openpype.pipeline.colorspace import ( + get_imageio_config, + is_host_use_ocio_config_activated +) from openpype.pipeline.template_data import get_template_data_with_names @@ -14,7 +17,12 @@ class OCIOEnvHook(PreLaunchHook): "aftereffects", "3dsmax", "houdini", - "maya" + "maya", + "nuke", + "nukex", + "nukeassist", + "nukestudio", + "hiero" ] def execute(self): @@ -37,6 +45,15 @@ class OCIOEnvHook(PreLaunchHook): ) if config_data: + use_config_path = is_host_use_ocio_config_activated( + project_name=self.data["project_name"], + host_name=self.host_name, + host_name=self.data["project_settings"] + ) + if not use_config_path: + self.log.info("Using of OCIO config path was not activated...") + return + ocio_path = config_data["path"] self.log.info(f"Setting OCIO config path: {ocio_path}") diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index b3774e5e90..5520dab627 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -392,6 +392,29 @@ def get_imageio_config( return config_data +def is_host_use_ocio_config_activated( + project_name, host_name, project_settings=None +): + """Check if host OCIO config path is activated + + Args: + project_name (str): project name + host_name (str): host name + + Returns: + bool: True if activated + """ + project_settings = project_settings or get_project_settings(project_name) + + # get colorspace settings + _, imageio_host = _get_imageio_settings( + project_settings, host_name) + + # check if host settings is having use_ocio_config + if imageio_host.get("use_ocio_config", False): + return True + + def _get_config_data(path_list, anatomy_data): """Return first existing path in path list. diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index 74bd519bbd..5b6dffe67e 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/blender.json b/openpype/settings/defaults/project_settings/blender.json index 8328ceeda3..f1a3286488 100644 --- a/openpype/settings/defaults/project_settings/blender.json +++ b/openpype/settings/defaults/project_settings/blender.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index fa44bbe3d4..ede907e415 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index b7d5d9af23..e2b5933b6d 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 2b7192ff99..fca782b2b8 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/max.json b/openpype/settings/defaults/project_settings/max.json index f6462c3d9a..a9625cc539 100644 --- a/openpype/settings/defaults/project_settings/max.json +++ b/openpype/settings/defaults/project_settings/max.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index fa3a7bc648..60d5b5ad67 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -2,6 +2,7 @@ "open_workfile_post_initialization": false, "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 1dd0e5128a..cea458d289 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -10,6 +10,7 @@ }, "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/unreal.json b/openpype/settings/defaults/project_settings/unreal.json index d92d3403ed..60471f28c9 100644 --- a/openpype/settings/defaults/project_settings/unreal.json +++ b/openpype/settings/defaults/project_settings/unreal.json @@ -1,6 +1,7 @@ { "imageio": { "activate_host_color_management": true, + "use_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 7bc20fed87..35371f3505 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index dbba7dfdd2..793ac5e908 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index fad6361119..b088f3f034 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index 5e42cb0a00..d09a9efa25 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 14217c944e..24e741ff66 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index 5c4b825872..aa336d0791 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index ef32f907ed..534afe2e12 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -22,6 +22,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index 87ba3d2d43..bfcb4d7fe6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -17,6 +17,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index a986db1ade..1122eb1949 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -10,6 +10,11 @@ "key": "activate_host_color_management", "label": "Enable Color Management in host" }, + { + "type": "boolean", + "key": "use_ocio_config", + "label": "Use OCIO config file in host" + }, { "type": "schema", "name": "schema_imageio_config" From 4148788761dc0c966bd83af00cbb2cd1e235d79a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 17 Apr 2023 12:16:37 +0200 Subject: [PATCH 022/207] removing obsolete settings all of those settings were now driven form global hook`pre_ocio_hook.py` which is activating OCIO environment variable --- .../defaults/project_settings/hiero.json | 5 ---- .../defaults/project_settings/maya.json | 10 -------- .../schema_project_fusion.json | 25 ------------------- .../projects_schema/schema_project_hiero.json | 14 ----------- .../projects_schema/schema_project_maya.json | 22 ---------------- 5 files changed, 76 deletions(-) diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index e2b5933b6d..a1ca0e8933 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -12,11 +12,6 @@ }, "workfile": { "ocioConfigName": "nuke-default", - "ocioconfigpath": { - "windows": [], - "darwin": [], - "linux": [] - }, "workingSpace": "linear", "sixteenBitLut": "sRGB", "eightBitLut": "sRGB", diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 60d5b5ad67..b33636a446 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -13,21 +13,11 @@ }, "colorManagementPreference_v2": { "enabled": true, - "configFilePath": { - "windows": [], - "darwin": [], - "linux": [] - }, "renderSpace": "ACEScg", "displayName": "sRGB", "viewName": "ACES 1.0 SDR-video" }, "colorManagementPreference": { - "configFilePath": { - "windows": [], - "darwin": [], - "linux": [] - }, "renderSpace": "scene-linear Rec 709/sRGB", "viewTransform": "sRGB gamma" } diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index b088f3f034..d488c9f551 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -29,31 +29,6 @@ { "type": "schema", "name": "schema_imageio_file_rules" - }, - { - "key": "ocio", - "type": "dict", - "label": "OpenColorIO (OCIO)", - "collapsible": true, - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Set OCIO variable for Fusion" - }, - { - "type": "label", - "label": "'configFilePath' will be deprecated.
Please move values to : project_settings/{app}/imageio/ocio_config/filepath." - }, - { - "type": "path", - "key": "configFilePath", - "label": "OCIO Config File Path", - "multiplatform": true, - "multipath": true - } - ] } ] }, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index d09a9efa25..0bd88c6e11 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -36,10 +36,6 @@ "label": "Workfile", "collapsible": false, "children": [ - { - "type": "label", - "label": "'ocioconfigpath' will be deprecated.
Please move values to : project_settings/{app}/imageio/ocio_config/filepath." - }, { "type": "form", "children": [ @@ -65,19 +61,9 @@ }, { "cg-config-v1.0.0_aces-v1.3_ocio-v2.1": "cg-config-v1.0.0_aces-v1.3_ocio-v2.1 (14)" - }, - { - "custom": "custom" } ] }, - { - "type": "path", - "key": "ocioconfigpath", - "label": "Custom OCIO path", - "multiplatform": true, - "multipath": true - }, { "type": "text", "key": "workingSpace", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index 534afe2e12..cb2292319a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -47,17 +47,6 @@ "key": "enabled", "label": "Use Color Management Preference v2" }, - { - "type": "label", - "label": "'configFilePath' will be deprecated.
Please move values to : project_settings/{app}/imageio/ocio_config/filepath." - }, - { - "type": "path", - "key": "configFilePath", - "label": "OCIO Config File Path", - "multiplatform": true, - "multipath": true - }, { "type": "text", "key": "renderSpace", @@ -81,17 +70,6 @@ "label": "Color Management Preference (legacy)", "collapsible": true, "children": [ - { - "type": "label", - "label": "'configFilePath' will be deprecated.
Please move values to : project_settings/{app}/imageio/ocio_config/filepath." - }, - { - "type": "path", - "key": "configFilePath", - "label": "OCIO Config File Path", - "multiplatform": true, - "multipath": true - }, { "type": "text", "key": "renderSpace", From 5a39139aaa0321bea3635cc8d8b9ef144af87282 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 17 Apr 2023 12:27:27 +0200 Subject: [PATCH 023/207] fix duplicated keyword input --- openpype/hooks/pre_ocio_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index 9038d57e9e..d65433fba6 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -48,7 +48,7 @@ class OCIOEnvHook(PreLaunchHook): use_config_path = is_host_use_ocio_config_activated( project_name=self.data["project_name"], host_name=self.host_name, - host_name=self.data["project_settings"] + project_settings=self.data["project_settings"] ) if not use_config_path: self.log.info("Using of OCIO config path was not activated...") From 30d0b35c9a80960ee3f620c521c96fc729982d58 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 17 Apr 2023 12:28:02 +0200 Subject: [PATCH 024/207] removing obsolete code in nuke host since we are using OCIO env var there is no need to set this per attribute --- openpype/hosts/nuke/api/lib.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 71643a2fd0..57c3207463 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2013,18 +2013,6 @@ class WorkfileSettings(object): ''' workfile_settings = imageio_host["workfile"] - # get config data if imageio is enabled - config_data = None - if imageio_host.get("enabled"): - # switch ocio config to custom config - workfile_settings["OCIO_config"] = "custom" - workfile_settings["colorManagement"] = "OCIO" - - # get resolved ocio config path - config_data = get_imageio_config( - legacy_io.active_project(), "nuke" - ) - # first set OCIO if self._root_node["colorManagement"].value() \ not in str(workfile_settings["colorManagement"]): @@ -2034,6 +2022,7 @@ class WorkfileSettings(object): # we dont need the key anymore workfile_settings.pop("colorManagement") + # second set ocio version if self._root_node["OCIO_config"].value() \ not in str(workfile_settings["OCIO_config"]): @@ -2043,14 +2032,6 @@ class WorkfileSettings(object): # we dont need the key anymore workfile_settings.pop("OCIO_config") - # third set ocio custom path - if config_data: - self._root_node["customOCIOConfigPath"].setValue( - str(config_data["path"]).replace("\\", "/") - ) - # backward compatibility, remove in case it exists - workfile_settings.pop("customOCIOConfigPath") - # then set the rest for knob, value in workfile_settings.items(): # skip unfilled ocio config path From 23105fcf9052804dcbfa034b63301faf8d6c884e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Thu, 20 Apr 2023 22:00:41 +0200 Subject: [PATCH 025/207] Update openpype/pipeline/colorspace.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fabià Serra Arrizabalaga --- openpype/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 5520dab627..ceb4572b38 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -350,7 +350,7 @@ def get_imageio_config( project_settings, host_name) # check if host settings group is having activate_host_color_management - # it it does not have activation key then use global settings + # it it does not have activation key then default it to True so it uses global settings # this is for backward compatibility # TODO: in future rewrite this to be more explicit activate_host_color_management = imageio_host.get( From 3793830b3db1d340f4e594ea34b8209d383067ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Thu, 20 Apr 2023 22:05:50 +0200 Subject: [PATCH 026/207] Update openpype/pipeline/colorspace.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fabià Serra Arrizabalaga --- openpype/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index ceb4572b38..5dd7f01009 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -411,7 +411,7 @@ def is_host_use_ocio_config_activated( project_settings, host_name) # check if host settings is having use_ocio_config - if imageio_host.get("use_ocio_config", False): + return imageio_host.get("use_ocio_config", False) return True From b66aaf2bdff6bd8ee013ecf9d96b63fbdb9f573c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 20 Apr 2023 22:09:48 +0200 Subject: [PATCH 027/207] keep consistency in returning types --- openpype/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index ceb4572b38..29794aa7aa 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -363,7 +363,7 @@ def get_imageio_config( "Colorspace management for host '{}' is disabled.".format( host_name) ) - return False + return {} config_host = imageio_host.get("ocio_config", {}) From 92c148a42e2f3dfb4c67edbd8d2e387b1cd2fe72 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 20 Apr 2023 22:22:33 +0200 Subject: [PATCH 028/207] hound --- openpype/pipeline/colorspace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index eecaa64705..e8d88bf533 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -350,7 +350,8 @@ def get_imageio_config( project_settings, host_name) # check if host settings group is having activate_host_color_management - # it it does not have activation key then default it to True so it uses global settings + # it it does not have activation key then default it to True so it uses + # global settings # this is for backward compatibility # TODO: in future rewrite this to be more explicit activate_host_color_management = imageio_host.get( @@ -412,7 +413,6 @@ def is_host_use_ocio_config_activated( # check if host settings is having use_ocio_config return imageio_host.get("use_ocio_config", False) - return True def _get_config_data(path_list, anatomy_data): From 35c1e4cd89d6694d729cb11604ed1c21e5c44f3c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 21 Apr 2023 10:58:18 +0200 Subject: [PATCH 029/207] Converting `app_groups` to `hosts` --- openpype/hooks/pre_ocio_hook.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index d65433fba6..7c67be5cfe 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -11,7 +11,7 @@ class OCIOEnvHook(PreLaunchHook): """Set OCIO environment variable for hosts that use OpenColorIO.""" order = 0 - app_groups = [ + hosts = [ "fusion", "blender", "aftereffects", @@ -19,9 +19,6 @@ class OCIOEnvHook(PreLaunchHook): "houdini", "maya", "nuke", - "nukex", - "nukeassist", - "nukestudio", "hiero" ] From 63af34e9ab76e1e1ccc15067c188bb1648fd279e Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 21 Apr 2023 11:52:34 +0200 Subject: [PATCH 030/207] rename `use_ocio_config` to `set_ocio_config` --- openpype/hooks/pre_ocio_hook.py | 4 ++-- openpype/pipeline/colorspace.py | 6 +++--- .../settings/defaults/project_settings/aftereffects.json | 2 +- openpype/settings/defaults/project_settings/blender.json | 2 +- openpype/settings/defaults/project_settings/fusion.json | 2 +- openpype/settings/defaults/project_settings/hiero.json | 2 +- openpype/settings/defaults/project_settings/houdini.json | 2 +- openpype/settings/defaults/project_settings/max.json | 2 +- openpype/settings/defaults/project_settings/maya.json | 2 +- openpype/settings/defaults/project_settings/nuke.json | 2 +- openpype/settings/defaults/project_settings/unreal.json | 2 +- .../projects_schema/schema_project_aftereffects.json | 2 +- .../schemas/projects_schema/schema_project_blender.json | 2 +- .../schemas/projects_schema/schema_project_fusion.json | 2 +- .../schemas/projects_schema/schema_project_hiero.json | 2 +- .../schemas/projects_schema/schema_project_houdini.json | 2 +- .../schemas/projects_schema/schema_project_max.json | 2 +- .../schemas/projects_schema/schema_project_maya.json | 2 +- .../schemas/projects_schema/schema_project_unreal.json | 2 +- .../projects_schema/schemas/schema_nuke_imageio.json | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index 7c67be5cfe..e09460db14 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -2,7 +2,7 @@ from openpype.lib import PreLaunchHook from openpype.pipeline.colorspace import ( get_imageio_config, - is_host_use_ocio_config_activated + is_set_ocio_config_activated ) from openpype.pipeline.template_data import get_template_data_with_names @@ -42,7 +42,7 @@ class OCIOEnvHook(PreLaunchHook): ) if config_data: - use_config_path = is_host_use_ocio_config_activated( + use_config_path = is_set_ocio_config_activated( project_name=self.data["project_name"], host_name=self.host_name, project_settings=self.data["project_settings"] diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index e8d88bf533..a1714bc75e 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -393,7 +393,7 @@ def get_imageio_config( return config_data -def is_host_use_ocio_config_activated( +def is_set_ocio_config_activated( project_name, host_name, project_settings=None ): """Check if host OCIO config path is activated @@ -411,8 +411,8 @@ def is_host_use_ocio_config_activated( _, imageio_host = _get_imageio_settings( project_settings, host_name) - # check if host settings is having use_ocio_config - return imageio_host.get("use_ocio_config", False) + # check if host settings is having set_ocio_config + return imageio_host.get("set_ocio_config", False) def _get_config_data(path_list, anatomy_data): diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index 5b6dffe67e..c30356335b 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/blender.json b/openpype/settings/defaults/project_settings/blender.json index f1a3286488..1969cd8346 100644 --- a/openpype/settings/defaults/project_settings/blender.json +++ b/openpype/settings/defaults/project_settings/blender.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index ede907e415..c80936d402 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index a1ca0e8933..e876d1727d 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index fca782b2b8..dd3fc87b80 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/max.json b/openpype/settings/defaults/project_settings/max.json index a9625cc539..89ba7a702d 100644 --- a/openpype/settings/defaults/project_settings/max.json +++ b/openpype/settings/defaults/project_settings/max.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 9b86a04bd9..d50441d961 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -411,7 +411,7 @@ }, "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 0f7c5fdaef..119a240ad5 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -10,7 +10,7 @@ }, "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/unreal.json b/openpype/settings/defaults/project_settings/unreal.json index 60471f28c9..71c3498f1e 100644 --- a/openpype/settings/defaults/project_settings/unreal.json +++ b/openpype/settings/defaults/project_settings/unreal.json @@ -1,7 +1,7 @@ { "imageio": { "activate_host_color_management": true, - "use_ocio_config": false, + "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 35371f3505..777d185275 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index 793ac5e908..8872cd123e 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index d488c9f551..41f464589c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index 0bd88c6e11..55d29e8b07 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 24e741ff66..4782295006 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index aa336d0791..d57f603641 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index ef6e3f9171..a99b650401 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -59,7 +59,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index bfcb4d7fe6..d5c58e6a5d 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -19,7 +19,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index 1122eb1949..4bc741703a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -12,7 +12,7 @@ }, { "type": "boolean", - "key": "use_ocio_config", + "key": "set_ocio_config", "label": "Use OCIO config file in host" }, { From bae3ca9a3be102c926fda14eaa497e3b49ec63ea Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 21 Apr 2023 11:57:22 +0200 Subject: [PATCH 031/207] change label to reflect attribute name --- .../schemas/projects_schema/schema_project_aftereffects.json | 2 +- .../schemas/projects_schema/schema_project_blender.json | 2 +- .../entities/schemas/projects_schema/schema_project_fusion.json | 2 +- .../entities/schemas/projects_schema/schema_project_hiero.json | 2 +- .../schemas/projects_schema/schema_project_houdini.json | 2 +- .../entities/schemas/projects_schema/schema_project_max.json | 2 +- .../entities/schemas/projects_schema/schema_project_maya.json | 2 +- .../entities/schemas/projects_schema/schema_project_unreal.json | 2 +- .../schemas/projects_schema/schemas/schema_nuke_imageio.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 777d185275..148c1840e5 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index 8872cd123e..fe6ee94654 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index 41f464589c..f97a3a3a40 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index 55d29e8b07..a46611dc8b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 4782295006..d254b92269 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index d57f603641..1141cefb40 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index a99b650401..37f864a71c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -60,7 +60,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index d5c58e6a5d..4ff4bddc47 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -20,7 +20,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index 4bc741703a..c69a4c4f4b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -13,7 +13,7 @@ { "type": "boolean", "key": "set_ocio_config", - "label": "Use OCIO config file in host" + "label": "Set OCIO config file in host" }, { "type": "schema", From a31e90c53255d4cd84983218f4647aa50ae14649 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 21 Apr 2023 15:41:38 +0200 Subject: [PATCH 032/207] renaming variable according to attribute --- openpype/hooks/pre_ocio_hook.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index e09460db14..bcff31fc93 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -42,16 +42,21 @@ class OCIOEnvHook(PreLaunchHook): ) if config_data: - use_config_path = is_set_ocio_config_activated( + set_config_path = is_set_ocio_config_activated( project_name=self.data["project_name"], host_name=self.host_name, project_settings=self.data["project_settings"] ) - if not use_config_path: - self.log.info("Using of OCIO config path was not activated...") + if not set_config_path: + self.log.info( + "Setting of OCIO environment with " + "config path was not activated..." + ) return ocio_path = config_data["path"] - self.log.info(f"Setting OCIO config path: {ocio_path}") + self.log.info( + f"Setting OCIO environment to config path: {ocio_path}") + self.launch_context.env["OCIO"] = ocio_path From 3fe4710b2115a5618ec898c94587f52d5522dbf6 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 21 Apr 2023 15:42:19 +0200 Subject: [PATCH 033/207] Maya: refactor colorspace preferecies with new settings --- openpype/hosts/maya/api/lib.py | 147 ++++++++---------- .../defaults/project_settings/maya.json | 14 +- .../projects_schema/schema_project_maya.json | 61 ++++++-- 3 files changed, 127 insertions(+), 95 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 61ea3d59df..58537db5f0 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -1,6 +1,7 @@ """Standalone helper functions""" import os +from pprint import pformat import sys import platform import uuid @@ -3177,75 +3178,6 @@ def iter_shader_edits(relationships, shader_nodes, nodes_by_id, label=None): def set_colorspace(): """Set Colorspace from project configuration """ - project_name = os.getenv("AVALON_PROJECT") - imageio = get_project_settings(project_name)["maya"]["imageio"] - - # Maya 2022+ introduces new OCIO v2 color management settings that - # can override the old color managenement preferences. OpenPype has - # separate settings for both so we fall back when necessary. - use_ocio_v2 = imageio["colorManagementPreference_v2"]["enabled"] - required_maya_version = 2022 - maya_version = int(cmds.about(version=True)) - maya_supports_ocio_v2 = maya_version >= required_maya_version - if use_ocio_v2 and not maya_supports_ocio_v2: - # Fallback to legacy behavior with a warning - log.warning("Color Management Preference v2 is enabled but not " - "supported by current Maya version: {} (< {}). Falling " - "back to legacy settings.".format( - maya_version, required_maya_version) - ) - use_ocio_v2 = False - - if use_ocio_v2: - root_dict = imageio["colorManagementPreference_v2"] - else: - root_dict = imageio["colorManagementPreference"] - - if not isinstance(root_dict, dict): - msg = "set_colorspace(): argument should be dictionary" - log.error(msg) - - log.debug(">> root_dict: {}".format(root_dict)) - - # enable color management - cmds.colorManagementPrefs(e=True, cmEnabled=True) - cmds.colorManagementPrefs(e=True, ocioRulesEnabled=True) - - # set config path - custom_ocio_config = False - if root_dict.get("configFilePath"): - unresolved_path = root_dict["configFilePath"] - ocio_paths = unresolved_path[platform.system().lower()] - - resolved_path = None - for ocio_p in ocio_paths: - resolved_path = str(ocio_p).format(**os.environ) - if not os.path.exists(resolved_path): - continue - - if resolved_path: - filepath = str(resolved_path).replace("\\", "/") - cmds.colorManagementPrefs(e=True, configFilePath=filepath) - cmds.colorManagementPrefs(e=True, cmConfigFileEnabled=True) - log.debug("maya '{}' changed to: {}".format( - "configFilePath", resolved_path)) - custom_ocio_config = True - else: - cmds.colorManagementPrefs(e=True, cmConfigFileEnabled=False) - cmds.colorManagementPrefs(e=True, configFilePath="") - - # If no custom OCIO config file was set we make sure that Maya 2022+ - # either chooses between Maya's newer default v2 or legacy config based - # on OpenPype setting to use ocio v2 or not. - if maya_supports_ocio_v2 and not custom_ocio_config: - if use_ocio_v2: - # Use Maya 2022+ default OCIO v2 config - log.info("Setting default Maya OCIO v2 config") - cmds.colorManagementPrefs(edit=True, configFilePath="") - else: - # Set the Maya default config file path - log.info("Setting default Maya OCIO v1 legacy config") - cmds.colorManagementPrefs(edit=True, configFilePath="legacy") # set color spaces for rendering space and view transforms def _colormanage(**kwargs): @@ -3262,17 +3194,74 @@ def set_colorspace(): except RuntimeError as exc: log.error(exc) - if use_ocio_v2: - _colormanage(renderingSpaceName=root_dict["renderSpace"]) - _colormanage(displayName=root_dict["displayName"]) - _colormanage(viewName=root_dict["viewName"]) - else: - _colormanage(renderingSpaceName=root_dict["renderSpace"]) - if maya_supports_ocio_v2: - _colormanage(viewName=root_dict["viewTransform"]) - _colormanage(displayName="legacy") + project_name = os.getenv("AVALON_PROJECT") + imageio = get_project_settings(project_name)["maya"]["imageio"] + + # ocio compatibility variables + ocio_v2_maya_version = 2022 + maya_version = int(cmds.about(version=True)) + ocio_v2_support = use_ocio_v2 = maya_version >= ocio_v2_maya_version + + root_dict = {} + use_workfile_settings = imageio.get("workfile", {}).get("enabled") + + if use_workfile_settings: + # TODO: deprecated code from 3.15.5 - remove + # Maya 2022+ introduces new OCIO v2 color management settings that + # can override the old color management preferences. OpenPype has + # separate settings for both so we fall back when necessary. + use_ocio_v2 = imageio["colorManagementPreference_v2"]["enabled"] + if use_ocio_v2 and not ocio_v2_support: + # Fallback to legacy behavior with a warning + log.warning( + "Color Management Preference v2 is enabled but not " + "supported by current Maya version: {} (< {}). Falling " + "back to legacy settings.".format( + maya_version, ocio_v2_maya_version) + ) + + if use_ocio_v2: + root_dict = imageio["colorManagementPreference_v2"] else: - _colormanage(viewTransformName=root_dict["viewTransform"]) + root_dict = imageio["colorManagementPreference"] + + if not isinstance(root_dict, dict): + msg = "set_colorspace(): argument should be dictionary" + log.error(msg) + + else: + root_dict = imageio["workfile"] + + log.debug(">> root_dict: {}".format(pformat(root_dict))) + + if root_dict: + # enable color management + cmds.colorManagementPrefs(e=True, cmEnabled=True) + cmds.colorManagementPrefs(e=True, ocioRulesEnabled=True) + + # backward compatibility + # TODO: deprecated code from 3.15.5 - refactor to use new settings + view_name = root_dict.get("viewTransform") + if view_name is None: + view_name = root_dict.get("viewName") + + if use_ocio_v2: + # Use Maya 2022+ default OCIO v2 config + log.info("Setting default Maya OCIO v2 config") + cmds.colorManagementPrefs(edit=True, configFilePath="") + + # set rendering space and view transform + _colormanage(renderingSpaceName=root_dict["renderSpace"]) + _colormanage(viewName=view_name) + _colormanage(displayName=root_dict["displayName"]) + else: + # Set the Maya default config file path + log.info("Setting default Maya OCIO v1 legacy config") + cmds.colorManagementPrefs(edit=True, configFilePath="legacy") + + # set rendering space and view transform + _colormanage(renderingSpaceName=root_dict["renderSpace"]) + _colormanage(viewTransformName=view_name) @contextlib.contextmanager diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index d50441d961..b09ed146bf 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -420,6 +420,12 @@ "override_global_rules": false, "rules": {} }, + "workfile": { + "enabled": false, + "renderSpace": "ACEScg", + "displayName": "sRGB", + "viewName": "ACES 1.0 SDR-video" + }, "colorManagementPreference_v2": { "enabled": true, "renderSpace": "ACEScg", @@ -448,6 +454,10 @@ "destination-path": [] } }, + "include_handles": { + "include_handles_default": false, + "per_task_type": [] + }, "scriptsmenu": { "name": "OpenPype Tools", "definition": [ @@ -1546,10 +1556,6 @@ } ] }, - "include_handles": { - "include_handles_default": false, - "per_task_type": [] - }, "templated_workfile_build": { "profiles": [] }, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index 37f864a71c..b5366bb0a7 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -71,16 +71,16 @@ "name": "schema_imageio_file_rules" }, { - "key": "colorManagementPreference_v2", + "key": "workfile", "type": "dict", - "label": "Color Management Preference v2 (Maya 2022+)", + "label": "Workfile", "collapsible": true, "checkbox_key": "enabled", "children": [ { "type": "boolean", "key": "enabled", - "label": "Use Color Management Preference v2" + "label": "Enabled" }, { "type": "text", @@ -100,20 +100,57 @@ ] }, { - "key": "colorManagementPreference", - "type": "dict", - "label": "Color Management Preference (legacy)", + "type": "collapsible-wrap", + "label": "[Deprecated] please migrate all to 'Workfile' and enable it.", "collapsible": true, + "collapsed": true, "children": [ { - "type": "text", - "key": "renderSpace", - "label": "Rendering Space" + "key": "colorManagementPreference_v2", + "type": "dict", + "label": "[DEPRECATED] Color Management Preference v2 (Maya 2022+)", + "collapsible": true, + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Use Color Management Preference v2" + }, + { + "type": "text", + "key": "renderSpace", + "label": "Rendering Space" + }, + { + "type": "text", + "key": "displayName", + "label": "Display" + }, + { + "type": "text", + "key": "viewName", + "label": "View" + } + ] }, { - "type": "text", - "key": "viewTransform", - "label": "Viewer Transform" + "key": "colorManagementPreference", + "type": "dict", + "label": "[DEPRECATED] Color Management Preference (legacy)", + "collapsible": true, + "children": [ + { + "type": "text", + "key": "renderSpace", + "label": "Rendering Space" + }, + { + "type": "text", + "key": "viewTransform", + "label": "Viewer Transform (workfile/viewName)" + } + ] } ] } From 7aaa5f767c196bb9b95e3225e0347e84f11660f7 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 21 Apr 2023 15:42:51 +0200 Subject: [PATCH 034/207] removing old settings --- openpype/settings/defaults/project_settings/fusion.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index c80936d402..ba2abd467f 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -9,14 +9,6 @@ "file_rules": { "override_global_rules": false, "rules": {} - }, - "ocio": { - "enabled": false, - "configFilePath": { - "windows": [], - "darwin": [], - "linux": [] - } } }, "copy_fusion_settings": { From b230da486112d08698a5437ddb2f70c88ece773d Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 28 Apr 2023 10:56:32 +0200 Subject: [PATCH 035/207] :recycle: change container to custom attrib modifier --- openpype/hosts/max/api/plugin.py | 93 +++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 13 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index b54568b360..213d6c04e0 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """3dsmax specific Avalon/Pyblish plugin definitions.""" from pymxs import runtime as rt +from typing import Union import six from abc import ABCMeta from openpype.pipeline import ( @@ -12,6 +13,59 @@ from openpype.lib import BoolDef from .lib import imprint, read, lsattr +MS_CUSTOM_ATTRIB = """attributes "openPypeData" +( + parameters main rollout:OPparams + ( + all_handles type:#maxObjectTab tabSize:0 tabSizeVariable:on + ) + + rollout OPparams "OP Parameters" + ( + listbox list_node "Node References" items:#() + button button_add "Add Selection" + + fn node_to_name the_node = + ( + handle = the_node.handle + obj_name = the_node.name + handle_name = obj_name + "<" + handle as string + ">" + return handle_name + ) + + on button_add pressed do + ( + current_selection = selectByName title:"Select Objects To Add To Container" buttontext:"Add" + temp_arr = #() + i_node_arr = #() + for c in current_selection do + ( + handle_name = node_to_name c + node_ref = NodeTransformMonitor node:c + append temp_arr handle_name + append i_node_arr node_ref + ) + all_handles = i_node_arr + list_node.items = temp_arr + ) + + on OPparams open do + ( + if all_handles.count != 0 do + ( + temp_arr = #() + for x in all_handles do + ( + print(x.node) + handle_name = node_to_name x.node + append temp_arr handle_name + ) + list_node.items = temp_arr + ) + ) + ) +)""" + class OpenPypeCreatorError(CreatorError): pass @@ -33,15 +87,25 @@ class MaxCreatorBase(object): return shared_data @staticmethod - def create_instance_node(node_name: str, parent: str = ""): - parent_node = rt.getNodeByName(parent) if parent else rt.rootScene - if not parent_node: - raise OpenPypeCreatorError(f"Specified parent {parent} not found") + def create_instance_node(node): + """Create instance node. - container = rt.container(name=node_name) - container.Parent = parent_node + If the supplied node is existing node, it will be used to hold the + instance, otherwise new node of type Dummy will be created. - return container + Args: + node (rt.MXSWrapperBase, str): Node or node name to use. + + Returns: + instance + """ + if isinstance(node, str): + node = rt.dummy(name=node) + + attrs = rt.execute(MS_CUSTOM_ATTRIB) + rt.custAttributes.add(node.baseObject, attrs) + + return node @six.add_metaclass(ABCMeta) @@ -60,8 +124,11 @@ class MaxCreator(Creator, MaxCreatorBase): instance_data, self ) - for node in self.selected_nodes: - node.Parent = instance_node + if pre_create_data.get("use_selection"): + print("adding selection") + print(rt.array(*self.selected_nodes)) + instance_node.openPypeData.all_nodes = rt.array( + *self.selected_nodes) self._add_instance_to_context(instance) imprint(instance_node.name, instance.data_to_store()) @@ -98,11 +165,11 @@ class MaxCreator(Creator, MaxCreatorBase): """ for instance in instances: - instance_node = rt.getNodeByName( - instance.data.get("instance_node")) - if instance_node: + if instance_node := rt.getNodeByName( + instance.data.get("instance_node") + ): rt.select(instance_node) - rt.execute(f'for o in selection do for c in o.children do c.parent = undefined') # noqa + rt.execute("for o in selection do for c in o.children do c.parent = undefined") # noqa rt.delete(instance_node) self._remove_instance_from_context(instance) From 63c7c1c2e9ed8002dff9f703852e2d9b53c08a6e Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 28 Apr 2023 12:43:34 +0200 Subject: [PATCH 036/207] :rotating_light: tabs to spaces --- openpype/hosts/max/api/plugin.py | 104 ++++++++++++++++--------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 213d6c04e0..15fcc89c5f 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -12,60 +12,61 @@ from openpype.pipeline import ( from openpype.lib import BoolDef from .lib import imprint, read, lsattr - MS_CUSTOM_ATTRIB = """attributes "openPypeData" ( - parameters main rollout:OPparams - ( - all_handles type:#maxObjectTab tabSize:0 tabSizeVariable:on - ) + parameters main rollout:OPparams + ( + all_handles type:#maxObjectTab tabSize:0 tabSizeVariable:on + ) - rollout OPparams "OP Parameters" - ( - listbox list_node "Node References" items:#() - button button_add "Add Selection" + rollout OPparams "OP Parameters" + ( + listbox list_node "Node References" items:#() + button button_add "Add Selection" - fn node_to_name the_node = - ( - handle = the_node.handle - obj_name = the_node.name - handle_name = obj_name + "<" + handle as string + ">" - return handle_name - ) + fn node_to_name the_node = + ( + handle = the_node.handle + obj_name = the_node.name + handle_name = obj_name + "<" + handle as string + ">" + return handle_name + ) - on button_add pressed do - ( - current_selection = selectByName title:"Select Objects To Add To Container" buttontext:"Add" - temp_arr = #() - i_node_arr = #() - for c in current_selection do - ( - handle_name = node_to_name c - node_ref = NodeTransformMonitor node:c - append temp_arr handle_name - append i_node_arr node_ref - ) - all_handles = i_node_arr - list_node.items = temp_arr - ) + on button_add pressed do + ( + current_selection = selectByName title:"Select Objects To Add To + Container" buttontext:"Add" + temp_arr = #() + i_node_arr = #() + for c in current_selection do + ( + handle_name = node_to_name c + node_ref = NodeTransformMonitor node:c + append temp_arr handle_name + append i_node_arr node_ref + ) + all_handles = i_node_arr + list_node.items = temp_arr + ) - on OPparams open do - ( - if all_handles.count != 0 do - ( - temp_arr = #() - for x in all_handles do - ( - print(x.node) - handle_name = node_to_name x.node - append temp_arr handle_name - ) - list_node.items = temp_arr - ) - ) - ) + on OPparams open do + ( + if all_handles.count != 0 do + ( + temp_arr = #() + for x in all_handles do + ( + print(x.node) + handle_name = node_to_name x.node + append temp_arr handle_name + ) + list_node.items = temp_arr + ) + ) + ) )""" + class OpenPypeCreatorError(CreatorError): pass @@ -83,7 +84,8 @@ class MaxCreatorBase(object): shared_data["max_cached_subsets"][creator_id] = [i.name] else: shared_data[ - "max_cached_subsets"][creator_id].append(i.name) # noqa + "max_cached_subsets"][creator_id].append( + i.name) # noqa return shared_data @staticmethod @@ -138,7 +140,7 @@ class MaxCreator(Creator, MaxCreatorBase): def collect_instances(self): self.cache_subsets(self.collection_shared_data) for instance in self.collection_shared_data[ - "max_cached_subsets"].get(self.identifier, []): + "max_cached_subsets"].get(self.identifier, []): created_instance = CreatedInstance.from_existing( read(rt.getNodeByName(instance)), self ) @@ -166,10 +168,12 @@ class MaxCreator(Creator, MaxCreatorBase): """ for instance in instances: if instance_node := rt.getNodeByName( - instance.data.get("instance_node") + instance.data.get("instance_node") ): rt.select(instance_node) - rt.execute("for o in selection do for c in o.children do c.parent = undefined") # noqa + rt.execute( + "for o in selection do for c in o.children do c.parent = " + "undefined") # noqa rt.delete(instance_node) self._remove_instance_from_context(instance) From 8e456f3f03ed2c976d2e959613b572a1360cbed3 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 2 May 2023 21:19:25 +0200 Subject: [PATCH 037/207] changing structure of colorspace schemas - removing `set_ocio_config` - removing (imageio) from category label - adding global switch to colorspace management - File rules label with ocio v1 compatibility --- .../schema_project_aftereffects.json | 9 ++------- .../projects_schema/schema_project_blender.json | 9 ++------- .../projects_schema/schema_project_celaction.json | 4 ++-- .../projects_schema/schema_project_flame.json | 6 +++--- .../projects_schema/schema_project_fusion.json | 9 ++------- .../projects_schema/schema_project_global.json | 14 ++++++++++++-- .../projects_schema/schema_project_harmony.json | 4 ++-- .../projects_schema/schema_project_hiero.json | 9 ++------- .../projects_schema/schema_project_houdini.json | 9 ++------- .../projects_schema/schema_project_max.json | 9 ++------- .../projects_schema/schema_project_maya.json | 9 ++------- .../projects_schema/schema_project_photoshop.json | 4 ++-- .../projects_schema/schema_project_resolve.json | 4 ++-- .../schema_project_traypublisher.json | 4 ++-- .../projects_schema/schema_project_tvpaint.json | 4 ++-- .../projects_schema/schema_project_unreal.json | 9 ++------- .../schema_project_webpublisher.json | 4 ++-- .../schemas/schema_imageio_file_rules.json | 4 ++-- .../schemas/schema_nuke_imageio.json | 9 ++------- 19 files changed, 49 insertions(+), 84 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 148c1840e5..d9007d6185 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index fe6ee94654..8997b750ec 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json index ab3acaf4a2..23268d0d9a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 5b96a49679..f18da95065 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", @@ -368,7 +368,7 @@ }, { "key": "colorspace_out", - "label": "Output color (imageio)", + "label": "Output color", "type": "text", "default": "linear" }, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index f97a3a3a40..b236925c1c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json index f200c1722f..80ea73267b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json @@ -8,9 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "is_group": true, "children": [ + { + "type": "boolean", + "key": "activate_global_color_management", + "label": "Enable Color Management" + }, { "key": "ocio_config", "type": "dict", @@ -29,9 +34,14 @@ { "key": "file_rules", "type": "dict", - "label": "File Rules", + "label": "File Rules (OCIO v1 only)", "collapsible": true, "children": [ + { + "type": "boolean", + "key": "activate_global_file_rules", + "label": "Enable File Rules" + }, { "key": "rules", "label": "Rules", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index 71f8cb4db2..840f1fa4c0 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index a46611dc8b..e7bd91dcef 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index d254b92269..1fb23759cb 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index 1141cefb40..bc632d4a20 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index b5366bb0a7..c69ccb3f07 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -48,19 +48,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json index 4431e3d95f..c4bb81e7f8 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json index 16de175933..ef1880af67 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index d3faf54ae1..a07c262375 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json index a0d94ad7dc..1c1d75c4e6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index 2dedadc6dd..10f562508a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -8,19 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index f596c89686..bb4287d4b4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -8,14 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" + "label": "Enable Color Management" }, { "type": "schema", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json index e76c8a326f..62b72c2518 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json @@ -1,13 +1,13 @@ { "key": "file_rules", "type": "dict", - "label": "File Rules", + "label": "File Rules (OCIO v1 only)", "collapsible": true, "children": [ { "type": "boolean", "key": "override_global_rules", - "label": "Override global file rules" + "label": "Override global File Rules" }, { "key": "rules", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index c69a4c4f4b..9eed442f25 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -1,19 +1,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management", "collapsible": true, "is_group": true, "children": [ { "type": "boolean", "key": "activate_host_color_management", - "label": "Enable Color Management in host" - }, - { - "type": "boolean", - "key": "set_ocio_config", - "label": "Set OCIO config file in host" + "label": "Enable Color Management" }, { "type": "schema", From bec1dd775d7be9b0d0051b2654288106ce527d6f Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 2 May 2023 21:20:39 +0200 Subject: [PATCH 038/207] adding default settings --- .../settings/defaults/project_settings/aftereffects.json | 1 - openpype/settings/defaults/project_settings/blender.json | 1 - openpype/settings/defaults/project_settings/fusion.json | 1 - openpype/settings/defaults/project_settings/global.json | 6 +++++- openpype/settings/defaults/project_settings/hiero.json | 1 - openpype/settings/defaults/project_settings/houdini.json | 1 - openpype/settings/defaults/project_settings/max.json | 5 ++--- openpype/settings/defaults/project_settings/maya.json | 1 - openpype/settings/defaults/project_settings/nuke.json | 5 ++--- openpype/settings/defaults/project_settings/unreal.json | 1 - 10 files changed, 9 insertions(+), 14 deletions(-) diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index c30356335b..74bd519bbd 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/blender.json b/openpype/settings/defaults/project_settings/blender.json index 1969cd8346..8328ceeda3 100644 --- a/openpype/settings/defaults/project_settings/blender.json +++ b/openpype/settings/defaults/project_settings/blender.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index ba2abd467f..a506f0c182 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index 3b7b29fe8b..dcc0fdb6b2 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -1,5 +1,6 @@ { "imageio": { + "activate_global_color_management": false, "ocio_config": { "filepath": [ "{OPENPYPE_ROOT}/vendor/bin/ocioconfig/OpenColorIOConfigs/aces_1.2/config.ocio", @@ -7,6 +8,7 @@ ] }, "file_rules": { + "activate_global_file_rules": false, "rules": { "example": { "pattern": ".*(beauty).*", @@ -250,7 +252,9 @@ } }, { - "families": ["review"], + "families": [ + "review" + ], "hosts": [ "maya", "houdini" diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index e876d1727d..01eb15bfbc 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index dd3fc87b80..2b7192ff99 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/max.json b/openpype/settings/defaults/project_settings/max.json index 89ba7a702d..e69b64f6cf 100644 --- a/openpype/settings/defaults/project_settings/max.json +++ b/openpype/settings/defaults/project_settings/max.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] @@ -17,8 +16,8 @@ "image_format": "exr", "multipass": true }, - "PointCloud":{ - "attribute":{ + "PointCloud": { + "attribute": { "Age": "age", "Radius": "radius", "Position": "position", diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index c1ec473654..a31dffe4c2 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -411,7 +411,6 @@ }, "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 119a240ad5..a1e2e5c15b 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -10,7 +10,6 @@ }, "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] @@ -355,12 +354,12 @@ "optional": true, "active": true }, - "ValidateGizmo": { + "ValidateBackdrop": { "enabled": true, "optional": true, "active": true }, - "ValidateBackdrop": { + "ValidateGizmo": { "enabled": true, "optional": true, "active": true diff --git a/openpype/settings/defaults/project_settings/unreal.json b/openpype/settings/defaults/project_settings/unreal.json index eace5a3542..72acf17b9e 100644 --- a/openpype/settings/defaults/project_settings/unreal.json +++ b/openpype/settings/defaults/project_settings/unreal.json @@ -1,7 +1,6 @@ { "imageio": { "activate_host_color_management": true, - "set_ocio_config": false, "ocio_config": { "override_global_config": false, "filepath": [] From c129a7885170ce395e2399e9ce598aae72b5ba12 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 2 May 2023 21:32:28 +0200 Subject: [PATCH 039/207] remove set_ocio_config from global hook also clear the checking function from colorspace.py --- openpype/hooks/pre_ocio_hook.py | 15 +-------------- openpype/pipeline/colorspace.py | 22 ---------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index bcff31fc93..49a042caa8 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -1,8 +1,7 @@ from openpype.lib import PreLaunchHook from openpype.pipeline.colorspace import ( - get_imageio_config, - is_set_ocio_config_activated + get_imageio_config ) from openpype.pipeline.template_data import get_template_data_with_names @@ -42,18 +41,6 @@ class OCIOEnvHook(PreLaunchHook): ) if config_data: - set_config_path = is_set_ocio_config_activated( - project_name=self.data["project_name"], - host_name=self.host_name, - project_settings=self.data["project_settings"] - ) - if not set_config_path: - self.log.info( - "Setting of OCIO environment with " - "config path was not activated..." - ) - return - ocio_path = config_data["path"] self.log.info( diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index a1714bc75e..627d93153c 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -393,28 +393,6 @@ def get_imageio_config( return config_data -def is_set_ocio_config_activated( - project_name, host_name, project_settings=None -): - """Check if host OCIO config path is activated - - Args: - project_name (str): project name - host_name (str): host name - - Returns: - bool: True if activated - """ - project_settings = project_settings or get_project_settings(project_name) - - # get colorspace settings - _, imageio_host = _get_imageio_settings( - project_settings, host_name) - - # check if host settings is having set_ocio_config - return imageio_host.get("set_ocio_config", False) - - def _get_config_data(path_list, anatomy_data): """Return first existing path in path list. From e290d70584c085c0b968ae27687044060e103e52 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 2 May 2023 21:33:48 +0200 Subject: [PATCH 040/207] recognize global colorspace management switch --- openpype/pipeline/colorspace.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 627d93153c..ec793cd48b 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -346,11 +346,26 @@ def get_imageio_config( formatting_data["platform"] = platform.system().lower() # get colorspace settings + # check if global settings group is having activate_global_color_management + # key at all. If it does't then default it to False + # this is for backward compatibility only + # TODO: in future rewrite this to be more explicit imageio_global, imageio_host = _get_imageio_settings( project_settings, host_name) + activate_color_management = imageio_global.get( + "activate_global_color_management", False) + + if not activate_color_management: + # if global settings are disabled return False because + # it is expected that no colorspace management is needed + log.info( + "Colorspace management is disabled." + ) + return {} + # check if host settings group is having activate_host_color_management - # it it does not have activation key then default it to True so it uses + # if it does not have activation key then default it to True so it uses # global settings # this is for backward compatibility # TODO: in future rewrite this to be more explicit From e7cf7c0fecb8ce73fcf586606af0a817a38ddbd8 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 2 May 2023 21:37:41 +0200 Subject: [PATCH 041/207] recognize global file rules switch --- openpype/pipeline/colorspace.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index ec793cd48b..652304ef33 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -357,7 +357,7 @@ def get_imageio_config( "activate_global_color_management", False) if not activate_color_management: - # if global settings are disabled return False because + # if global settings are disabled return empty dict because # it is expected that no colorspace management is needed log.info( "Colorspace management is disabled." @@ -477,6 +477,15 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): # get file rules from global and host_name frules_global = imageio_global["file_rules"] + activate_global_rules = frules_global.get( + "activate_global_file_rules", False) + + if not activate_global_rules: + log.info( + "Global File Rules are disabled." + ) + return {} + # host is optional, some might not have any settings frules_host = imageio_host.get("file_rules", {}) From 459a246948569451a16b00fecd4d1a2e8e9d5f6c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 3 May 2023 17:31:43 +0200 Subject: [PATCH 042/207] Adding labels to settings --- .../projects_schema/schema_project_aftereffects.json | 6 +++++- .../schemas/projects_schema/schema_project_blender.json | 6 +++++- .../schemas/projects_schema/schema_project_celaction.json | 6 +++++- .../schemas/projects_schema/schema_project_flame.json | 6 +++++- .../schemas/projects_schema/schema_project_fusion.json | 6 +++++- .../schemas/projects_schema/schema_project_global.json | 4 ++++ .../schemas/projects_schema/schema_project_harmony.json | 6 +++++- .../schemas/projects_schema/schema_project_hiero.json | 6 +++++- .../schemas/projects_schema/schema_project_houdini.json | 6 +++++- .../schemas/projects_schema/schema_project_max.json | 6 +++++- .../schemas/projects_schema/schema_project_maya.json | 6 +++++- .../schemas/projects_schema/schema_project_photoshop.json | 6 +++++- .../schemas/projects_schema/schema_project_resolve.json | 6 +++++- .../projects_schema/schema_project_traypublisher.json | 6 +++++- .../schemas/projects_schema/schema_project_tvpaint.json | 6 +++++- .../schemas/projects_schema/schema_project_unreal.json | 6 +++++- .../projects_schema/schema_project_webpublisher.json | 6 +++++- .../projects_schema/schemas/schema_nuke_imageio.json | 6 +++++- 18 files changed, 89 insertions(+), 17 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index d9007d6185..5da632a933 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index 8997b750ec..b15b508661 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json index 23268d0d9a..5729f70e2f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (derived to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index f18da95065..625780a650 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (remapped to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index b236925c1c..1e26e7d701 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json index 80ea73267b..d1d7f336e1 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json @@ -11,6 +11,10 @@ "label": "Color Management", "is_group": true, "children": [ + { + "type": "label", + "label": "It's important to note that once color management is activated on a project, all hosts will be color managed by default.
The OpenColorIO (OCIO) config file is used either from the global settings or from the host's overrides. It's worth
noting that the order of the defined configuration paths matters, with higher priority given to paths listed earlier in
the configuration list.

To avoid potential issues, ensure that the OCIO configuration path is not an absolute path and includes at least
the root token (Anatomy). This helps ensure that the configuration path remains valid across different environments and
avoids any hard-coding of paths that may be specific to one particular system." + }, { "type": "boolean", "key": "activate_global_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index 840f1fa4c0..0357a79aea 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index e7bd91dcef..8c6be5d6d8 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 1fb23759cb..d50ebd948f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index bc632d4a20..10a12dbecc 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index c69ccb3f07..49bd1002aa 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -48,10 +48,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json index c4bb81e7f8..898c3374d7 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (remapped to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json index ef1880af67..758cf2a196 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (remapped to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index a07c262375..c234cd1b71 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (derived to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json index 1c1d75c4e6..6d446b5550 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (derived to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index 10f562508a..2d0870f76a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index bb4287d4b4..e319182e3c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -8,10 +8,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (derived to OCIO)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + }, { "type": "boolean", "key": "activate_host_color_management", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index 9eed442f25..7aeb3d32db 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -1,10 +1,14 @@ { "key": "imageio", "type": "dict", - "label": "Color Management", + "label": "Color Management (OCIO managed)", "collapsible": true, "is_group": true, "children": [ + { + "type": "label", + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + }, { "type": "boolean", "key": "activate_host_color_management", From ca3b9f5e3042b4bf25bdcb0ec95815eba3e2a5fb Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 3 May 2023 18:48:41 +0200 Subject: [PATCH 043/207] :art: set references on modifier --- openpype/hosts/max/api/plugin.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 15fcc89c5f..52da23dc0a 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -102,7 +102,7 @@ class MaxCreatorBase(object): instance """ if isinstance(node, str): - node = rt.dummy(name=node) + node = rt.container(name=node) attrs = rt.execute(MS_CUSTOM_ATTRIB) rt.custAttributes.add(node.baseObject, attrs) @@ -127,10 +127,15 @@ class MaxCreator(Creator, MaxCreatorBase): self ) if pre_create_data.get("use_selection"): - print("adding selection") - print(rt.array(*self.selected_nodes)) - instance_node.openPypeData.all_nodes = rt.array( - *self.selected_nodes) + + node_list = [] + for i in self.selected_nodes: + node_ref = rt.NodeTransformMonitor(node=i) + node_list.append(node_ref) + + # Setting the property + rt.setProperty( + instance_node.openPypeData, "all_handles", node_list) self._add_instance_to_context(instance) imprint(instance_node.name, instance.data_to_store()) @@ -171,9 +176,7 @@ class MaxCreator(Creator, MaxCreatorBase): instance.data.get("instance_node") ): rt.select(instance_node) - rt.execute( - "for o in selection do for c in o.children do c.parent = " - "undefined") # noqa + rt.custAttributes.add(instance_node.baseObject, "openPypeData") rt.delete(instance_node) self._remove_instance_from_context(instance) From 37ce7fbc09fc1546dbc3ecc5620e5ba31d17b161 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 3 May 2023 18:49:04 +0200 Subject: [PATCH 044/207] :art: add members collector --- .../max/plugins/publish/collect_members.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 openpype/hosts/max/plugins/publish/collect_members.py diff --git a/openpype/hosts/max/plugins/publish/collect_members.py b/openpype/hosts/max/plugins/publish/collect_members.py new file mode 100644 index 0000000000..0b50ba0d8f --- /dev/null +++ b/openpype/hosts/max/plugins/publish/collect_members.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +"""Collect instance members""" +import pyblish.api +from pymxs import runtime as rt + + +class CollectMembers(pyblish.api.InstancePlugin): + """Collect Render for Deadline""" + + order = pyblish.api.CollectorOrder + 0.01 + label = "Collect Instance Members" + hosts = ['max'] + + def process(self, instance): + + if instance.data.get("instance_node"): + container = rt.GetNodeByName(instance.data["instance_node"]) + instance.data["members"] = [i.node for i in container.openPypeData.all_handles] From b52527b55f48babb3f677bb4534ecdeaf21fd9f6 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 3 May 2023 18:49:43 +0200 Subject: [PATCH 045/207] :recycle: switch the use to collected instance members --- .../max/plugins/publish/extract_camera_abc.py | 15 +- .../max/plugins/publish/extract_camera_fbx.py | 14 +- .../plugins/publish/extract_max_scene_raw.py | 14 +- .../max/plugins/publish/extract_model.py | 15 +- .../max/plugins/publish/extract_model_fbx.py | 15 +- .../max/plugins/publish/extract_model_obj.py | 15 +- .../max/plugins/publish/extract_model_usd.py | 43 ++--- .../max/plugins/publish/extract_pointcache.py | 14 +- .../max/plugins/publish/extract_pointcloud.py | 167 +++++++++++------- .../publish/validate_camera_contents.py | 22 +-- .../publish/validate_model_contents.py | 22 ++- .../publish/validate_no_max_content.py | 3 +- .../plugins/publish/validate_pointcloud.py | 128 ++++++-------- .../plugins/publish/validate_usd_plugin.py | 13 +- 14 files changed, 231 insertions(+), 269 deletions(-) diff --git a/openpype/hosts/max/plugins/publish/extract_camera_abc.py b/openpype/hosts/max/plugins/publish/extract_camera_abc.py index 8c23ff9878..b4f294fbf9 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_abc.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_abc.py @@ -6,8 +6,7 @@ from openpype.pipeline import ( ) from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -29,8 +28,6 @@ class ExtractCameraAlembic(publish.Extractor, start = float(instance.data.get("frameStartHandle", 1)) end = float(instance.data.get("frameEndHandle", 1)) - container = instance.data["instance_node"] - self.log.info("Extracting Camera ...") stagingdir = self.staging_dir(instance) @@ -38,8 +35,7 @@ class ExtractCameraAlembic(publish.Extractor, path = os.path.join(stagingdir, filename) # We run the render - self.log.info("Writing alembic '%s' to '%s'" % (filename, - stagingdir)) + self.log.info(f"Writing alembic '{filename}' to '{stagingdir}'") export_cmd = ( f""" @@ -57,8 +53,8 @@ exportFile @"{path}" #noPrompt selectedOnly:on using:AlembicExport with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(export_cmd) + rt.Select(instance.data["members"]) + rt.Execute(export_cmd) self.log.info("Performing Extraction ...") if "representations" not in instance.data: @@ -71,5 +67,4 @@ exportFile @"{path}" #noPrompt selectedOnly:on using:AlembicExport "stagingDir": stagingdir, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - path)) + self.log.info(f"Extracted instance '{instance.name}' to: {path}") diff --git a/openpype/hosts/max/plugins/publish/extract_camera_fbx.py b/openpype/hosts/max/plugins/publish/extract_camera_fbx.py index 7e92f355ed..ffbd281c67 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_fbx.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_fbx.py @@ -6,8 +6,7 @@ from openpype.pipeline import ( ) from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -26,15 +25,13 @@ class ExtractCameraFbx(publish.Extractor, def process(self, instance): if not self.is_active(instance.data): return - container = instance.data["instance_node"] self.log.info("Extracting Camera ...") stagingdir = self.staging_dir(instance) filename = "{name}.fbx".format(**instance.data) filepath = os.path.join(stagingdir, filename) - self.log.info("Writing fbx file '%s' to '%s'" % (filename, - filepath)) + self.log.info(f"Writing fbx file '{filename}' to '{filepath}'") # Need to export: # Animation = True @@ -57,8 +54,8 @@ exportFile @"{filepath}" #noPrompt selectedOnly:true using:FBXEXP with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(fbx_export_cmd) + rt.Select(instance.data["members"]) + rt.Execute(fbx_export_cmd) self.log.info("Performing Extraction ...") if "representations" not in instance.data: @@ -71,5 +68,4 @@ exportFile @"{filepath}" #noPrompt selectedOnly:true using:FBXEXP "stagingDir": stagingdir, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - filepath)) + self.log.info(f"Extracted instance '{instance.name}' to: {filepath}") diff --git a/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py b/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py index c14fcdbd0b..ed98922462 100644 --- a/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py +++ b/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py @@ -6,8 +6,7 @@ from openpype.pipeline import ( ) from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -28,7 +27,6 @@ class ExtractMaxSceneRaw(publish.Extractor, def process(self, instance): if not self.is_active(instance.data): return - container = instance.data["instance_node"] # publish the raw scene for camera self.log.info("Extracting Raw Max Scene ...") @@ -37,8 +35,7 @@ class ExtractMaxSceneRaw(publish.Extractor, filename = "{name}.max".format(**instance.data) max_path = os.path.join(stagingdir, filename) - self.log.info("Writing max file '%s' to '%s'" % (filename, - max_path)) + self.log.info(f"Writing max file '{filename}' to '{max_path}'") if "representations" not in instance.data: instance.data["representations"] = [] @@ -46,8 +43,8 @@ class ExtractMaxSceneRaw(publish.Extractor, # saving max scene with maintained_selection(): # need to figure out how to select the camera - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(f'saveNodes selection "{max_path}" quiet:true') + rt.Select(instance.data["members"]) + rt.Execute(f'saveNodes selection "{max_path}" quiet:true') self.log.info("Performing Extraction ...") @@ -58,5 +55,4 @@ class ExtractMaxSceneRaw(publish.Extractor, "stagingDir": stagingdir, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - max_path)) + self.log.info(f"Extracted instance '{instance.name}' to: {max_path}") diff --git a/openpype/hosts/max/plugins/publish/extract_model.py b/openpype/hosts/max/plugins/publish/extract_model.py index 710ad5f97d..d0f7bb0410 100644 --- a/openpype/hosts/max/plugins/publish/extract_model.py +++ b/openpype/hosts/max/plugins/publish/extract_model.py @@ -6,8 +6,7 @@ from openpype.pipeline import ( ) from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -27,8 +26,6 @@ class ExtractModel(publish.Extractor, if not self.is_active(instance.data): return - container = instance.data["instance_node"] - self.log.info("Extracting Geometry ...") stagingdir = self.staging_dir(instance) @@ -36,8 +33,7 @@ class ExtractModel(publish.Extractor, filepath = os.path.join(stagingdir, filename) # We run the render - self.log.info("Writing alembic '%s' to '%s'" % (filename, - stagingdir)) + self.log.info(f"Writing alembic '{filename}' to '{stagingdir}'") export_cmd = ( f""" @@ -56,8 +52,8 @@ exportFile @"{filepath}" #noPrompt selectedOnly:on using:AlembicExport with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(export_cmd) + rt.Select(instance.data["members"]) + rt.Execute(export_cmd) self.log.info("Performing Extraction ...") if "representations" not in instance.data: @@ -70,5 +66,4 @@ exportFile @"{filepath}" #noPrompt selectedOnly:on using:AlembicExport "stagingDir": stagingdir, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - filepath)) + self.log.info(f"Extracted instance '{instance.name}' to: {filepath}") diff --git a/openpype/hosts/max/plugins/publish/extract_model_fbx.py b/openpype/hosts/max/plugins/publish/extract_model_fbx.py index ce58e8cc17..696974a703 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_fbx.py +++ b/openpype/hosts/max/plugins/publish/extract_model_fbx.py @@ -6,8 +6,7 @@ from openpype.pipeline import ( ) from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -27,16 +26,13 @@ class ExtractModelFbx(publish.Extractor, if not self.is_active(instance.data): return - container = instance.data["instance_node"] - self.log.info("Extracting Geometry ...") stagingdir = self.staging_dir(instance) filename = "{name}.fbx".format(**instance.data) filepath = os.path.join(stagingdir, filename) - self.log.info("Writing FBX '%s' to '%s'" % (filepath, - stagingdir)) + self.log.info(f"Writing FBX '{filepath}' to '{stagingdir}'") export_fbx_cmd = ( f""" @@ -56,8 +52,8 @@ exportFile @"{filepath}" #noPrompt selectedOnly:true using:FBXEXP with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(export_fbx_cmd) + rt.Select(instance.data["members"]) + rt.Execute(export_fbx_cmd) self.log.info("Performing Extraction ...") if "representations" not in instance.data: @@ -70,5 +66,4 @@ exportFile @"{filepath}" #noPrompt selectedOnly:true using:FBXEXP "stagingDir": stagingdir, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - filepath)) + self.log.info(f"Extracted instance '{instance.name}' to: {filepath}") diff --git a/openpype/hosts/max/plugins/publish/extract_model_obj.py b/openpype/hosts/max/plugins/publish/extract_model_obj.py index 7bda237880..93896eea02 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_obj.py +++ b/openpype/hosts/max/plugins/publish/extract_model_obj.py @@ -6,8 +6,7 @@ from openpype.pipeline import ( ) from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -27,21 +26,18 @@ class ExtractModelObj(publish.Extractor, if not self.is_active(instance.data): return - container = instance.data["instance_node"] - self.log.info("Extracting Geometry ...") stagingdir = self.staging_dir(instance) filename = "{name}.obj".format(**instance.data) filepath = os.path.join(stagingdir, filename) - self.log.info("Writing OBJ '%s' to '%s'" % (filepath, - stagingdir)) + self.log.info(f"Writing OBJ '{filepath}' to '{stagingdir}'") with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(f'exportFile @"{filepath}" #noPrompt selectedOnly:true using:ObjExp') # noqa + rt.Select(instance.data["members"]) + rt.Execute(f'exportFile @"{filepath}" #noPrompt selectedOnly:true using:ObjExp') # noqa self.log.info("Performing Extraction ...") if "representations" not in instance.data: @@ -55,5 +51,4 @@ class ExtractModelObj(publish.Extractor, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - filepath)) + self.log.info(f"Extracted instance '{instance.name}' to: {filepath}") diff --git a/openpype/hosts/max/plugins/publish/extract_model_usd.py b/openpype/hosts/max/plugins/publish/extract_model_usd.py index 0bed2d855e..ae250cae5a 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_usd.py +++ b/openpype/hosts/max/plugins/publish/extract_model_usd.py @@ -26,31 +26,27 @@ class ExtractModelUSD(publish.Extractor, if not self.is_active(instance.data): return - container = instance.data["instance_node"] - self.log.info("Extracting Geometry ...") stagingdir = self.staging_dir(instance) asset_filename = "{name}.usda".format(**instance.data) asset_filepath = os.path.join(stagingdir, asset_filename) - self.log.info("Writing USD '%s' to '%s'" % (asset_filepath, - stagingdir)) + self.log.info(f"Writing USD '{asset_filepath}' to '{stagingdir}'") log_filename = "{name}.txt".format(**instance.data) log_filepath = os.path.join(stagingdir, log_filename) - self.log.info("Writing log '%s' to '%s'" % (log_filepath, - stagingdir)) + self.log.info(f"Writing log '{log_filepath}' to '{stagingdir}'") # get the nodes which need to be exported export_options = self.get_export_options(log_filepath) with maintained_selection(): # select and export - node_list = self.get_node_list(container) + node_list = instance.data["members"] rt.USDExporter.ExportFile(asset_filepath, exportOptions=export_options, - contentSource=rt.name("selected"), + contentSource=rt.Name("selected"), nodeList=node_list) self.log.info("Performing Extraction ...") @@ -73,25 +69,10 @@ class ExtractModelUSD(publish.Extractor, } instance.data["representations"].append(log_representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - asset_filepath)) + self.log.info(f"Extracted instance '{instance.name}' to: {asset_filepath}") - def get_node_list(self, container): - """ - Get the target nodes which are - the children of the container - """ - node_list = [] - - container_node = rt.getNodeByName(container) - target_node = container_node.Children - rt.select(target_node) - for sel in rt.selection: - node_list.append(sel) - - return node_list - - def get_export_options(self, log_path): + @staticmethod + def get_export_options(log_path): """Set Export Options for USD Exporter""" export_options = rt.USDExporter.createOptions() @@ -101,13 +82,13 @@ class ExtractModelUSD(publish.Extractor, export_options.Lights = False export_options.Cameras = False export_options.Materials = False - export_options.MeshFormat = rt.name('fromScene') - export_options.FileFormat = rt.name('ascii') - export_options.UpAxis = rt.name('y') - export_options.LogLevel = rt.name('info') + export_options.MeshFormat = rt.Name('fromScene') + export_options.FileFormat = rt.Name('ascii') + export_options.UpAxis = rt.Name('y') + export_options.LogLevel = rt.Name('info') export_options.LogPath = log_path export_options.PreserveEdgeOrientation = True - export_options.TimeMode = rt.name('current') + export_options.TimeMode = rt.Name('current') rt.USDexporter.UIOptions = export_options diff --git a/openpype/hosts/max/plugins/publish/extract_pointcache.py b/openpype/hosts/max/plugins/publish/extract_pointcache.py index 75d8a7972c..400d55d198 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcache.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcache.py @@ -42,8 +42,7 @@ import pyblish.api from openpype.pipeline import publish from pymxs import runtime as rt from openpype.hosts.max.api import ( - maintained_selection, - get_all_children + maintained_selection ) @@ -57,17 +56,14 @@ class ExtractAlembic(publish.Extractor): start = float(instance.data.get("frameStartHandle", 1)) end = float(instance.data.get("frameEndHandle", 1)) - container = instance.data["instance_node"] - self.log.info("Extracting pointcache ...") parent_dir = self.staging_dir(instance) file_name = "{name}.abc".format(**instance.data) path = os.path.join(parent_dir, file_name) - # We run the render - self.log.info("Writing alembic '%s' to '%s'" % (file_name, - parent_dir)) + self.log.info( + f"Writing alembic '{file_name}' to '{parent_dir}'") abc_export_cmd = ( f""" @@ -85,8 +81,8 @@ exportFile @"{path}" #noPrompt selectedOnly:on using:AlembicExport with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.execute(abc_export_cmd) + rt.Select(instance.data["members"]) + rt.Execute(abc_export_cmd) if "representations" not in instance.data: instance.data["representations"] = [] diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index e8d58ab713..5a85915967 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -9,13 +9,6 @@ from openpype.settings import get_project_settings from openpype.pipeline import legacy_io -def get_setting(project_setting=None): - project_setting = get_project_settings( - legacy_io.Session["AVALON_PROJECT"] - ) - return (project_setting["max"]["PointCloud"]) - - class ExtractPointCloud(publish.Extractor): """ Extract PRT format with tyFlow operators @@ -24,19 +17,20 @@ class ExtractPointCloud(publish.Extractor): Currently only works for the default partition setting Args: - export_particle(): sets up all job arguments for attributes - to be exported in MAXscript + self.export_particle(): sets up all job arguments for attributes + to be exported in MAXscript - get_operators(): get the export_particle operator + self.get_operators(): get the export_particle operator - get_custom_attr(): get all custom channel attributes from Openpype - setting and sets it as job arguments before exporting + self.get_custom_attr(): get all custom channel attributes from Openpype + setting and sets it as job arguments before exporting - get_files(): get the files with tyFlow naming convention - before publishing + self.get_files(): get the files with tyFlow naming convention + before publishing - partition_output_name(): get the naming with partition settings. - get_partition(): get partition value + self.partition_output_name(): get the naming with partition settings. + + self.get_partition(): get partition value """ @@ -46,6 +40,7 @@ class ExtractPointCloud(publish.Extractor): families = ["pointcloud"] def process(self, instance): + self.settings = self.get_setting(instance) start = int(instance.context.data.get("frameStart")) end = int(instance.context.data.get("frameEnd")) container = instance.data["instance_node"] @@ -56,12 +51,12 @@ class ExtractPointCloud(publish.Extractor): path = os.path.join(stagingdir, filename) with maintained_selection(): - job_args = self.export_particle(container, + job_args = self.export_particle(instance.data["members"], start, end, path) for job in job_args: - rt.execute(job) + rt.Execute(job) self.log.info("Performing Extraction ...") if "representations" not in instance.data: @@ -69,7 +64,7 @@ class ExtractPointCloud(publish.Extractor): self.log.info("Writing PRT with TyFlow Plugin...") filenames = self.get_files(container, path, start, end) - self.log.debug("filenames: {0}".format(filenames)) + self.log.debug(f"filenames: {filenames}") partition = self.partition_output_name(container) @@ -81,67 +76,87 @@ class ExtractPointCloud(publish.Extractor): "outputName": partition # partition value } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, - path)) + self.log.info(f"Extracted instance '{instance.name}' to: {path}") def export_particle(self, - container, + members, start, end, filepath): + """Sets up all job arguments for attributes. + + Those attributes are to be exported in MAX Script. + + Args: + members (list): Member nodes of the instance. + start (int): Start frame. + end (int): End frame. + filepath (str): Path to PRT file. + + Returns: + list of arguments for MAX Script. + + """ job_args = [] - opt_list = self.get_operators(container) + opt_list = self.get_operators(members) for operator in opt_list: - start_frame = "{0}.frameStart={1}".format(operator, - start) + start_frame = f"{operator}.frameStart={start}" job_args.append(start_frame) - end_frame = "{0}.frameEnd={1}".format(operator, - end) + end_frame = f"{operator}.frameEnd={end}" job_args.append(end_frame) filepath = filepath.replace("\\", "/") - prt_filename = '{0}.PRTFilename="{1}"'.format(operator, - filepath) + prt_filename = f"{operator}.PRTFilename={filepath}" job_args.append(prt_filename) # Partition - mode = "{0}.PRTPartitionsMode=2".format(operator) + mode = f"{operator}.PRTPartitionsMode=2" job_args.append(mode) additional_args = self.get_custom_attr(operator) - for args in additional_args: - job_args.append(args) - - prt_export = "{0}.exportPRT()".format(operator) + job_args.extend(iter(additional_args)) + prt_export = f"{operator}.exportPRT()" job_args.append(prt_export) return job_args - def get_operators(self, container): - """Get Export Particles Operator""" + @staticmethod + def get_operators(members): + """Get Export Particles Operator. + Args: + members (list): Instance members. + + Returns: + list of particle operators + + """ opt_list = [] - node = rt.getNodebyName(container) - selection_list = list(node.Children) - for sel in selection_list: - obj = sel.baseobject + for member in members: + obj = member.baseobject # TODO: to see if it can be used maxscript instead - anim_names = rt.getsubanimnames(obj) + anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: - sub_anim = rt.getsubanim(obj, anim_name) - boolean = rt.isProperty(sub_anim, "Export_Particles") - event_name = sub_anim.name + sub_anim = rt.GetSubAnim(obj, anim_name) + boolean = rt.IsProperty(sub_anim, "Export_Particles") if boolean: - opt = "${0}.{1}.export_particles".format(sel.name, - event_name) + event_name = sub_anim.Name + opt = f"${member.Name}.{event_name}.export_particles" opt_list.append(opt) return opt_list + @staticmethod + def get_setting(instance): + project_setting = get_project_settings( + instance.context.data["projectName"] + ) + return project_setting["max"]["PointCloud"] + def get_custom_attr(self, operator): """Get Custom Attributes""" custom_attr_list = [] - attr_settings = get_setting()["attribute"] + attr_settings = self.settings["attribute"] for key, value in attr_settings.items(): custom_attr = "{0}.PRTChannels_{1}=True".format(operator, value) @@ -157,14 +172,25 @@ class ExtractPointCloud(publish.Extractor): path, start_frame, end_frame): - """ - Note: - Set the filenames accordingly to the tyFlow file - naming extension for the publishing purpose + """Get file names for tyFlow. - Actual File Output from tyFlow: + Set the filenames accordingly to the tyFlow file + naming extension for the publishing purpose + + Actual File Output from tyFlow:: __partof..prt + e.g. tyFlow_cloth_CCCS_blobbyFill_001__part1of1_00004.prt + + Args: + container: Instance node. + path (str): Output directory. + start_frame (int): Start frame. + end_frame (int): End frame. + + Returns: + list of filenames + """ filenames = [] filename = os.path.basename(path) @@ -181,27 +207,36 @@ class ExtractPointCloud(publish.Extractor): return filenames def partition_output_name(self, container): - """ - Notes: - Partition output name set for mapping - the published file output + """Get partition output name. + + Partition output name set for mapping + the published file output. + + Todo: + Customizes the setting for the output. + + Args: + container: Instance node. + + Returns: + str: Partition name. - todo: - Customizes the setting for the output """ partition_count, partition_start = self.get_partition(container) - partition = "_part{:03}of{}".format(partition_start, - partition_count) - - return partition + return f"_part{partition_start:03}of{partition_count}" def get_partition(self, container): - """ - Get Partition Value + """Get Partition value. + + Args: + container: Instance node. + """ opt_list = self.get_operators(container) + # TODO: This looks strange? Iterating over + # the opt_list but returning from inside? for operator in opt_list: - count = rt.execute(f'{operator}.PRTPartitionsCount') - start = rt.execute(f'{operator}.PRTPartitionsFrom') + count = rt.Execute(f'{operator}.PRTPartitionsCount') + start = rt.Execute(f'{operator}.PRTPartitionsFrom') return count, start diff --git a/openpype/hosts/max/plugins/publish/validate_camera_contents.py b/openpype/hosts/max/plugins/publish/validate_camera_contents.py index c81e28a61f..a858092abd 100644 --- a/openpype/hosts/max/plugins/publish/validate_camera_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_camera_contents.py @@ -18,30 +18,24 @@ class ValidateCameraContent(pyblish.api.InstancePlugin): "$Physical_Camera", "$Target"] def process(self, instance): - invalid = self.get_invalid(instance) - if invalid: - raise PublishValidationError("Camera instance must only include" - "camera (and camera target)") + if invalid := self.get_invalid(instance): + raise PublishValidationError(("Camera instance must only include" + "camera (and camera target). " + f"Invalid content {invalid}")) def get_invalid(self, instance): """ Get invalid nodes if the instance is not camera """ - invalid = list() + invalid = [] container = instance.data["instance_node"] - self.log.info("Validating look content for " - "{}".format(container)) + self.log.info(f"Validating camera content for {container}") - con = rt.getNodeByName(container) - selection_list = list(con.Children) + selection_list = instance.data["members"] for sel in selection_list: # to avoid Attribute Error from pymxs wrapper sel_tmp = str(sel) - found = False - for cam in self.camera_type: - if sel_tmp.startswith(cam): - found = True - break + found = any(sel_tmp.startswith(cam) for cam in self.camera_type) if not found: self.log.error("Camera not found") invalid.append(sel) diff --git a/openpype/hosts/max/plugins/publish/validate_model_contents.py b/openpype/hosts/max/plugins/publish/validate_model_contents.py index dd782674ff..b21c0184b0 100644 --- a/openpype/hosts/max/plugins/publish/validate_model_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_model_contents.py @@ -17,28 +17,26 @@ class ValidateModelContent(pyblish.api.InstancePlugin): label = "Model Contents" def process(self, instance): - invalid = self.get_invalid(instance) - if invalid: - raise PublishValidationError("Model instance must only include" - "Geometry and Editable Mesh") + if invalid := self.get_invalid(instance): + raise PublishValidationError(("Model instance must only include" + "Geometry and Editable Mesh. " + f"Invalid types on: {invalid}")) def get_invalid(self, instance): """ Get invalid nodes if the instance is not camera """ - invalid = list() + invalid = [] container = instance.data["instance_node"] - self.log.info("Validating look content for " - "{}".format(container)) + self.log.info(f"Validating model content for {container}") - con = rt.getNodeByName(container) - selection_list = list(con.Children) or rt.getCurrentSelection() + selection_list = instance.data["members"] for sel in selection_list: - if rt.classOf(sel) in rt.Camera.classes: + if rt.ClassOf(sel) in rt.Camera.classes: invalid.append(sel) - if rt.classOf(sel) in rt.Light.classes: + if rt.ClassOf(sel) in rt.Light.classes: invalid.append(sel) - if rt.classOf(sel) in rt.Shape.classes: + if rt.ClassOf(sel) in rt.Shape.classes: invalid.append(sel) return invalid diff --git a/openpype/hosts/max/plugins/publish/validate_no_max_content.py b/openpype/hosts/max/plugins/publish/validate_no_max_content.py index c20a1968ed..ba4a6882c2 100644 --- a/openpype/hosts/max/plugins/publish/validate_no_max_content.py +++ b/openpype/hosts/max/plugins/publish/validate_no_max_content.py @@ -18,6 +18,5 @@ class ValidateMaxContents(pyblish.api.InstancePlugin): label = "Max Scene Contents" def process(self, instance): - container = rt.getNodeByName(instance.data["instance_node"]) - if not list(container.Children): + if not instance.data["members"]: raise PublishValidationError("No content found in the container") diff --git a/openpype/hosts/max/plugins/publish/validate_pointcloud.py b/openpype/hosts/max/plugins/publish/validate_pointcloud.py index f654058648..38d8226e41 100644 --- a/openpype/hosts/max/plugins/publish/validate_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/validate_pointcloud.py @@ -9,11 +9,11 @@ def get_setting(project_setting=None): project_setting = get_project_settings( legacy_io.Session["AVALON_PROJECT"] ) - return (project_setting["max"]["PointCloud"]) + return project_setting["max"]["PointCloud"] class ValidatePointCloud(pyblish.api.InstancePlugin): - """Validate that workfile was saved.""" + """Validate that work file was saved.""" order = pyblish.api.ValidatorOrder families = ["pointcloud"] @@ -34,39 +34,37 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): of export_particle operator """ - invalid = self.get_tyFlow_object(instance) - if invalid: - raise PublishValidationError("Non tyFlow object " - "found: {}".format(invalid)) - invalid = self.get_tyFlow_operator(instance) - if invalid: - raise PublishValidationError("tyFlow ExportParticle operator " - "not found: {}".format(invalid)) + report = [] + if invalid := self.get_tyflow_object(instance): + report.append(f"Non tyFlow object found: {invalid}") - invalid = self.validate_export_mode(instance) - if invalid: - raise PublishValidationError("The export mode is not at PRT") + if invalid := self.get_tyflow_operator(instance): + report.append( + f"tyFlow ExportParticle operator not found: {invalid}") - invalid = self.validate_partition_value(instance) - if invalid: - raise PublishValidationError("tyFlow Partition setting is " - "not at the default value") - invalid = self.validate_custom_attribute(instance) - if invalid: - raise PublishValidationError("Custom Attribute not found " - ":{}".format(invalid)) + if self.validate_export_mode(instance): + report.append("The export mode is not at PRT") - def get_tyFlow_object(self, instance): + if self.validate_partition_value(instance): + report.append(("tyFlow Partition setting is " + "not at the default value")) + + if invalid := self.validate_custom_attribute(instance): + report.append(("Custom Attribute not found " + f":{invalid}")) + + if report: + raise PublishValidationError + + def get_tyflow_object(self, instance): invalid = [] container = instance.data["instance_node"] - self.log.info("Validating tyFlow container " - "for {}".format(container)) + self.log.info(f"Validating tyFlow container for {container}") - con = rt.getNodeByName(container) - selection_list = list(con.Children) + selection_list = instance.data["members"] for sel in selection_list: sel_tmp = str(sel) - if rt.classOf(sel) in [rt.tyFlow, + if rt.ClassOf(sel) in [rt.tyFlow, rt.Editable_Mesh]: if "tyFlow" not in sel_tmp: invalid.append(sel) @@ -75,23 +73,20 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): return invalid - def get_tyFlow_operator(self, instance): + def get_tyflow_operator(self, instance): invalid = [] container = instance.data["instance_node"] - self.log.info("Validating tyFlow object " - "for {}".format(container)) - - con = rt.getNodeByName(container) - selection_list = list(con.Children) + self.log.info(f"Validating tyFlow object for {container}") + selection_list = instance.data["members"] bool_list = [] for sel in selection_list: obj = sel.baseobject - anim_names = rt.getsubanimnames(obj) + anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: # get all the names of the related tyFlow nodes - sub_anim = rt.getsubanim(obj, anim_name) + sub_anim = rt.GetSubAnim(obj, anim_name) # check if there is export particle operator - boolean = rt.isProperty(sub_anim, "Export_Particles") + boolean = rt.IsProperty(sub_anim, "Export_Particles") bool_list.append(str(boolean)) # if the export_particles property is not there # it means there is not a "Export Particle" operator @@ -104,21 +99,18 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): def validate_custom_attribute(self, instance): invalid = [] container = instance.data["instance_node"] - self.log.info("Validating tyFlow custom " - "attributes for {}".format(container)) + self.log.info( + f"Validating tyFlow custom attributes for {container}") - con = rt.getNodeByName(container) - selection_list = list(con.Children) + selection_list = instance.data["members"] for sel in selection_list: obj = sel.baseobject - anim_names = rt.getsubanimnames(obj) + anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: # get all the names of the related tyFlow nodes - sub_anim = rt.getsubanim(obj, anim_name) - # check if there is export particle operator - boolean = rt.isProperty(sub_anim, "Export_Particles") - event_name = sub_anim.name - if boolean: + sub_anim = rt.GetSubAnim(obj, anim_name) + if rt.IsProperty(sub_anim, "Export_Particles"): + event_name = sub_anim.name opt = "${0}.{1}.export_particles".format(sel.name, event_name) attributes = get_setting()["attribute"] @@ -126,39 +118,36 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): custom_attr = "{0}.PRTChannels_{1}".format(opt, value) try: - rt.execute(custom_attr) + rt.Execute(custom_attr) except RuntimeError: - invalid.add(key) + invalid.append(key) return invalid def validate_partition_value(self, instance): invalid = [] container = instance.data["instance_node"] - self.log.info("Validating tyFlow partition " - "value for {}".format(container)) + self.log.info( + f"Validating tyFlow partition value for {container}") - con = rt.getNodeByName(container) - selection_list = list(con.Children) + selection_list = instance.data["members"] for sel in selection_list: obj = sel.baseobject - anim_names = rt.getsubanimnames(obj) + anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: # get all the names of the related tyFlow nodes - sub_anim = rt.getsubanim(obj, anim_name) - # check if there is export particle operator - boolean = rt.isProperty(sub_anim, "Export_Particles") - event_name = sub_anim.name - if boolean: + sub_anim = rt.GetSubAnim(obj, anim_name) + if rt.IsProperty(sub_anim, "Export_Particles"): + event_name = sub_anim.name opt = "${0}.{1}.export_particles".format(sel.name, event_name) - count = rt.execute(f'{opt}.PRTPartitionsCount') + count = rt.Execute(f'{opt}.PRTPartitionsCount') if count != 100: invalid.append(count) - start = rt.execute(f'{opt}.PRTPartitionsFrom') + start = rt.Execute(f'{opt}.PRTPartitionsFrom') if start != 1: invalid.append(start) - end = rt.execute(f'{opt}.PRTPartitionsTo') + end = rt.Execute(f'{opt}.PRTPartitionsTo') if end != 1: invalid.append(end) @@ -167,24 +156,23 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): def validate_export_mode(self, instance): invalid = [] container = instance.data["instance_node"] - self.log.info("Validating tyFlow export " - "mode for {}".format(container)) + self.log.info( + f"Validating tyFlow export mode for {container}") - con = rt.getNodeByName(container) + con = rt.GetNodeByName(container) selection_list = list(con.Children) for sel in selection_list: obj = sel.baseobject - anim_names = rt.getsubanimnames(obj) + anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: # get all the names of the related tyFlow nodes - sub_anim = rt.getsubanim(obj, anim_name) + sub_anim = rt.GetSubAnim(obj, anim_name) # check if there is export particle operator - boolean = rt.isProperty(sub_anim, "Export_Particles") + boolean = rt.IsProperty(sub_anim, "Export_Particles") event_name = sub_anim.name if boolean: - opt = "${0}.{1}.export_particles".format(sel.name, - event_name) - export_mode = rt.execute(f'{opt}.exportMode') + opt = f"${sel.name}.{event_name}.export_particles" + export_mode = rt.Execute(f'{opt}.exportMode') if export_mode != 1: invalid.append(export_mode) diff --git a/openpype/hosts/max/plugins/publish/validate_usd_plugin.py b/openpype/hosts/max/plugins/publish/validate_usd_plugin.py index 747147020a..8f11d72567 100644 --- a/openpype/hosts/max/plugins/publish/validate_usd_plugin.py +++ b/openpype/hosts/max/plugins/publish/validate_usd_plugin.py @@ -14,21 +14,20 @@ class ValidateUSDPlugin(pyblish.api.InstancePlugin): label = "USD Plugin" def process(self, instance): - plugin_mgr = rt.pluginManager + plugin_mgr = rt.PluginManager plugin_count = plugin_mgr.pluginDllCount plugin_info = self.get_plugins(plugin_mgr, plugin_count) usd_import = "usdimport.dli" if usd_import not in plugin_info: - raise PublishValidationError("USD Plugin {}" - " not found".format(usd_import)) + raise PublishValidationError(f"USD Plugin {usd_import} not found") usd_export = "usdexport.dle" if usd_export not in plugin_info: - raise PublishValidationError("USD Plugin {}" - " not found".format(usd_export)) + raise PublishValidationError(f"USD Plugin {usd_export} not found") - def get_plugins(self, manager, count): - plugin_info_list = list() + @staticmethod + def get_plugins(manager, count): + plugin_info_list = [] for p in range(1, count + 1): plugin_info = manager.pluginDllName(p) plugin_info_list.append(plugin_info) From 7a0f18e27849b3a67db57f1af4905d58044488fe Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 3 May 2023 18:50:30 +0200 Subject: [PATCH 046/207] :rotating_light: Fix type case to match Python API --- openpype/hosts/max/api/lib.py | 38 +++++++++----------- openpype/hosts/max/api/lib_renderproducts.py | 4 +-- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/openpype/hosts/max/api/lib.py b/openpype/hosts/max/api/lib.py index ad9a450cad..572d99c1cd 100644 --- a/openpype/hosts/max/api/lib.py +++ b/openpype/hosts/max/api/lib.py @@ -3,7 +3,7 @@ import json import six from pymxs import runtime as rt -from typing import Union +from typing import Union, Any, Dict import contextlib from openpype.pipeline.context_tools import ( @@ -16,15 +16,15 @@ JSON_PREFIX = "JSON::" def imprint(node_name: str, data: dict) -> bool: - node = rt.getNodeByName(node_name) + node = rt.GetNodeByName(node_name) if not node: return False for k, v in data.items(): if isinstance(v, (dict, list)): - rt.setUserProp(node, k, f'{JSON_PREFIX}{json.dumps(v)}') + rt.SetUserProp(node, k, f'{JSON_PREFIX}{json.dumps(v)}') else: - rt.setUserProp(node, k, v) + rt.SetUserProp(node, k, v) return True @@ -44,7 +44,7 @@ def lsattr( Returns: list of nodes. """ - root = rt.rootnode if root is None else rt.getNodeByName(root) + root = rt.RootNode if root is None else rt.GetNodeByName(root) def output_node(node, nodes): nodes.append(node) @@ -55,16 +55,16 @@ def lsattr( output_node(root, nodes) return [ n for n in nodes - if rt.getUserProp(n, attr) == value + if rt.GetUserProp(n, attr) == value ] if value else [ n for n in nodes - if rt.getUserProp(n, attr) + if rt.GetUserProp(n, attr) ] def read(container) -> dict: data = {} - props = rt.getUserPropBuffer(container) + props = rt.GetUserPropBuffer(container) # this shouldn't happen but let's guard against it anyway if not props: return data @@ -79,29 +79,25 @@ def read(container) -> dict: value = value.strip() if isinstance(value.strip(), six.string_types) and \ value.startswith(JSON_PREFIX): - try: + with contextlib.suppress(json.JSONDecodeError): value = json.loads(value[len(JSON_PREFIX):]) - except json.JSONDecodeError: - # not a json - pass - data[key.strip()] = value - data["instance_node"] = container.name + data["instance_node"] = container.Name return data @contextlib.contextmanager def maintained_selection(): - previous_selection = rt.getCurrentSelection() + previous_selection = rt.GetCurrentSelection() try: yield finally: if previous_selection: - rt.select(previous_selection) + rt.Select(previous_selection) else: - rt.select() + rt.Select() def get_all_children(parent, node_type=None): @@ -123,7 +119,7 @@ def get_all_children(parent, node_type=None): return children child_list = list_children(parent) - return ([x for x in child_list if rt.superClassOf(x) == node_type] + return ([x for x in child_list if rt.SuperClassOf(x) == node_type] if node_type else child_list) @@ -199,7 +195,7 @@ def reset_scene_resolution(): set_scene_resolution(width, height) -def get_frame_range() -> dict: +def get_frame_range() -> Union[Dict[str, Any], None]: """Get the current assets frame range and handles. Returns: @@ -242,7 +238,7 @@ def reset_frame_range(fps: bool = True): frame_start = frame_range["frameStart"] - int(frame_range["handleStart"]) frame_end = frame_range["frameEnd"] + int(frame_range["handleEnd"]) frange_cmd = f"animationRange = interval {frame_start} {frame_end}" - rt.execute(frange_cmd) + rt.Execute(frange_cmd) def set_context_setting(): @@ -270,5 +266,5 @@ def get_max_version(): #(25000, 62, 0, 25, 0, 0, 997, 2023, "") max_info[7] = max version date """ - max_info = rt.maxversion() + max_info = rt.MaxVersion() return max_info[7] diff --git a/openpype/hosts/max/api/lib_renderproducts.py b/openpype/hosts/max/api/lib_renderproducts.py index 350eb97661..e42686020a 100644 --- a/openpype/hosts/max/api/lib_renderproducts.py +++ b/openpype/hosts/max/api/lib_renderproducts.py @@ -91,7 +91,7 @@ class RenderProducts(object): """Get all the Arnold AOVs""" aovs = [] - amw = rt.MaxtoAOps.AOVsManagerWindow() + amw = rt.MaxToAOps.AOVsManagerWindow() aov_mgr = rt.renderers.current.AOVManager # Check if there is any aov group set in AOV manager aov_group_num = len(aov_mgr.drivers) @@ -114,7 +114,7 @@ class RenderProducts(object): """Get all the render element output files. """ render_dirname = [] - render_elem = rt.maxOps.GetCurRenderElementMgr() + render_elem = rt.MaxOps.GetCurRenderElementMgr() render_elem_num = render_elem.NumRenderElements() # get render elements from the renders for i in range(render_elem_num): From 6d84969457f930e4020633ab6ecfbfcf47d22afc Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 3 May 2023 19:06:22 +0200 Subject: [PATCH 047/207] :rotating_light: fix Hound :dog: --- openpype/hosts/max/api/plugin.py | 13 +++++-------- .../hosts/max/plugins/publish/collect_members.py | 4 +++- .../hosts/max/plugins/publish/extract_model_usd.py | 3 ++- .../max/plugins/publish/validate_camera_contents.py | 2 +- .../max/plugins/publish/validate_model_contents.py | 2 +- .../max/plugins/publish/validate_pointcloud.py | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 52da23dc0a..39a17c29ef 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -144,10 +144,9 @@ class MaxCreator(Creator, MaxCreatorBase): def collect_instances(self): self.cache_subsets(self.collection_shared_data) - for instance in self.collection_shared_data[ - "max_cached_subsets"].get(self.identifier, []): + for instance in self.collection_shared_data["max_cached_subsets"].get(self.identifier, []): # noqa created_instance = CreatedInstance.from_existing( - read(rt.getNodeByName(instance)), self + read(rt.GetNodeByName(instance)), self ) self._add_instance_to_context(created_instance) @@ -172,12 +171,10 @@ class MaxCreator(Creator, MaxCreatorBase): """ for instance in instances: - if instance_node := rt.getNodeByName( - instance.data.get("instance_node") - ): - rt.select(instance_node) + if instance_node := rt.GetNodeByName(instance.data.get("instance_node")): # noqa + rt.Select(instance_node) rt.custAttributes.add(instance_node.baseObject, "openPypeData") - rt.delete(instance_node) + rt.Delete(instance_node) self._remove_instance_from_context(instance) diff --git a/openpype/hosts/max/plugins/publish/collect_members.py b/openpype/hosts/max/plugins/publish/collect_members.py index 0b50ba0d8f..4ceb6cdadf 100644 --- a/openpype/hosts/max/plugins/publish/collect_members.py +++ b/openpype/hosts/max/plugins/publish/collect_members.py @@ -15,4 +15,6 @@ class CollectMembers(pyblish.api.InstancePlugin): if instance.data.get("instance_node"): container = rt.GetNodeByName(instance.data["instance_node"]) - instance.data["members"] = [i.node for i in container.openPypeData.all_handles] + instance.data["members"] = [ + i.node for i in container.openPypeData.all_handles + ] diff --git a/openpype/hosts/max/plugins/publish/extract_model_usd.py b/openpype/hosts/max/plugins/publish/extract_model_usd.py index ae250cae5a..df1e7a4f02 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_usd.py +++ b/openpype/hosts/max/plugins/publish/extract_model_usd.py @@ -69,7 +69,8 @@ class ExtractModelUSD(publish.Extractor, } instance.data["representations"].append(log_representation) - self.log.info(f"Extracted instance '{instance.name}' to: {asset_filepath}") + self.log.info( + f"Extracted instance '{instance.name}' to: {asset_filepath}") @staticmethod def get_export_options(log_path): diff --git a/openpype/hosts/max/plugins/publish/validate_camera_contents.py b/openpype/hosts/max/plugins/publish/validate_camera_contents.py index a858092abd..85be5d59fa 100644 --- a/openpype/hosts/max/plugins/publish/validate_camera_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_camera_contents.py @@ -18,7 +18,7 @@ class ValidateCameraContent(pyblish.api.InstancePlugin): "$Physical_Camera", "$Target"] def process(self, instance): - if invalid := self.get_invalid(instance): + if invalid := self.get_invalid(instance): # noqa raise PublishValidationError(("Camera instance must only include" "camera (and camera target). " f"Invalid content {invalid}")) diff --git a/openpype/hosts/max/plugins/publish/validate_model_contents.py b/openpype/hosts/max/plugins/publish/validate_model_contents.py index b21c0184b0..1d834292b8 100644 --- a/openpype/hosts/max/plugins/publish/validate_model_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_model_contents.py @@ -17,7 +17,7 @@ class ValidateModelContent(pyblish.api.InstancePlugin): label = "Model Contents" def process(self, instance): - if invalid := self.get_invalid(instance): + if invalid := self.get_invalid(instance): # noqa raise PublishValidationError(("Model instance must only include" "Geometry and Editable Mesh. " f"Invalid types on: {invalid}")) diff --git a/openpype/hosts/max/plugins/publish/validate_pointcloud.py b/openpype/hosts/max/plugins/publish/validate_pointcloud.py index 38d8226e41..e3a6face07 100644 --- a/openpype/hosts/max/plugins/publish/validate_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/validate_pointcloud.py @@ -35,10 +35,10 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): """ report = [] - if invalid := self.get_tyflow_object(instance): + if invalid := self.get_tyflow_object(instance): # noqa report.append(f"Non tyFlow object found: {invalid}") - if invalid := self.get_tyflow_operator(instance): + if invalid := self.get_tyflow_operator(instance): # noqa report.append( f"tyFlow ExportParticle operator not found: {invalid}") @@ -49,7 +49,7 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): report.append(("tyFlow Partition setting is " "not at the default value")) - if invalid := self.validate_custom_attribute(instance): + if invalid := self.validate_custom_attribute(instance): # noqa report.append(("Custom Attribute not found " f":{invalid}")) From eb6f8c1abb68dc42d03635907e163b4a5da8833b Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 3 May 2023 22:29:36 +0200 Subject: [PATCH 048/207] fixing typo --- .../schemas/projects_schema/schema_project_aftereffects.json | 2 +- .../schemas/projects_schema/schema_project_blender.json | 2 +- .../entities/schemas/projects_schema/schema_project_fusion.json | 2 +- .../schemas/projects_schema/schema_project_harmony.json | 2 +- .../entities/schemas/projects_schema/schema_project_hiero.json | 2 +- .../schemas/projects_schema/schema_project_houdini.json | 2 +- .../entities/schemas/projects_schema/schema_project_max.json | 2 +- .../entities/schemas/projects_schema/schema_project_maya.json | 2 +- .../entities/schemas/projects_schema/schema_project_unreal.json | 2 +- .../schemas/projects_schema/schemas/schema_nuke_imageio.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 5da632a933..ef09a71bda 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index b15b508661..c3eab6c3f0 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index 1e26e7d701..6189da0e19 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index 0357a79aea..a56f62c6d6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index 8c6be5d6d8..2c82e1a9ac 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index d50ebd948f..588e209718 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index 10a12dbecc..5dac8ee7e9 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index 49bd1002aa..55f231e235 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -54,7 +54,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index 2d0870f76a..8c3ff71489 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index 7aeb3d32db..f691518255 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -7,7 +7,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) confg path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." }, { "type": "boolean", From 1ec0b2aeac3ab160b96d02706177ccab016c29ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 4 May 2023 11:29:28 +0200 Subject: [PATCH 049/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 5a85915967..1387d47563 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -132,7 +132,10 @@ class ExtractPointCloud(publish.Extractor): """ opt_list = [] for member in members: - obj = member.baseobject + node = rt.getNodeByName(member) + selection_list = list(node.Children) + for sel in selection_list: + obj = sel.baseobject # TODO: to see if it can be used maxscript instead anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: From 5ced9885b1a79ccb8ad068366b186681304dc781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 4 May 2023 11:29:36 +0200 Subject: [PATCH 050/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 1387d47563..11fcdaaa38 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -137,7 +137,7 @@ class ExtractPointCloud(publish.Extractor): for sel in selection_list: obj = sel.baseobject # TODO: to see if it can be used maxscript instead - anim_names = rt.GetSubAnimNames(obj) + anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: sub_anim = rt.GetSubAnim(obj, anim_name) boolean = rt.IsProperty(sub_anim, "Export_Particles") From 4193b3c277992d6686a3f4fc009465b684a8a2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 4 May 2023 11:29:51 +0200 Subject: [PATCH 051/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 11fcdaaa38..2063514455 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -138,7 +138,7 @@ class ExtractPointCloud(publish.Extractor): obj = sel.baseobject # TODO: to see if it can be used maxscript instead anim_names = rt.GetSubAnimNames(obj) - for anim_name in anim_names: + for anim_name in anim_names: sub_anim = rt.GetSubAnim(obj, anim_name) boolean = rt.IsProperty(sub_anim, "Export_Particles") if boolean: From 0065dc1056b8e5f548a18297b9f6858c06736d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 4 May 2023 11:29:58 +0200 Subject: [PATCH 052/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 2063514455..97f0b32eca 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -139,8 +139,8 @@ class ExtractPointCloud(publish.Extractor): # TODO: to see if it can be used maxscript instead anim_names = rt.GetSubAnimNames(obj) for anim_name in anim_names: - sub_anim = rt.GetSubAnim(obj, anim_name) - boolean = rt.IsProperty(sub_anim, "Export_Particles") + sub_anim = rt.GetSubAnim(obj, anim_name) + boolean = rt.IsProperty(sub_anim, "Export_Particles") if boolean: event_name = sub_anim.Name opt = f"${member.Name}.{event_name}.export_particles" From 6923f692057511ef7de985aecce37156e72de50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 4 May 2023 11:30:08 +0200 Subject: [PATCH 053/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 97f0b32eca..c04eef6604 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -141,7 +141,7 @@ class ExtractPointCloud(publish.Extractor): for anim_name in anim_names: sub_anim = rt.GetSubAnim(obj, anim_name) boolean = rt.IsProperty(sub_anim, "Export_Particles") - if boolean: + if boolean: event_name = sub_anim.Name opt = f"${member.Name}.{event_name}.export_particles" opt_list.append(opt) From 774672a0063e2ba3edd2f2e26492a6607169ce46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 4 May 2023 11:30:17 +0200 Subject: [PATCH 054/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index c04eef6604..74265da7fb 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -43,7 +43,6 @@ class ExtractPointCloud(publish.Extractor): self.settings = self.get_setting(instance) start = int(instance.context.data.get("frameStart")) end = int(instance.context.data.get("frameEnd")) - container = instance.data["instance_node"] self.log.info("Extracting PRT...") stagingdir = self.staging_dir(instance) From 8d78288ccd3f3783c228eed131936d845ee0e333 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 11:49:38 +0200 Subject: [PATCH 055/207] :heavy_plus_sign: bump hound flake8 version --- .hound.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.hound.yml b/.hound.yml index df9cdab64a..4e749ac2d8 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,3 +1,4 @@ flake8: + version: 6.0.0 enabled: true config_file: setup.cfg From fec92a6c34f9e25b01a8d0094b9f90f0080f8e9c Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 11:49:38 +0200 Subject: [PATCH 056/207] Revert ":heavy_plus_sign: bump hound flake8 version" This reverts commit 8d78288ccd3f3783c228eed131936d845ee0e333. --- .hound.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.hound.yml b/.hound.yml index 4e749ac2d8..df9cdab64a 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,4 +1,3 @@ flake8: - version: 6.0.0 enabled: true config_file: setup.cfg From 49f9822b3fb0bda3dcbf8a7352b2133b361a6f41 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 12:19:49 +0200 Subject: [PATCH 057/207] :recycle: try another linter --- .github/workflows/linting_pr.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/linting_pr.yml diff --git a/.github/workflows/linting_pr.yml b/.github/workflows/linting_pr.yml new file mode 100644 index 0000000000..8cc822df6e --- /dev/null +++ b/.github/workflows/linting_pr.yml @@ -0,0 +1,36 @@ +name: 📇 Linting PR + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + linting: + runs-on: ubuntu-latest + steps: + - name: Black + uses: microsoft/action-python@0.6.3 + with: + black: false + + - name: Bandit + uses: microsoft/action-python@0.6.3 + with: + bandit: true + + - name: Pylint + uses: microsoft/action-python@0.6.3 + with: + pylint: true + + - name: Pyright + uses: microsoft/action-python@0.6.3 + with: + pyright: true + + - name: Flake8 + uses: microsoft/action-python@0.6.3 + with: + flake8: true From c1349c6e94296af7e141cfe8f4e26e0df708b279 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 12:19:49 +0200 Subject: [PATCH 058/207] Revert ":recycle: try another linter" This reverts commit 49f9822b3fb0bda3dcbf8a7352b2133b361a6f41. --- .github/workflows/linting_pr.yml | 36 -------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/linting_pr.yml diff --git a/.github/workflows/linting_pr.yml b/.github/workflows/linting_pr.yml deleted file mode 100644 index 8cc822df6e..0000000000 --- a/.github/workflows/linting_pr.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: 📇 Linting PR - -on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] - -jobs: - linting: - runs-on: ubuntu-latest - steps: - - name: Black - uses: microsoft/action-python@0.6.3 - with: - black: false - - - name: Bandit - uses: microsoft/action-python@0.6.3 - with: - bandit: true - - - name: Pylint - uses: microsoft/action-python@0.6.3 - with: - pylint: true - - - name: Pyright - uses: microsoft/action-python@0.6.3 - with: - pyright: true - - - name: Flake8 - uses: microsoft/action-python@0.6.3 - with: - flake8: true From 27216b247bda55b9089896fe7494a1e54439201a Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 12:43:48 +0200 Subject: [PATCH 059/207] :heavy_plus_sign: Test another linter --- .github/workflows/pr_linting.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/pr_linting.yml diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml new file mode 100644 index 0000000000..418e5d9379 --- /dev/null +++ b/.github/workflows/pr_linting.yml @@ -0,0 +1,13 @@ +name: 📇 Code Linting + +on: + push: + branches: [ develop ] + +jobs: + - linting: + - name: wemake-python-styleguide + uses: wemake-services/wemake-python-styleguide@master + with: + reporter: 'github-pr-review' + GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From 0f7d552eb3a614ff799ace2aeb49427c7f84da27 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 12:45:00 +0200 Subject: [PATCH 060/207] :recycle: linter events --- .github/workflows/pr_linting.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 418e5d9379..3f53182be0 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -3,6 +3,8 @@ name: 📇 Code Linting on: push: branches: [ develop ] + pull_request: + branches: [ develop ] jobs: - linting: From 98a358b60ac47630b70f6c04e0a62c67fff92929 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 12:49:26 +0200 Subject: [PATCH 061/207] :art: configure linting --- .github/workflows/pr_linting.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 3f53182be0..94574779d1 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -7,9 +7,11 @@ on: branches: [ develop ] jobs: - - linting: - - name: wemake-python-styleguide - uses: wemake-services/wemake-python-styleguide@master + lint: + runs-on: ubuntu-latest + steps: + - name: Code Check + - uses: wemake-services/wemake-python-styleguide@master with: reporter: 'github-pr-review' GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From 07dd4d0b0ade51aeff2e9f899daede0b0ed85e68 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 12:52:00 +0200 Subject: [PATCH 062/207] :recycle: another hit on GH action configuration --- .github/workflows/pr_linting.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 94574779d1..eb9afffcc2 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -7,11 +7,12 @@ on: branches: [ develop ] jobs: - lint: + linting: runs-on: ubuntu-latest steps: - name: Code Check - - uses: wemake-services/wemake-python-styleguide@master + uses: wemake-services/wemake-python-styleguide@master with: reporter: 'github-pr-review' + env: GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From 3e495bc88131d4938230ea105a0a8f245e3ccf55 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 13:03:57 +0200 Subject: [PATCH 063/207] :art: set linting permissions and checkout --- .github/workflows/pr_linting.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index eb9afffcc2..1deeef4726 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -6,10 +6,15 @@ on: pull_request: branches: [ develop ] +permissions: + contents: read + pull-requests: write + jobs: linting: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - name: Code Check uses: wemake-services/wemake-python-styleguide@master with: From 00a2db65a12ebc888d09df2d4d8f6ba81a1ea972 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 14:02:02 +0200 Subject: [PATCH 064/207] :recycle: fix container use in extractor --- .../hosts/max/plugins/publish/extract_pointcloud.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 74265da7fb..ee9e9693e9 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -6,7 +6,6 @@ from openpype.hosts.max.api import ( maintained_selection ) from openpype.settings import get_project_settings -from openpype.pipeline import legacy_io class ExtractPointCloud(publish.Extractor): @@ -62,10 +61,12 @@ class ExtractPointCloud(publish.Extractor): instance.data["representations"] = [] self.log.info("Writing PRT with TyFlow Plugin...") - filenames = self.get_files(container, path, start, end) + filenames = self.get_files( + instance.data["members"][0], path, start, end) self.log.debug(f"filenames: {filenames}") - partition = self.partition_output_name(container) + partition = self.partition_output_name( + instance.data["members"][0]) representation = { 'name': 'prt', @@ -141,9 +142,9 @@ class ExtractPointCloud(publish.Extractor): sub_anim = rt.GetSubAnim(obj, anim_name) boolean = rt.IsProperty(sub_anim, "Export_Particles") if boolean: - event_name = sub_anim.Name - opt = f"${member.Name}.{event_name}.export_particles" - opt_list.append(opt) + event_name = sub_anim.Name + opt = f"${member.Name}.{event_name}.export_particles" + opt_list.append(opt) return opt_list From cb24f2a9ba8c08b27980fa06e2cb83a2599173a9 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 14:07:19 +0200 Subject: [PATCH 065/207] :art: configure linter --- .github/workflows/pr_linting.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/pr_linting.yml diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml new file mode 100644 index 0000000000..1deeef4726 --- /dev/null +++ b/.github/workflows/pr_linting.yml @@ -0,0 +1,23 @@ +name: 📇 Code Linting + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +permissions: + contents: read + pull-requests: write + +jobs: + linting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Code Check + uses: wemake-services/wemake-python-styleguide@master + with: + reporter: 'github-pr-review' + env: + GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From e608e7c808c22a09c118b4acad14c66543342b7e Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 14:57:28 +0200 Subject: [PATCH 066/207] :art: limit to changed files path --- .github/workflows/pr_linting.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 1deeef4726..1f6be64d31 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -15,9 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: | + echo "_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} -- '*.py' | tr -s '\n' ' ' )" >> ${GITHUB_ENV} - name: Code Check uses: wemake-services/wemake-python-styleguide@master with: reporter: 'github-pr-review' + path: "${{ env._CHANGED_FILES }}" env: GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From 5829f647e548ab46be77a4caf7d704297419bbf8 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 14:59:41 +0200 Subject: [PATCH 067/207] :art: limit --- .github/workflows/pr_linting.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 1f6be64d31..59ac48aeb8 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -6,6 +6,8 @@ on: pull_request: branches: [ develop ] + workflow_dispatch: + permissions: contents: read pull-requests: write @@ -19,6 +21,7 @@ jobs: echo "_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} -- '*.py' | tr -s '\n' ' ' )" >> ${GITHUB_ENV} - name: Code Check uses: wemake-services/wemake-python-styleguide@master + if: ${{ env._CHANGED_FILES }} with: reporter: 'github-pr-review' path: "${{ env._CHANGED_FILES }}" From 6fb6762f34c0b972e5061b5bfcae1755a6bba895 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 15:14:17 +0200 Subject: [PATCH 068/207] :recycle: limit using diff_context --- .github/workflows/pr_linting.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 59ac48aeb8..64b6bc0da5 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -17,13 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | - echo "_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} -- '*.py' | tr -s '\n' ' ' )" >> ${GITHUB_ENV} - name: Code Check uses: wemake-services/wemake-python-styleguide@master - if: ${{ env._CHANGED_FILES }} with: reporter: 'github-pr-review' - path: "${{ env._CHANGED_FILES }}" + filter: 'diff_context' env: GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From da12ac16c56f4510309275ec764b708e1a62bdb0 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 15:32:50 +0200 Subject: [PATCH 069/207] :art: solving changed list --- .github/workflows/pr_linting.yml | 38 +++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 64b6bc0da5..975c83e677 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -8,19 +8,55 @@ on: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number}} + cancel-in-progress: true + permissions: contents: read pull-requests: write jobs: + files_changed: + runs-on: ubuntu-latest + outputs: + changed_python: ${{ steps.changes.outputs.python }} + steps: + - uses: actions/checkout@master + if: github.event_name == 'push' + - uses: dorny/paths-filter@master + id: changes + with: + filters: | + cpp: + - ["lte/gateway/c/**", "orc8r/gateway/c/**", "lte/gateway/python/**"] + javascript: + - ["nms/**", "**/*.js"] + python: + - ["**/*.py"] + terraform: + - ["**/*.tf"] + linting: + needs: files_changed + if: ${{ needs.files_changed.outputs.changed_python == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + fetch-depth: 0 + - name: Get changed Python files + id: py-changes + run: | + echo "py_files_list=$(git diff --name-only --diff-filter=ACMRT \ + ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \ + | grep .py$ | xargs)" >> $GITHUB_OUTPUT - name: Code Check uses: wemake-services/wemake-python-styleguide@master with: reporter: 'github-pr-review' - filter: 'diff_context' + path: ${{ steps.py-changes.outputs.py_files_list }} env: GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" From a3a996d5a56787fa88cf0d92a2c39a6bf0f31fbd Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 15:42:04 +0200 Subject: [PATCH 070/207] :bug: fix checkout action --- .github/workflows/pr_linting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 975c83e677..4f4f7c2585 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -22,7 +22,7 @@ jobs: outputs: changed_python: ${{ steps.changes.outputs.python }} steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 if: github.event_name == 'push' - uses: dorny/paths-filter@master id: changes From 65110ded4609f2b6d7a5ccf97bff097f91d370de Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 15:43:32 +0200 Subject: [PATCH 071/207] :bug: fix checkout action --- .github/workflows/pr_linting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 975c83e677..4f4f7c2585 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -22,7 +22,7 @@ jobs: outputs: changed_python: ${{ steps.changes.outputs.python }} steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 if: github.event_name == 'push' - uses: dorny/paths-filter@master id: changes From 5ef4f4fb131f569da9aa0b5db50c66c0a99f86e8 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 15:47:52 +0200 Subject: [PATCH 072/207] :bug: fix syntax --- .github/workflows/pr_linting.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 4f4f7c2585..58f52bb313 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -21,21 +21,15 @@ jobs: runs-on: ubuntu-latest outputs: changed_python: ${{ steps.changes.outputs.python }} - steps: - - uses: actions/checkout@v3 - if: github.event_name == 'push' - - uses: dorny/paths-filter@master - id: changes - with: - filters: | - cpp: - - ["lte/gateway/c/**", "orc8r/gateway/c/**", "lte/gateway/python/**"] - javascript: - - ["nms/**", "**/*.js"] - python: - - ["**/*.py"] - terraform: - - ["**/*.tf"] + steps: + - uses: actions/checkout@v3 + if: github.event_name == 'push' + - uses: dorny/paths-filter@master + id: changes + with: + filters: | + python: + - ["**/*.py"] linting: needs: files_changed From 3497b03b7fc8cffadf597908e7f4bdde60f1ee0e Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 15:50:49 +0200 Subject: [PATCH 073/207] :bug: fix syntax --- .github/workflows/pr_linting.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml index 975c83e677..58f52bb313 100644 --- a/.github/workflows/pr_linting.yml +++ b/.github/workflows/pr_linting.yml @@ -21,21 +21,15 @@ jobs: runs-on: ubuntu-latest outputs: changed_python: ${{ steps.changes.outputs.python }} - steps: - - uses: actions/checkout@master - if: github.event_name == 'push' - - uses: dorny/paths-filter@master - id: changes - with: - filters: | - cpp: - - ["lte/gateway/c/**", "orc8r/gateway/c/**", "lte/gateway/python/**"] - javascript: - - ["nms/**", "**/*.js"] - python: - - ["**/*.py"] - terraform: - - ["**/*.tf"] + steps: + - uses: actions/checkout@v3 + if: github.event_name == 'push' + - uses: dorny/paths-filter@master + id: changes + with: + filters: | + python: + - ["**/*.py"] linting: needs: files_changed From 227075f1a918d3ddc7aea60a57f955558820171b Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 16:07:32 +0200 Subject: [PATCH 074/207] :art: add WPS to pre-commit --- .pre-commit-config.yaml | 9 +++++++++ poetry.lock | 24 +++++++++++++++++++++--- pyproject.toml | 1 + 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eec388924e..fe4c7e3da3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,12 @@ repos: - id: check-added-large-files - id: no-commit-to-branch args: [ '--pattern', '^(?!((release|enhancement|feature|bugfix|documentation|tests|local|chore)\/[a-zA-Z0-9\-_]+)$).*' ] +- repo: local + hooks: + - id: flake8 + name: flake8 + description: WPS enforced flake8 + entry: flake8 + args: ["--config=setup.cfg"] + language: python + types: [python] diff --git a/poetry.lock b/poetry.lock index f71611cb6f..cbc4ac7b94 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. [[package]] name = "acre" @@ -1456,11 +1456,13 @@ python-versions = ">=3.6" files = [ {file = "lief-0.12.3-cp310-cp310-macosx_10_14_arm64.whl", hash = "sha256:66724f337e6a36cea1a9380f13b59923f276c49ca837becae2e7be93a2e245d9"}, {file = "lief-0.12.3-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:6d18aafa2028587c98f6d4387bec94346e92f2b5a8a5002f70b1cf35b1c045cc"}, + {file = "lief-0.12.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d4f69d125caaa8d5ddb574f29cc83101e165ebea1a9f18ad042eb3544081a797"}, {file = "lief-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c078d6230279ffd3bca717c79664fb8368666f610b577deb24b374607936e9c1"}, {file = "lief-0.12.3-cp310-cp310-win32.whl", hash = "sha256:e3a6af926532d0aac9e7501946134513d63217bacba666e6f7f5a0b7e15ba236"}, {file = "lief-0.12.3-cp310-cp310-win_amd64.whl", hash = "sha256:0750b72e3aa161e1fb0e2e7f571121ae05d2428aafd742ff05a7656ad2288447"}, {file = "lief-0.12.3-cp311-cp311-macosx_10_14_arm64.whl", hash = "sha256:b5c123cb99a7879d754c059e299198b34e7e30e3b64cf22e8962013db0099f47"}, {file = "lief-0.12.3-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:8bc58fa26a830df6178e36f112cb2bbdd65deff593f066d2d51434ff78386ba5"}, + {file = "lief-0.12.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:74ac6143ac6ccd813c9b068d9c5f1f9d55c8813c8b407387eb57de01c3db2d74"}, {file = "lief-0.12.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04eb6b70d646fb5bd6183575928ee23715550f161f2832cbcd8c6ff2071fb408"}, {file = "lief-0.12.3-cp311-cp311-win32.whl", hash = "sha256:7e2d0a53c403769b04adcf8df92e83c5e25f9103a052aa7f17b0a9cf057735fb"}, {file = "lief-0.12.3-cp311-cp311-win_amd64.whl", hash = "sha256:7f6395c12ee1bc4a5162f567cba96d0c72dfb660e7902e84d4f3029daf14fe33"}, @@ -1480,6 +1482,7 @@ files = [ {file = "lief-0.12.3-cp38-cp38-win_amd64.whl", hash = "sha256:b00667257b43e93d94166c959055b6147d46d302598f3ee55c194b40414c89cc"}, {file = "lief-0.12.3-cp39-cp39-macosx_10_14_arm64.whl", hash = "sha256:e6a1b5b389090d524621c2455795e1262f62dc9381bedd96f0cd72b878c4066d"}, {file = "lief-0.12.3-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:ae773196df814202c0c51056163a1478941b299512b09660a3c37be3c7fac81e"}, + {file = "lief-0.12.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:66ddf88917ec7b00752687c476bb2771dc8ec19bd7e4c0dcff1f8ef774cad4e9"}, {file = "lief-0.12.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:4a47f410032c63ac3be051d963d0337d6b47f0e94bfe8e946ab4b6c428f4d0f8"}, {file = "lief-0.12.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbd11367c2259bd1131a6c8755dcde33314324de5ea029227bfbc7d3755871e6"}, {file = "lief-0.12.3-cp39-cp39-win32.whl", hash = "sha256:2ce53e311918c3e5b54c815ef420a747208d2a88200c41cd476f3dd1eb876bcf"}, @@ -2352,7 +2355,7 @@ files = [ cffi = ">=1.4.1" [package.extras] -docs = ["sphinx (>=1.6.5)", "sphinx_rtd_theme"] +docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] [[package]] @@ -3245,6 +3248,21 @@ files = [ [package.dependencies] six = "*" +[[package]] +name = "wemake-python-styleguide" +version = "0.0.1" +description = "Opinionated styleguide that we use in wemake.services projects" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "wemake-python-styleguide-0.0.1.tar.gz", hash = "sha256:e1f47a2be6aa79ca8a1cfbbbffdd67bf4df32b76306f4c3dd2a620a2af78e671"}, + {file = "wemake_python_styleguide-0.0.1-py2.py3-none-any.whl", hash = "sha256:505a19d82f9c4f450c6f06bb8c74d86c99cabcc4d5e6d8ea70e90b13b049f34f"}, +] + +[package.dependencies] +flake8 = "*" + [[package]] name = "wheel" version = "0.38.4" @@ -3462,4 +3480,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = ">=3.9.1,<3.10" -content-hash = "02daca205796a0f29a0d9f50707544e6804f32027eba493cd2aa7f175a00dcea" +content-hash = "c566a959134559e2fccf9b17fc820956207c9d36a58195f48990b986114d7108" diff --git a/pyproject.toml b/pyproject.toml index 2f40d58f56..99e03daea1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,6 +94,7 @@ wheel = "*" enlighten = "*" # cool terminal progress bars toml = "^0.10.2" # for parsing pyproject.toml pre-commit = "*" +wemake-python-styleguide = "*" [tool.poetry.urls] "Bug Tracker" = "https://github.com/pypeclub/openpype/issues" From a6f3bbe0f4f653048e11d7ecbb282d7c7583ef53 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 16:49:09 +0200 Subject: [PATCH 075/207] :wrench: update flake8 configuration --- setup.cfg | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 140 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 10cca3eb3f..838c6bd4c5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,6 @@ [flake8] -# ignore = D203 -ignore = BLK100, W504, W503 max-line-length = 79 +strictness = short exclude = .git, __pycache__, @@ -10,8 +9,145 @@ exclude = website, openpype/vendor, *deadline/repository/custom/plugins - max-complexity = 30 +ignore = + # line break before binary operator + W503, + # line break occurred after a binary operator + W504, + # wemake-python-styleguide warnings + # See https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html for doc + # Found incorrect module name pattern + WPS102, + # Found wrong variable name + WPS110, + # Found too short name + WPS111, + # Found upper-case constant in a class + WPS115, + # Found module with too many imports + WPS201, + # Found too many module members + WPS202, + # Found overused expression + WPS204, + # Found too many local variables + WPS210, + # Found too many arguments + WPS211, + # Found too many return statements + WPS212, + # Found too many expressions + WPS213, + # Found too many methods + WPS214, + # Found too many await expressions + WPS217, + # Found line with high Jones Complexity + WPS221, + # Found too many `elif` branches + WPS223, + # Found string constant over-use + WPS226, + # Found too long try body length + WPS229, + # Found too many public instance attributes + WPS230, + # Found function with too much cognitive complexity + WPS231, + # Found module cognitive complexity that is too high + WPS232, + # Found too many imported names from a module + WPS235, + # Found too many raises in a function + WPS238, + # Found too deep nesting + WPS220, + # Found `f` string + WPS305, + # Found incorrect multi-line parameters + WPS317, + # Found extra indentation + WPS318, + # Found bracket in wrong position + WPS319, + # Found percent string formatting + WPS323, + # Found implicit string concatenation + WPS326, + # Found variables that are only used for `return` + WPS331, + # Found explicit string concatenation + WPS336, + # Found multiline conditions + WPS337, + # Found incorrect order of methods in a class + WPS338, + # Found line starting with a dot + WPS348, + # Found multiline loop + WPS352, + # Found incorrect unpacking target + WPS414, + # Found wrong keyword + WPS420, + # Found wrong function + WPS421, + # Found statement that has no effect + WPS428, + # Found nested function + WPS430, + # Found magic number + WPS432, + # Found protected attribute usage + WPS437, + # Found block variables overlap + WPS440, + # Found an infinite while loop + WPS457, + # Found a getter without a return value + WPS463, + # Found negated condition + WPS504, + # flake8-quotes warnings + # Remove bad quotes + Q000, + # Remove bad quotes from multiline string + Q001, + # Darglint warnings + # Incorrect indentation + DAR003, + # Excess parameter(s) in Docstring + DAR102, + # Excess exception(s) in Raises section + DAR402, + # pydocstyle warnings + # Missing docstring in __init_ + D107, + # White space formatting for doc strings + D2, + # First line should end with a period + D400, + # Others + # function name + N802, + # Found backslash that is used for line breaking + N400, + E501, + S105, + RST + +[isort] +profile=wemake +src_paths=isort,test +# isort configuration: +# https://github.com/timothycrosley/isort/wiki/isort-Settings +include_trailing_comma = true +use_parentheses = true +# See https://github.com/timothycrosley/isort#multi-line-output-modes +multi_line_output = 3 +# Is the same as 80 in flake8: +line_length = 79 [pylint.'MESSAGES CONTROL'] disable = no-member @@ -28,4 +164,4 @@ omit = /tests directory = ./coverage [tool:pytest] -norecursedirs = repos/* openpype/modules/ftrack/* \ No newline at end of file +norecursedirs = repos/* openpype/modules/ftrack/* From e1384a40b1b94a0f456d6cd4e01a63dd1e8a23e5 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 4 May 2023 17:46:31 +0200 Subject: [PATCH 076/207] :heavy_plus_sign: add isort and fix python black check --- poetry.lock | 2 +- pyproject.toml | 1 + setup.cfg | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index cbc4ac7b94..563f905fad 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3480,4 +3480,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = ">=3.9.1,<3.10" -content-hash = "c566a959134559e2fccf9b17fc820956207c9d36a58195f48990b986114d7108" +content-hash = "45e91b47f9e6697b0eb9fdbe76981f691d389ce74bc5a0e98d72e1109b39bc63" diff --git a/pyproject.toml b/pyproject.toml index 4bb80c060b..0d236aedc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,6 +95,7 @@ enlighten = "*" # cool terminal progress bars toml = "^0.10.2" # for parsing pyproject.toml pre-commit = "*" wemake-python-styleguide = "*" +isort="*" [tool.poetry.urls] "Bug Tracker" = "https://github.com/pypeclub/openpype/issues" diff --git a/setup.cfg b/setup.cfg index 838c6bd4c5..7863a74894 100644 --- a/setup.cfg +++ b/setup.cfg @@ -135,7 +135,9 @@ ignore = N400, E501, S105, - RST + RST, + # Black would make changes error + BLK100, [isort] profile=wemake From ecc1ba12f0187c9d9e46e9a59e1749e90e7a6ed1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 5 May 2023 13:22:23 +0800 Subject: [PATCH 077/207] bug fix the validator error --- .../hosts/max/plugins/create/create_camera.py | 8 +++-- .../max/plugins/create/create_maxScene.py | 8 +++-- .../max/plugins/create/create_pointcache.py | 11 ++++-- .../max/plugins/create/create_pointcloud.py | 8 +++-- .../hosts/max/plugins/create/create_render.py | 8 +++-- .../max/plugins/publish/extract_pointcloud.py | 34 +++++++++---------- .../plugins/publish/validate_pointcloud.py | 2 +- 7 files changed, 47 insertions(+), 32 deletions(-) diff --git a/openpype/hosts/max/plugins/create/create_camera.py b/openpype/hosts/max/plugins/create/create_camera.py index 91d0d4d3dc..ab5578a201 100644 --- a/openpype/hosts/max/plugins/create/create_camera.py +++ b/openpype/hosts/max/plugins/create/create_camera.py @@ -12,7 +12,6 @@ class CreateCamera(plugin.MaxCreator): def create(self, subset_name, instance_data, pre_create_data): from pymxs import runtime as rt - sel_obj = list(rt.selection) instance = super(CreateCamera, self).create( subset_name, instance_data, @@ -20,7 +19,10 @@ class CreateCamera(plugin.MaxCreator): container = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - for obj in sel_obj: - obj.parent = container + sel_obj = None + if self.selected_nodes: + sel_obj = list(self.selected_nodes) + for obj in sel_obj: + obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_maxScene.py b/openpype/hosts/max/plugins/create/create_maxScene.py index 7900336f32..2d6ea8c27b 100644 --- a/openpype/hosts/max/plugins/create/create_maxScene.py +++ b/openpype/hosts/max/plugins/create/create_maxScene.py @@ -12,7 +12,6 @@ class CreateMaxScene(plugin.MaxCreator): def create(self, subset_name, instance_data, pre_create_data): from pymxs import runtime as rt - sel_obj = list(rt.selection) instance = super(CreateMaxScene, self).create( subset_name, instance_data, @@ -20,7 +19,10 @@ class CreateMaxScene(plugin.MaxCreator): container = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - for obj in sel_obj: - obj.parent = container + sel_obj = None + if self.selected_nodes: + sel_obj = list(self.selected_nodes) + for obj in sel_obj: + obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_pointcache.py b/openpype/hosts/max/plugins/create/create_pointcache.py index 32f0838471..42aa743794 100644 --- a/openpype/hosts/max/plugins/create/create_pointcache.py +++ b/openpype/hosts/max/plugins/create/create_pointcache.py @@ -13,10 +13,17 @@ class CreatePointCache(plugin.MaxCreator): def create(self, subset_name, instance_data, pre_create_data): # from pymxs import runtime as rt - _ = super(CreatePointCache, self).create( + instance = super(CreatePointCache, self).create( subset_name, instance_data, pre_create_data) # type: CreatedInstance - + container = rt.getNodeByName(instance.data.get("instance_node")) + # TODO: Disable "Add to Containers?" Panel + # parent the selected cameras into the container + sel_obj = None + if self.selected_nodes: + sel_obj = list(self.selected_nodes) + for obj in sel_obj: + obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_pointcloud.py b/openpype/hosts/max/plugins/create/create_pointcloud.py index c83acac3df..e46bf30d1c 100644 --- a/openpype/hosts/max/plugins/create/create_pointcloud.py +++ b/openpype/hosts/max/plugins/create/create_pointcloud.py @@ -12,7 +12,6 @@ class CreatePointCloud(plugin.MaxCreator): def create(self, subset_name, instance_data, pre_create_data): from pymxs import runtime as rt - sel_obj = list(rt.selection) instance = super(CreatePointCloud, self).create( subset_name, instance_data, @@ -20,7 +19,10 @@ class CreatePointCloud(plugin.MaxCreator): container = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - for obj in sel_obj: - obj.parent = container + sel_obj = None + if self.selected_nodes: + sel_obj = list(self.selected_nodes) + for obj in sel_obj: + obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 269fff2e32..43d69fa320 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -13,7 +13,6 @@ class CreateRender(plugin.MaxCreator): def create(self, subset_name, instance_data, pre_create_data): from pymxs import runtime as rt - sel_obj = list(rt.selection) instance = super(CreateRender, self).create( subset_name, instance_data, @@ -22,8 +21,11 @@ class CreateRender(plugin.MaxCreator): container = rt.getNodeByName(container_name) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - for obj in sel_obj: - obj.parent = container + sel_obj = None + if self.selected_nodes: + sel_obj = list(self.selected_nodes) + for obj in sel_obj: + obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index ee9e9693e9..f85255bbf5 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -53,7 +53,9 @@ class ExtractPointCloud(publish.Extractor): start, end, path) + for job in job_args: + self.log.debug("job:{}".format(job)) rt.Execute(job) self.log.info("Performing Extraction ...") @@ -62,11 +64,11 @@ class ExtractPointCloud(publish.Extractor): self.log.info("Writing PRT with TyFlow Plugin...") filenames = self.get_files( - instance.data["members"][0], path, start, end) + instance.data["members"], path, start, end) self.log.debug(f"filenames: {filenames}") partition = self.partition_output_name( - instance.data["members"][0]) + instance.data["members"]) representation = { 'name': 'prt', @@ -105,7 +107,7 @@ class ExtractPointCloud(publish.Extractor): end_frame = f"{operator}.frameEnd={end}" job_args.append(end_frame) filepath = filepath.replace("\\", "/") - prt_filename = f"{operator}.PRTFilename={filepath}" + prt_filename = f"{operator}.PRTFilename='{filepath}'" job_args.append(prt_filename) # Partition @@ -113,7 +115,8 @@ class ExtractPointCloud(publish.Extractor): job_args.append(mode) additional_args = self.get_custom_attr(operator) - job_args.extend(iter(additional_args)) + for args in additional_args: + job_args.append(args) prt_export = f"{operator}.exportPRT()" job_args.append(prt_export) @@ -132,19 +135,16 @@ class ExtractPointCloud(publish.Extractor): """ opt_list = [] for member in members: - node = rt.getNodeByName(member) - selection_list = list(node.Children) - for sel in selection_list: - obj = sel.baseobject - # TODO: to see if it can be used maxscript instead - anim_names = rt.GetSubAnimNames(obj) - for anim_name in anim_names: - sub_anim = rt.GetSubAnim(obj, anim_name) - boolean = rt.IsProperty(sub_anim, "Export_Particles") - if boolean: - event_name = sub_anim.Name - opt = f"${member.Name}.{event_name}.export_particles" - opt_list.append(opt) + obj = member.baseobject + # TODO: to see if it can be used maxscript instead + anim_names = rt.GetSubAnimNames(obj) + for anim_name in anim_names: + sub_anim = rt.GetSubAnim(obj, anim_name) + boolean = rt.IsProperty(sub_anim, "Export_Particles") + if boolean: + event_name = sub_anim.Name + opt = f"${member.Name}.{event_name}.export_particles" + opt_list.append(opt) return opt_list diff --git a/openpype/hosts/max/plugins/publish/validate_pointcloud.py b/openpype/hosts/max/plugins/publish/validate_pointcloud.py index e3a6face07..e1c2151c9d 100644 --- a/openpype/hosts/max/plugins/publish/validate_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/validate_pointcloud.py @@ -54,7 +54,7 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): f":{invalid}")) if report: - raise PublishValidationError + raise PublishValidationError(f"{report}") def get_tyflow_object(self, instance): invalid = [] From cca37521e9de457e5b4b519f09aaa4d1851f4c3d Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 5 May 2023 13:34:18 +0800 Subject: [PATCH 078/207] refractor to the point cloud extractor and all creators --- openpype/hosts/max/plugins/create/create_camera.py | 7 +------ openpype/hosts/max/plugins/create/create_maxScene.py | 7 +------ openpype/hosts/max/plugins/create/create_model.py | 7 +------ openpype/hosts/max/plugins/create/create_pointcache.py | 9 ++------- openpype/hosts/max/plugins/create/create_pointcloud.py | 7 +------ openpype/hosts/max/plugins/publish/extract_pointcloud.py | 4 +--- 6 files changed, 7 insertions(+), 34 deletions(-) diff --git a/openpype/hosts/max/plugins/create/create_camera.py b/openpype/hosts/max/plugins/create/create_camera.py index ab5578a201..b949c91857 100644 --- a/openpype/hosts/max/plugins/create/create_camera.py +++ b/openpype/hosts/max/plugins/create/create_camera.py @@ -16,13 +16,8 @@ class CreateCamera(plugin.MaxCreator): subset_name, instance_data, pre_create_data) # type: CreatedInstance - container = rt.getNodeByName(instance.data.get("instance_node")) + _ = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - sel_obj = None - if self.selected_nodes: - sel_obj = list(self.selected_nodes) - for obj in sel_obj: - obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_maxScene.py b/openpype/hosts/max/plugins/create/create_maxScene.py index 2d6ea8c27b..bf03ee8c8a 100644 --- a/openpype/hosts/max/plugins/create/create_maxScene.py +++ b/openpype/hosts/max/plugins/create/create_maxScene.py @@ -16,13 +16,8 @@ class CreateMaxScene(plugin.MaxCreator): subset_name, instance_data, pre_create_data) # type: CreatedInstance - container = rt.getNodeByName(instance.data.get("instance_node")) + _ = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - sel_obj = None - if self.selected_nodes: - sel_obj = list(self.selected_nodes) - for obj in sel_obj: - obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_model.py b/openpype/hosts/max/plugins/create/create_model.py index e7ae3af9db..4f7fd491e4 100644 --- a/openpype/hosts/max/plugins/create/create_model.py +++ b/openpype/hosts/max/plugins/create/create_model.py @@ -16,13 +16,8 @@ class CreateModel(plugin.MaxCreator): subset_name, instance_data, pre_create_data) # type: CreatedInstance - container = rt.getNodeByName(instance.data.get("instance_node")) + _ = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - sel_obj = None - if self.selected_nodes: - sel_obj = list(self.selected_nodes) - for obj in sel_obj: - obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_pointcache.py b/openpype/hosts/max/plugins/create/create_pointcache.py index 42aa743794..aa22a92b25 100644 --- a/openpype/hosts/max/plugins/create/create_pointcache.py +++ b/openpype/hosts/max/plugins/create/create_pointcache.py @@ -11,19 +11,14 @@ class CreatePointCache(plugin.MaxCreator): icon = "gear" def create(self, subset_name, instance_data, pre_create_data): - # from pymxs import runtime as rt + from pymxs import runtime as rt instance = super(CreatePointCache, self).create( subset_name, instance_data, pre_create_data) # type: CreatedInstance - container = rt.getNodeByName(instance.data.get("instance_node")) + _ = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - sel_obj = None - if self.selected_nodes: - sel_obj = list(self.selected_nodes) - for obj in sel_obj: - obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_pointcloud.py b/openpype/hosts/max/plugins/create/create_pointcloud.py index e46bf30d1c..a8564ee118 100644 --- a/openpype/hosts/max/plugins/create/create_pointcloud.py +++ b/openpype/hosts/max/plugins/create/create_pointcloud.py @@ -16,13 +16,8 @@ class CreatePointCloud(plugin.MaxCreator): subset_name, instance_data, pre_create_data) # type: CreatedInstance - container = rt.getNodeByName(instance.data.get("instance_node")) + _ = rt.getNodeByName(instance.data.get("instance_node")) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - sel_obj = None - if self.selected_nodes: - sel_obj = list(self.selected_nodes) - for obj in sel_obj: - obj.parent = container # for additional work on the node: # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index f85255bbf5..c807885859 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -55,7 +55,6 @@ class ExtractPointCloud(publish.Extractor): path) for job in job_args: - self.log.debug("job:{}".format(job)) rt.Execute(job) self.log.info("Performing Extraction ...") @@ -107,8 +106,7 @@ class ExtractPointCloud(publish.Extractor): end_frame = f"{operator}.frameEnd={end}" job_args.append(end_frame) filepath = filepath.replace("\\", "/") - prt_filename = f"{operator}.PRTFilename='{filepath}'" - + prt_filename = f'{operator}.PRTFilename="{filepath}"' job_args.append(prt_filename) # Partition mode = f"{operator}.PRTPartitionsMode=2" From 932c807913e5f7bac4de5d4acffd8ede3c9a0c3d Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 5 May 2023 13:53:54 +0800 Subject: [PATCH 079/207] fix the bug shown in removing instance after refractoring --- openpype/hosts/max/api/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 39a17c29ef..a464d54b33 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -173,7 +173,7 @@ class MaxCreator(Creator, MaxCreatorBase): for instance in instances: if instance_node := rt.GetNodeByName(instance.data.get("instance_node")): # noqa rt.Select(instance_node) - rt.custAttributes.add(instance_node.baseObject, "openPypeData") + rt.execute(f'for o in selection do for c in o.children do c.parent = undefined') # noqa rt.Delete(instance_node) self._remove_instance_from_context(instance) From 2d26cc00ad2c9787b47ede9fc81a6289a6edc911 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 5 May 2023 15:52:47 +0200 Subject: [PATCH 080/207] :rotating_light: some style issues and refactoring --- .pre-commit-config.yaml | 12 ++++-- .../hosts/max/plugins/create/create_camera.py | 14 +------ .../max/plugins/create/create_maxScene.py | 14 +------ .../hosts/max/plugins/create/create_model.py | 14 +------ .../max/plugins/create/create_pointcache.py | 15 +------- .../max/plugins/create/create_pointcloud.py | 14 +------ .../hosts/max/plugins/create/create_render.py | 13 +++---- .../plugins/publish/validate_usd_plugin.py | 38 ++++++++++--------- setup.cfg | 2 + 9 files changed, 41 insertions(+), 95 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe4c7e3da3..9c03dc8ff0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,15 @@ repos: - id: check-added-large-files - id: no-commit-to-branch args: [ '--pattern', '^(?!((release|enhancement|feature|bugfix|documentation|tests|local|chore)\/[a-zA-Z0-9\-_]+)$).*' ] -- repo: local - hooks: - - id: flake8 + +- repo: local + hooks: + - id: flake8 name: flake8 - description: WPS enforced flake8 + additional_dependencies: + - wemake-python-styleguide + - flake8 + description: Python style guide enforcement entry: flake8 args: ["--config=setup.cfg"] language: python diff --git a/openpype/hosts/max/plugins/create/create_camera.py b/openpype/hosts/max/plugins/create/create_camera.py index b949c91857..804d629ec7 100644 --- a/openpype/hosts/max/plugins/create/create_camera.py +++ b/openpype/hosts/max/plugins/create/create_camera.py @@ -1,23 +1,11 @@ # -*- coding: utf-8 -*- """Creator plugin for creating camera.""" from openpype.hosts.max.api import plugin -from openpype.pipeline import CreatedInstance class CreateCamera(plugin.MaxCreator): + """Creator plugin for Camera.""" identifier = "io.openpype.creators.max.camera" label = "Camera" family = "camera" icon = "gear" - - def create(self, subset_name, instance_data, pre_create_data): - from pymxs import runtime as rt - instance = super(CreateCamera, self).create( - subset_name, - instance_data, - pre_create_data) # type: CreatedInstance - _ = rt.getNodeByName(instance.data.get("instance_node")) - # TODO: Disable "Add to Containers?" Panel - # parent the selected cameras into the container - # for additional work on the node: - # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_maxScene.py b/openpype/hosts/max/plugins/create/create_maxScene.py index bf03ee8c8a..851e26dda2 100644 --- a/openpype/hosts/max/plugins/create/create_maxScene.py +++ b/openpype/hosts/max/plugins/create/create_maxScene.py @@ -1,23 +1,11 @@ # -*- coding: utf-8 -*- """Creator plugin for creating raw max scene.""" from openpype.hosts.max.api import plugin -from openpype.pipeline import CreatedInstance class CreateMaxScene(plugin.MaxCreator): + """Creator plugin for 3ds max scenes.""" identifier = "io.openpype.creators.max.maxScene" label = "Max Scene" family = "maxScene" icon = "gear" - - def create(self, subset_name, instance_data, pre_create_data): - from pymxs import runtime as rt - instance = super(CreateMaxScene, self).create( - subset_name, - instance_data, - pre_create_data) # type: CreatedInstance - _ = rt.getNodeByName(instance.data.get("instance_node")) - # TODO: Disable "Add to Containers?" Panel - # parent the selected cameras into the container - # for additional work on the node: - # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_model.py b/openpype/hosts/max/plugins/create/create_model.py index 4f7fd491e4..fc09d475ef 100644 --- a/openpype/hosts/max/plugins/create/create_model.py +++ b/openpype/hosts/max/plugins/create/create_model.py @@ -1,23 +1,11 @@ # -*- coding: utf-8 -*- """Creator plugin for model.""" from openpype.hosts.max.api import plugin -from openpype.pipeline import CreatedInstance class CreateModel(plugin.MaxCreator): + """Creator plugin for Model.""" identifier = "io.openpype.creators.max.model" label = "Model" family = "model" icon = "gear" - - def create(self, subset_name, instance_data, pre_create_data): - from pymxs import runtime as rt - instance = super(CreateModel, self).create( - subset_name, - instance_data, - pre_create_data) # type: CreatedInstance - _ = rt.getNodeByName(instance.data.get("instance_node")) - # TODO: Disable "Add to Containers?" Panel - # parent the selected cameras into the container - # for additional work on the node: - # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_pointcache.py b/openpype/hosts/max/plugins/create/create_pointcache.py index aa22a92b25..c2d11f4c32 100644 --- a/openpype/hosts/max/plugins/create/create_pointcache.py +++ b/openpype/hosts/max/plugins/create/create_pointcache.py @@ -1,24 +1,11 @@ # -*- coding: utf-8 -*- """Creator plugin for creating pointcache alembics.""" from openpype.hosts.max.api import plugin -from openpype.pipeline import CreatedInstance class CreatePointCache(plugin.MaxCreator): + """Creator plugin for Point caches.""" identifier = "io.openpype.creators.max.pointcache" label = "Point Cache" family = "pointcache" icon = "gear" - - def create(self, subset_name, instance_data, pre_create_data): - from pymxs import runtime as rt - - instance = super(CreatePointCache, self).create( - subset_name, - instance_data, - pre_create_data) # type: CreatedInstance - _ = rt.getNodeByName(instance.data.get("instance_node")) - # TODO: Disable "Add to Containers?" Panel - # parent the selected cameras into the container - # for additional work on the node: - # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_pointcloud.py b/openpype/hosts/max/plugins/create/create_pointcloud.py index a8564ee118..bc7706069d 100644 --- a/openpype/hosts/max/plugins/create/create_pointcloud.py +++ b/openpype/hosts/max/plugins/create/create_pointcloud.py @@ -1,23 +1,11 @@ # -*- coding: utf-8 -*- """Creator plugin for creating point cloud.""" from openpype.hosts.max.api import plugin -from openpype.pipeline import CreatedInstance class CreatePointCloud(plugin.MaxCreator): + """Creator plugin for Point Clouds.""" identifier = "io.openpype.creators.max.pointcloud" label = "Point Cloud" family = "pointcloud" icon = "gear" - - def create(self, subset_name, instance_data, pre_create_data): - from pymxs import runtime as rt - instance = super(CreatePointCloud, self).create( - subset_name, - instance_data, - pre_create_data) # type: CreatedInstance - _ = rt.getNodeByName(instance.data.get("instance_node")) - # TODO: Disable "Add to Containers?" Panel - # parent the selected cameras into the container - # for additional work on the node: - # instance_node = rt.getNodeByName(instance.get("instance_node")) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 43d69fa320..e9952c3124 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -1,24 +1,25 @@ # -*- coding: utf-8 -*- """Creator plugin for creating camera.""" from openpype.hosts.max.api import plugin -from openpype.pipeline import CreatedInstance from openpype.hosts.max.api.lib_rendersettings import RenderSettings class CreateRender(plugin.MaxCreator): + """Creator plugin for Renders.""" identifier = "io.openpype.creators.max.render" label = "Render" family = "maxrender" icon = "gear" def create(self, subset_name, instance_data, pre_create_data): - from pymxs import runtime as rt - instance = super(CreateRender, self).create( + """Plugin entry point.""" + from pymxs import runtime as rt # noqa: WPS433,I001 + instance = super().create( subset_name, instance_data, - pre_create_data) # type: CreatedInstance + pre_create_data) container_name = instance.data.get("instance_node") - container = rt.getNodeByName(container_name) + container = rt.GetNodeByName(container_name) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container sel_obj = None @@ -26,8 +27,6 @@ class CreateRender(plugin.MaxCreator): sel_obj = list(self.selected_nodes) for obj in sel_obj: obj.parent = container - # for additional work on the node: - # instance_node = rt.getNodeByName(instance.get("instance_node")) # set viewport camera for rendering(mandatory for deadline) RenderSettings().set_render_camera(sel_obj) diff --git a/openpype/hosts/max/plugins/publish/validate_usd_plugin.py b/openpype/hosts/max/plugins/publish/validate_usd_plugin.py index 8f11d72567..9957e62736 100644 --- a/openpype/hosts/max/plugins/publish/validate_usd_plugin.py +++ b/openpype/hosts/max/plugins/publish/validate_usd_plugin.py @@ -1,35 +1,37 @@ # -*- coding: utf-8 -*- -import pyblish.api +"""Validator for USD plugin.""" from openpype.pipeline import PublishValidationError +from pyblish.api import InstancePlugin, ValidatorOrder from pymxs import runtime as rt -class ValidateUSDPlugin(pyblish.api.InstancePlugin): - """Validates if USD plugin is installed or loaded in Max - """ +def get_plugins() -> list: + """Get plugin list from 3ds max.""" + manager = rt.PluginManager + count = manager.pluginDllCount + plugin_info_list = [] + for p in range(1, count + 1): + plugin_info = manager.pluginDllName(p) + plugin_info_list.append(plugin_info) - order = pyblish.api.ValidatorOrder - 0.01 + return plugin_info_list + + +class ValidateUSDPlugin(InstancePlugin): + """Validates if USD plugin is installed or loaded in 3ds max.""" + + order = ValidatorOrder - 0.01 families = ["model"] hosts = ["max"] label = "USD Plugin" def process(self, instance): - plugin_mgr = rt.PluginManager - plugin_count = plugin_mgr.pluginDllCount - plugin_info = self.get_plugins(plugin_mgr, - plugin_count) + """Plugin entry point.""" + + plugin_info = get_plugins() usd_import = "usdimport.dli" if usd_import not in plugin_info: raise PublishValidationError(f"USD Plugin {usd_import} not found") usd_export = "usdexport.dle" if usd_export not in plugin_info: raise PublishValidationError(f"USD Plugin {usd_export} not found") - - @staticmethod - def get_plugins(manager, count): - plugin_info_list = [] - for p in range(1, count + 1): - plugin_info = manager.pluginDllName(p) - plugin_info_list.append(plugin_info) - - return plugin_info_list diff --git a/setup.cfg b/setup.cfg index 7863a74894..1d57657a19 100644 --- a/setup.cfg +++ b/setup.cfg @@ -138,6 +138,8 @@ ignore = RST, # Black would make changes error BLK100, + # Imperative mood of the first line on docstrings + D401, [isort] profile=wemake From 6b1a801f4c14be4d4c601b7c7267dd01b659dad3 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 5 May 2023 15:55:27 +0200 Subject: [PATCH 081/207] adding links to documentation into settings labels --- .../schemas/projects_schema/schema_project_aftereffects.json | 2 +- .../schemas/projects_schema/schema_project_blender.json | 2 +- .../schemas/projects_schema/schema_project_celaction.json | 2 +- .../entities/schemas/projects_schema/schema_project_flame.json | 2 +- .../entities/schemas/projects_schema/schema_project_fusion.json | 2 +- .../entities/schemas/projects_schema/schema_project_global.json | 2 +- .../schemas/projects_schema/schema_project_harmony.json | 2 +- .../entities/schemas/projects_schema/schema_project_hiero.json | 2 +- .../schemas/projects_schema/schema_project_houdini.json | 2 +- .../entities/schemas/projects_schema/schema_project_max.json | 2 +- .../entities/schemas/projects_schema/schema_project_maya.json | 2 +- .../schemas/projects_schema/schema_project_photoshop.json | 2 +- .../schemas/projects_schema/schema_project_resolve.json | 2 +- .../schemas/projects_schema/schema_project_traypublisher.json | 2 +- .../schemas/projects_schema/schema_project_tvpaint.json | 2 +- .../entities/schemas/projects_schema/schema_project_unreal.json | 2 +- .../schemas/projects_schema/schema_project_webpublisher.json | 2 +- .../schemas/projects_schema/schemas/schema_nuke_imageio.json | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index ef09a71bda..d164a8f2c3 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index c3eab6c3f0..79eea3f192 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json index 5729f70e2f..915f199b6e 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 625780a650..16c9378194 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures." + "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index 6189da0e19..65584264c9 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json index d1d7f336e1..953361935c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_global.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_global.json @@ -13,7 +13,7 @@ "children": [ { "type": "label", - "label": "It's important to note that once color management is activated on a project, all hosts will be color managed by default.
The OpenColorIO (OCIO) config file is used either from the global settings or from the host's overrides. It's worth
noting that the order of the defined configuration paths matters, with higher priority given to paths listed earlier in
the configuration list.

To avoid potential issues, ensure that the OCIO configuration path is not an absolute path and includes at least
the root token (Anatomy). This helps ensure that the configuration path remains valid across different environments and
avoids any hard-coding of paths that may be specific to one particular system." + "label": "It's important to note that once color management is activated on a project, all hosts will be color managed by default.
The OpenColorIO (OCIO) config file is used either from the global settings or from the host's overrides. It's worth
noting that the order of the defined configuration paths matters, with higher priority given to paths listed earlier in
the configuration list.

To avoid potential issues, ensure that the OCIO configuration path is not an absolute path and includes at least
the root token (Anatomy). This helps ensure that the configuration path remains valid across different environments and
avoids any hard-coding of paths that may be specific to one particular system.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index a56f62c6d6..276b321b24 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index 2c82e1a9ac..c2339d8200 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index 588e209718..a7032775c1 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index 5dac8ee7e9..d1e8e333cc 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index 55f231e235..fe7c262603 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -54,7 +54,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json index 898c3374d7..7ddd575dde 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures." + "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json index 758cf2a196..aea019b77b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.." + "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation.." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index c234cd1b71..6b55837f12 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json index 6d446b5550..ed8887f93e 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index 8c3ff71489..aa2fe40b4a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index e319182e3c..7b65dddda6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -14,7 +14,7 @@ "children": [ { "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing." + "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." }, { "type": "boolean", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index f691518255..864e084bde 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -7,7 +7,7 @@ "children": [ { "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures." + "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." }, { "type": "boolean", From ac154303f3aaf6130492442c1c42496877006213 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 5 May 2023 17:23:42 +0200 Subject: [PATCH 082/207] :heavy_minus_sign: revert WPS tests --- .github/workflows/pr_linting.yml | 56 -------------------------------- .pre-commit-config.yaml | 13 -------- pyproject.toml | 2 -- 3 files changed, 71 deletions(-) delete mode 100644 .github/workflows/pr_linting.yml diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml deleted file mode 100644 index 58f52bb313..0000000000 --- a/.github/workflows/pr_linting.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: 📇 Code Linting - -on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] - - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number}} - cancel-in-progress: true - -permissions: - contents: read - pull-requests: write - -jobs: - files_changed: - runs-on: ubuntu-latest - outputs: - changed_python: ${{ steps.changes.outputs.python }} - steps: - - uses: actions/checkout@v3 - if: github.event_name == 'push' - - uses: dorny/paths-filter@master - id: changes - with: - filters: | - python: - - ["**/*.py"] - - linting: - needs: files_changed - if: ${{ needs.files_changed.outputs.changed_python == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: 0 - - name: Get changed Python files - id: py-changes - run: | - echo "py_files_list=$(git diff --name-only --diff-filter=ACMRT \ - ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \ - | grep .py$ | xargs)" >> $GITHUB_OUTPUT - - name: Code Check - uses: wemake-services/wemake-python-styleguide@master - with: - reporter: 'github-pr-review' - path: ${{ steps.py-changes.outputs.py_files_list }} - env: - GITHUB_TOKEN: "${{ secrets.YNPUT_BOT_TOKEN }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c03dc8ff0..eec388924e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,16 +10,3 @@ repos: - id: check-added-large-files - id: no-commit-to-branch args: [ '--pattern', '^(?!((release|enhancement|feature|bugfix|documentation|tests|local|chore)\/[a-zA-Z0-9\-_]+)$).*' ] - -- repo: local - hooks: - - id: flake8 - name: flake8 - additional_dependencies: - - wemake-python-styleguide - - flake8 - description: Python style guide enforcement - entry: flake8 - args: ["--config=setup.cfg"] - language: python - types: [python] diff --git a/pyproject.toml b/pyproject.toml index 0d236aedc6..003f6cf2d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,8 +94,6 @@ wheel = "*" enlighten = "*" # cool terminal progress bars toml = "^0.10.2" # for parsing pyproject.toml pre-commit = "*" -wemake-python-styleguide = "*" -isort="*" [tool.poetry.urls] "Bug Tracker" = "https://github.com/pypeclub/openpype/issues" From 3822b8e7f24bbe9754793c77ced8d152fb172a02 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 8 May 2023 16:29:32 +0800 Subject: [PATCH 083/207] refractor the render creator --- openpype/hosts/max/plugins/create/create_render.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index e9952c3124..136ca028ac 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -22,13 +22,9 @@ class CreateRender(plugin.MaxCreator): container = rt.GetNodeByName(container_name) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container - sel_obj = None - if self.selected_nodes: - sel_obj = list(self.selected_nodes) - for obj in sel_obj: - obj.parent = container - - # set viewport camera for rendering(mandatory for deadline) - RenderSettings().set_render_camera(sel_obj) + sel_obj = self.selected_nodes + if sel_obj: + # set viewport camera for rendering(mandatory for deadline) + RenderSettings().set_render_camera(sel_obj) # set output paths for rendering(mandatory for deadline) RenderSettings().render_output(container_name) From d485fdbecf432f4097a48c91d6e242b94c80a9a1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 8 May 2023 16:31:15 +0800 Subject: [PATCH 084/207] hound fix --- openpype/hosts/max/plugins/create/create_render.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 136ca028ac..2ea993494b 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -19,7 +19,6 @@ class CreateRender(plugin.MaxCreator): instance_data, pre_create_data) container_name = instance.data.get("instance_node") - container = rt.GetNodeByName(container_name) # TODO: Disable "Add to Containers?" Panel # parent the selected cameras into the container sel_obj = self.selected_nodes From d6d022989f5c2e8897abd27c3d80b4b5a23b5e77 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 8 May 2023 16:32:52 +0800 Subject: [PATCH 085/207] hound fix --- openpype/hosts/max/plugins/create/create_render.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 2ea993494b..9b677a615f 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -13,7 +13,6 @@ class CreateRender(plugin.MaxCreator): def create(self, subset_name, instance_data, pre_create_data): """Plugin entry point.""" - from pymxs import runtime as rt # noqa: WPS433,I001 instance = super().create( subset_name, instance_data, From 8830e63fb010d4cea374bdbbf095d81078e08ac2 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 9 May 2023 10:38:14 +0200 Subject: [PATCH 086/207] :recycle: add/delete action from container --- openpype/hosts/max/api/plugin.py | 37 ++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index a464d54b33..8df620b913 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -22,7 +22,8 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" rollout OPparams "OP Parameters" ( listbox list_node "Node References" items:#() - button button_add "Add Selection" + button button_add "Add to Container" + button button_del "Delete from Container" fn node_to_name the_node = ( @@ -34,8 +35,8 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" on button_add pressed do ( - current_selection = selectByName title:"Select Objects To Add To - Container" buttontext:"Add" + current_selection = selectByName title:"Select Objects to add to + the Container" buttontext:"Add" temp_arr = #() i_node_arr = #() for c in current_selection do @@ -45,8 +46,33 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" append temp_arr handle_name append i_node_arr node_ref ) - all_handles = i_node_arr - list_node.items = temp_arr + all_handles = join i_node_arr all_handles + list_node.items = join temp_arr list_node.items + ) + + on button_del pressed do + ( + current_selection = selectByName title:"Select Objects to remove + from the Container" buttontext:"Remove" + temp_arr = #() + i_node_arr = #() + for c in current_selection do + ( + node_ref = NodeTransformMonitor node:c + handle_name = node_to_name c + idx = finditem all_handles node_ref + if idx do + ( + DeleteItem all_nodes idx + ) + idx = finditem list_node.items handle_name + if idx do + ( + DeleteItem list_node.items idx + ) + ) + all_handles = join i_node_arr all_handles + list_node.items = join temp_arr list_node.items ) on OPparams open do @@ -56,7 +82,6 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" temp_arr = #() for x in all_handles do ( - print(x.node) handle_name = node_to_name x.node append temp_arr handle_name ) From 564da974b19f0c16c88b540d0c1fd5cf7b5864cc Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 9 May 2023 21:47:04 +0800 Subject: [PATCH 087/207] add up-versioning to the max loader --- .../hosts/max/plugins/load/load_camera_fbx.py | 31 ++++++++++++++++--- .../hosts/max/plugins/load/load_model_fbx.py | 8 +++++ .../hosts/max/plugins/load/load_model_obj.py | 3 ++ .../hosts/max/plugins/load/load_pointcache.py | 22 ++++++++++--- .../hosts/max/plugins/load/load_pointcloud.py | 14 ++++++--- 5 files changed, 64 insertions(+), 14 deletions(-) diff --git a/openpype/hosts/max/plugins/load/load_camera_fbx.py b/openpype/hosts/max/plugins/load/load_camera_fbx.py index 3a6947798e..183a6f5d45 100644 --- a/openpype/hosts/max/plugins/load/load_camera_fbx.py +++ b/openpype/hosts/max/plugins/load/load_camera_fbx.py @@ -4,7 +4,7 @@ from openpype.pipeline import ( get_representation_path ) from openpype.hosts.max.api.pipeline import containerise -from openpype.hosts.max.api import lib +from openpype.hosts.max.api import lib, maintained_selection class FbxLoader(load.LoaderPlugin): @@ -36,7 +36,13 @@ importFile @"{filepath}" #noPrompt using:FBXIMP self.log.debug(f"Executing command: {fbx_import_cmd}") rt.execute(fbx_import_cmd) - container_name = f"{name}_CON" + # create "missing" container for obj import + container = rt.container() + container.name = f"{name}" + + # get current selection + for selection in rt.getCurrentSelection(): + selection.Parent = container asset = rt.getNodeByName(f"{name}") @@ -48,15 +54,30 @@ importFile @"{filepath}" #noPrompt using:FBXIMP path = get_representation_path(representation) node = rt.getNodeByName(container["instance_node"]) + rt.select(node.Children) + fbx_reimport_cmd = ( + f""" - fbx_objects = self.get_container_children(node) - for fbx_object in fbx_objects: - fbx_object.source = path +FBXImporterSetParam "Animation" true +FBXImporterSetParam "Cameras" true +FBXImporterSetParam "AxisConversionMethod" true +FbxExporterSetParam "UpAxis" "Y" +FbxExporterSetParam "Preserveinstances" true + +importFile @"{path}" #noPrompt using:FBXIMP + """) + rt.execute(fbx_reimport_cmd) + + with maintained_selection(): + rt.select(node) lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) }) + def switch(self, container, representation): + self.update(container, representation) + def remove(self, container): from pymxs import runtime as rt diff --git a/openpype/hosts/max/plugins/load/load_model_fbx.py b/openpype/hosts/max/plugins/load/load_model_fbx.py index 88b8f1ed89..b8485ca333 100644 --- a/openpype/hosts/max/plugins/load/load_model_fbx.py +++ b/openpype/hosts/max/plugins/load/load_model_fbx.py @@ -37,6 +37,14 @@ importFile @"{filepath}" #noPrompt using:FBXIMP self.log.debug(f"Executing command: {fbx_import_cmd}") rt.execute(fbx_import_cmd) + # create "missing" container for obj import + container = rt.container() + container.name = f"{name}" + + # get current selection + for selection in rt.getCurrentSelection(): + selection.Parent = container + asset = rt.getNodeByName(f"{name}") return containerise( diff --git a/openpype/hosts/max/plugins/load/load_model_obj.py b/openpype/hosts/max/plugins/load/load_model_obj.py index c55e462111..ae42e1f3d3 100644 --- a/openpype/hosts/max/plugins/load/load_model_obj.py +++ b/openpype/hosts/max/plugins/load/load_model_obj.py @@ -61,6 +61,9 @@ class ObjLoader(load.LoaderPlugin): "representation": str(representation["_id"]) }) + def switch(self, container, representation): + self.update(container, representation) + def remove(self, container): from pymxs import runtime as rt diff --git a/openpype/hosts/max/plugins/load/load_pointcache.py b/openpype/hosts/max/plugins/load/load_pointcache.py index b3e12adc7b..2001b78aba 100644 --- a/openpype/hosts/max/plugins/load/load_pointcache.py +++ b/openpype/hosts/max/plugins/load/load_pointcache.py @@ -9,7 +9,7 @@ from openpype.pipeline import ( load, get_representation_path ) from openpype.hosts.max.api.pipeline import containerise -from openpype.hosts.max.api import lib +from openpype.hosts.max.api import lib, maintained_selection class AbcLoader(load.LoaderPlugin): @@ -65,14 +65,26 @@ importFile @"{file_path}" #noPrompt path = get_representation_path(representation) node = rt.getNodeByName(container["instance_node"]) - alembic_objects = self.get_container_children(node, "AlembicObject") - for alembic_object in alembic_objects: - alembic_object.source = path - lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) }) + rt.select(node.Children) + + for alembic in rt.selection: + abc = rt.getNodeByName(alembic.name) + rt.select(abc.Children) + for abc_con in rt.selection: + container = rt.getNodeByName(abc_con.name) + container.source = path + rt.select(container.Children) + for abc_obj in rt.selection: + alembic_obj = rt.getNodeByName(abc_obj.name) + alembic_obj.source = path + + with maintained_selection(): + rt.select(node) + def switch(self, container, representation): self.update(container, representation) diff --git a/openpype/hosts/max/plugins/load/load_pointcloud.py b/openpype/hosts/max/plugins/load/load_pointcloud.py index 27bc88b4f3..d4ae721c8a 100644 --- a/openpype/hosts/max/plugins/load/load_pointcloud.py +++ b/openpype/hosts/max/plugins/load/load_pointcloud.py @@ -3,7 +3,7 @@ from openpype.pipeline import ( load, get_representation_path ) from openpype.hosts.max.api.pipeline import containerise -from openpype.hosts.max.api import lib +from openpype.hosts.max.api import lib, maintained_selection class PointCloudLoader(load.LoaderPlugin): @@ -34,15 +34,21 @@ class PointCloudLoader(load.LoaderPlugin): path = get_representation_path(representation) node = rt.getNodeByName(container["instance_node"]) + rt.select(node.Children) + for prt in rt.selection: + prt_object = rt.getNodeByName(prt.name) + prt_object.filename = path - prt_objects = self.get_container_children(node) - for prt_object in prt_objects: - prt_object.source = path + with maintained_selection(): + rt.select(node) lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) }) + def switch(self, container, representation): + self.update(container, representation) + def remove(self, container): """remove the container""" from pymxs import runtime as rt From da56583d198002865bcd9530c7b209c5b56ad66e Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 9 May 2023 21:48:33 +0800 Subject: [PATCH 088/207] select the member data before exporting usd in the usd extractor --- openpype/hosts/max/plugins/publish/extract_model_usd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/hosts/max/plugins/publish/extract_model_usd.py b/openpype/hosts/max/plugins/publish/extract_model_usd.py index df1e7a4f02..2500e6c905 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_usd.py +++ b/openpype/hosts/max/plugins/publish/extract_model_usd.py @@ -44,6 +44,7 @@ class ExtractModelUSD(publish.Extractor, with maintained_selection(): # select and export node_list = instance.data["members"] + rt.select(node_list) rt.USDExporter.ExportFile(asset_filepath, exportOptions=export_options, contentSource=rt.Name("selected"), From 33335a3e89c0c4d96af93c8983c29160f59a6135 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 9 May 2023 23:25:37 +0800 Subject: [PATCH 089/207] fix the update and load function of the max scene loader --- .../hosts/max/plugins/load/load_max_scene.py | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/openpype/hosts/max/plugins/load/load_max_scene.py b/openpype/hosts/max/plugins/load/load_max_scene.py index 4b19cd671f..cffc4ae559 100644 --- a/openpype/hosts/max/plugins/load/load_max_scene.py +++ b/openpype/hosts/max/plugins/load/load_max_scene.py @@ -26,20 +26,16 @@ class MaxSceneLoader(load.LoaderPlugin): merge_before = { c for c in rt.rootNode.Children - if rt.classOf(c) == rt.Container } rt.mergeMaxFile(path) merge_after = { c for c in rt.rootNode.Children - if rt.classOf(c) == rt.Container } - max_containers = merge_after.difference(merge_before) - - if len(max_containers) != 1: - self.log.error("Something failed when loading.") - - max_container = max_containers.pop() + max_objects = merge_after.difference(merge_before) + max_container = rt.container(name=f"{name}") + for max_object in max_objects: + max_object.Parent = max_container return containerise( name, [max_container], context, loader=self.__class__.__name__) @@ -48,15 +44,30 @@ class MaxSceneLoader(load.LoaderPlugin): from pymxs import runtime as rt path = get_representation_path(representation) - node = rt.getNodeByName(container["instance_node"]) - max_objects = node.Children + node_name = container["instance_node"] + instance_name, _ = node_name.split("_") + merge_before = { + c for c in rt.rootNode.Children + } + rt.mergeMaxFile(path, + rt.Name("noRedraw"), + rt.Name("deleteOldDups"), + rt.Name("useSceneMtlDups")) + merge_after = { + c for c in rt.rootNode.Children + } + max_objects = merge_after.difference(merge_before) + container_node = rt.getNodeByName(instance_name) for max_object in max_objects: - max_object.source = path + max_object.Parent = container_node lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) }) + def switch(self, container, representation): + self.update(container, representation) + def remove(self, container): from pymxs import runtime as rt From afb6bd9ba53f6fb030eaed635ae18d456a04e0d5 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 23 May 2023 00:57:15 +0800 Subject: [PATCH 090/207] restore the code in abc extractor --- openpype/hosts/max/plugins/publish/extract_camera_abc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/max/plugins/publish/extract_camera_abc.py b/openpype/hosts/max/plugins/publish/extract_camera_abc.py index 0a4f64508a..d53c47fb51 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_abc.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_abc.py @@ -19,8 +19,8 @@ class ExtractCameraAlembic(publish.Extractor, OptionalPyblishPluginMixin): def process(self, instance): if not self.is_active(instance.data): return - start = float(instance.data.get("frameStart", 1)) - end = float(instance.data.get("frameEnd", 1)) + start = float(instance.data.get("frameStartHandle", 1)) + end = float(instance.data.get("frameEndHandle", 1)) container = instance.data["instance_node"] From 63d820436599fb7f3dfe54b6d86b58cbb1e35639 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 23 May 2023 15:46:16 +0800 Subject: [PATCH 091/207] Jakub's comment --- openpype/hosts/max/plugins/create/create_render.py | 2 +- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 9b677a615f..4523d3d411 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -23,6 +23,6 @@ class CreateRender(plugin.MaxCreator): sel_obj = self.selected_nodes if sel_obj: # set viewport camera for rendering(mandatory for deadline) - RenderSettings().set_render_camera(sel_obj) + RenderSettings(self.project_settings).set_render_camera(sel_obj) # set output paths for rendering(mandatory for deadline) RenderSettings().render_output(container_name) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index c807885859..9e1e7fdc72 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -5,7 +5,6 @@ from pymxs import runtime as rt from openpype.hosts.max.api import ( maintained_selection ) -from openpype.settings import get_project_settings class ExtractPointCloud(publish.Extractor): @@ -148,9 +147,7 @@ class ExtractPointCloud(publish.Extractor): @staticmethod def get_setting(instance): - project_setting = get_project_settings( - instance.context.data["projectName"] - ) + project_setting = instance.context.data["project_settings"] return project_setting["max"]["PointCloud"] def get_custom_attr(self, operator): From 8ac4cb499e9106c6f08b5beb2e933102a6b3ca3e Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 23 May 2023 15:50:07 +0200 Subject: [PATCH 092/207] :rotating_light: style changes --- openpype/hosts/max/api/lib.py | 20 ++- openpype/hosts/max/api/plugin.py | 52 ++++--- .../hosts/max/plugins/create/create_render.py | 5 +- .../hosts/max/plugins/load/load_camera_fbx.py | 30 ++-- .../hosts/max/plugins/load/load_max_scene.py | 37 ++--- openpype/hosts/max/plugins/load/load_model.py | 45 +++--- .../hosts/max/plugins/load/load_model_fbx.py | 34 ++-- .../hosts/max/plugins/load/load_model_obj.py | 40 +++-- .../hosts/max/plugins/load/load_model_usd.py | 28 ++-- .../hosts/max/plugins/load/load_pointcache.py | 52 +++---- .../hosts/max/plugins/load/load_pointcloud.py | 33 ++-- .../max/plugins/publish/collect_members.py | 7 +- .../max/plugins/publish/extract_camera_abc.py | 24 +-- .../max/plugins/publish/extract_camera_fbx.py | 22 ++- .../max/plugins/publish/extract_model_usd.py | 17 +- .../max/plugins/publish/extract_pointcloud.py | 13 +- .../publish/validate_model_contents.py | 3 +- poetry.lock | 24 +-- setup.cfg | 146 +----------------- 19 files changed, 221 insertions(+), 411 deletions(-) diff --git a/openpype/hosts/max/api/lib.py b/openpype/hosts/max/api/lib.py index 132896805f..5718d8f112 100644 --- a/openpype/hosts/max/api/lib.py +++ b/openpype/hosts/max/api/lib.py @@ -1,16 +1,13 @@ # -*- coding: utf-8 -*- """Library of functions useful for 3dsmax pipeline.""" -import json -import six -from pymxs import runtime as rt -from typing import Union, Any, Dict import contextlib +import json +from typing import Any, Dict, Union +import six from openpype.pipeline.context_tools import ( - get_current_project_asset, - get_current_project -) - + get_current_project, get_current_project_asset,) +from pymxs import runtime as rt JSON_PREFIX = "JSON::" @@ -22,7 +19,7 @@ def imprint(node_name: str, data: dict) -> bool: for k, v in data.items(): if isinstance(v, (dict, list)): - rt.SetUserProp(node, k, f'{JSON_PREFIX}{json.dumps(v)}') + rt.SetUserProp(node, k, f"{JSON_PREFIX}{json.dumps(v)}") else: rt.SetUserProp(node, k, v) @@ -171,7 +168,7 @@ def set_scene_resolution(width: int, height: int): """ # make sure the render dialog is closed # for the update of resolution - # Changing the Render Setup dialog settingsshould be done + # Changing the Render Setup dialog settings should be done # with the actual Render Setup dialog in a closed state. if rt.renderSceneDialog.isOpen(): rt.renderSceneDialog.close() @@ -179,6 +176,7 @@ def set_scene_resolution(width: int, height: int): rt.renderWidth = width rt.renderHeight = height + def reset_scene_resolution(): """Apply the scene resolution from the project definition @@ -248,7 +246,7 @@ def reset_frame_range(fps: bool = True): frange_cmd = ( f"animationRange = interval {frame_start_handle} {frame_end_handle}" ) - rt.execute(frange_cmd) + rt.Execute(frange_cmd) set_render_frame_range(frame_start_handle, frame_end_handle) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 8df620b913..583e9dc1fb 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -1,16 +1,14 @@ # -*- coding: utf-8 -*- """3dsmax specific Avalon/Pyblish plugin definitions.""" -from pymxs import runtime as rt -from typing import Union -import six from abc import ABCMeta -from openpype.pipeline import ( - CreatorError, - Creator, - CreatedInstance -) + +import six +from pymxs import runtime as rt + from openpype.lib import BoolDef -from .lib import imprint, read, lsattr +from openpype.pipeline import CreatedInstance, Creator, CreatorError + +from .lib import imprint, lsattr, read MS_CUSTOM_ATTRIB = """attributes "openPypeData" ( @@ -100,17 +98,18 @@ class MaxCreatorBase(object): @staticmethod def cache_subsets(shared_data): - if shared_data.get("max_cached_subsets") is None: - shared_data["max_cached_subsets"] = {} - cached_instances = lsattr("id", "pyblish.avalon.instance") - for i in cached_instances: - creator_id = rt.getUserProp(i, "creator_identifier") - if creator_id not in shared_data["max_cached_subsets"]: - shared_data["max_cached_subsets"][creator_id] = [i.name] - else: - shared_data[ - "max_cached_subsets"][creator_id].append( - i.name) # noqa + if shared_data.get("max_cached_subsets"): + return shared_data + + shared_data["max_cached_subsets"] = {} + cached_instances = lsattr("id", "pyblish.avalon.instance") + for i in cached_instances: + creator_id = rt.GetUserProp(i, "creator_identifier") + if creator_id not in shared_data["max_cached_subsets"]: + shared_data["max_cached_subsets"][creator_id] = [i.name] + else: + shared_data[ + "max_cached_subsets"][creator_id].append(i.name) return shared_data @staticmethod @@ -127,9 +126,9 @@ class MaxCreatorBase(object): instance """ if isinstance(node, str): - node = rt.container(name=node) + node = rt.Container(name=node) - attrs = rt.execute(MS_CUSTOM_ATTRIB) + attrs = rt.Execute(MS_CUSTOM_ATTRIB) rt.custAttributes.add(node.baseObject, attrs) return node @@ -141,7 +140,7 @@ class MaxCreator(Creator, MaxCreatorBase): def create(self, subset_name, instance_data, pre_create_data): if pre_create_data.get("use_selection"): - self.selected_nodes = rt.getCurrentSelection() + self.selected_nodes = rt.GetCurrentSelection() instance_node = self.create_instance_node(subset_name) instance_data["instance_node"] = instance_node.name @@ -196,9 +195,12 @@ class MaxCreator(Creator, MaxCreatorBase): """ for instance in instances: - if instance_node := rt.GetNodeByName(instance.data.get("instance_node")): # noqa + if instance_node := rt.GetNodeByName( + instance.data.get("instance_node")): rt.Select(instance_node) - rt.execute(f'for o in selection do for c in o.children do c.parent = undefined') # noqa + rt.Execute( + ("for o in selection do " + "for c in o.children do c.parent = undefined")) rt.Delete(instance_node) self._remove_instance_from_context(instance) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 4523d3d411..5b35453579 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -18,10 +18,7 @@ class CreateRender(plugin.MaxCreator): instance_data, pre_create_data) container_name = instance.data.get("instance_node") - # TODO: Disable "Add to Containers?" Panel - # parent the selected cameras into the container - sel_obj = self.selected_nodes - if sel_obj: + if sel_obj := self.selected_nodes: # set viewport camera for rendering(mandatory for deadline) RenderSettings(self.project_settings).set_render_camera(sel_obj) # set output paths for rendering(mandatory for deadline) diff --git a/openpype/hosts/max/plugins/load/load_camera_fbx.py b/openpype/hosts/max/plugins/load/load_camera_fbx.py index 35d7f4bad2..c51900dbb7 100644 --- a/openpype/hosts/max/plugins/load/load_camera_fbx.py +++ b/openpype/hosts/max/plugins/load/load_camera_fbx.py @@ -1,14 +1,12 @@ import os -from openpype.pipeline import ( - load, - get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib, maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class FbxLoader(load.LoaderPlugin): - """Fbx Loader""" + """Fbx Loader.""" families = ["camera"] representations = ["fbx"] @@ -24,17 +22,17 @@ class FbxLoader(load.LoaderPlugin): rt.FBXImporterSetParam("Camera", True) rt.FBXImporterSetParam("AxisConversionMethod", True) rt.FBXImporterSetParam("Preserveinstances", True) - rt.importFile( + rt.ImportFile( filepath, rt.name("noPrompt"), using=rt.FBXIMP) - container = rt.getNodeByName(f"{name}") + container = rt.GetNodeByName(f"{name}") if not container: - container = rt.container() + container = rt.Container() container.name = f"{name}" - for selection in rt.getCurrentSelection(): + for selection in rt.GetCurrentSelection(): selection.Parent = container return containerise( @@ -44,8 +42,8 @@ class FbxLoader(load.LoaderPlugin): from pymxs import runtime as rt path = get_representation_path(representation) - node = rt.getNodeByName(container["instance_node"]) - rt.select(node.Children) + node = rt.GetNodeByName(container["instance_node"]) + rt.Select(node.Children) fbx_reimport_cmd = ( f""" @@ -57,10 +55,10 @@ FbxExporterSetParam "Preserveinstances" true importFile @"{path}" #noPrompt using:FBXIMP """) - rt.execute(fbx_reimport_cmd) + rt.Execute(fbx_reimport_cmd) with maintained_selection(): - rt.select(node) + rt.Select(node) lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) @@ -72,5 +70,5 @@ importFile @"{path}" #noPrompt using:FBXIMP def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) diff --git a/openpype/hosts/max/plugins/load/load_max_scene.py b/openpype/hosts/max/plugins/load/load_max_scene.py index cffc4ae559..4d9367b16f 100644 --- a/openpype/hosts/max/plugins/load/load_max_scene.py +++ b/openpype/hosts/max/plugins/load/load_max_scene.py @@ -1,13 +1,12 @@ import os -from openpype.pipeline import ( - load, get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class MaxSceneLoader(load.LoaderPlugin): - """Max Scene Loader""" + """Max Scene Loader.""" families = ["camera", "maxScene", @@ -24,16 +23,12 @@ class MaxSceneLoader(load.LoaderPlugin): # import the max scene by using "merge file" path = path.replace('\\', '/') - merge_before = { - c for c in rt.rootNode.Children - } - rt.mergeMaxFile(path) + merge_before = set(rt.RootNode.Children) + rt.MergeMaxFile(path) - merge_after = { - c for c in rt.rootNode.Children - } + merge_after = set(rt.RootNode.Children) max_objects = merge_after.difference(merge_before) - max_container = rt.container(name=f"{name}") + max_container = rt.Container(name=f"{name}") for max_object in max_objects: max_object.Parent = max_container @@ -46,18 +41,14 @@ class MaxSceneLoader(load.LoaderPlugin): path = get_representation_path(representation) node_name = container["instance_node"] instance_name, _ = node_name.split("_") - merge_before = { - c for c in rt.rootNode.Children - } - rt.mergeMaxFile(path, + merge_before = set(rt.RootNode.Children) + rt.MergeMaxFile(path, rt.Name("noRedraw"), rt.Name("deleteOldDups"), rt.Name("useSceneMtlDups")) - merge_after = { - c for c in rt.rootNode.Children - } + merge_after = set(rt.EootNode.Children) max_objects = merge_after.difference(merge_before) - container_node = rt.getNodeByName(instance_name) + container_node = rt.GetNodeByName(instance_name) for max_object in max_objects: max_object.Parent = container_node @@ -71,5 +62,5 @@ class MaxSceneLoader(load.LoaderPlugin): def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) diff --git a/openpype/hosts/max/plugins/load/load_model.py b/openpype/hosts/max/plugins/load/load_model.py index 95ee014e07..662b9fcb87 100644 --- a/openpype/hosts/max/plugins/load/load_model.py +++ b/openpype/hosts/max/plugins/load/load_model.py @@ -1,11 +1,10 @@ import os -from openpype.pipeline import ( - load, get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib from openpype.hosts.max.api.lib import maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class ModelAbcLoader(load.LoaderPlugin): @@ -24,8 +23,8 @@ class ModelAbcLoader(load.LoaderPlugin): file_path = os.path.normpath(self.fname) abc_before = { - c for c in rt.rootNode.Children - if rt.classOf(c) == rt.AlembicContainer + c for c in rt.RootNode.Children + if rt.ClassOf(c) == rt.AlembicContainer } abc_import_cmd = (f""" @@ -38,11 +37,11 @@ importFile @"{file_path}" #noPrompt """) self.log.debug(f"Executing command: {abc_import_cmd}") - rt.execute(abc_import_cmd) + rt.Execute(abc_import_cmd) abc_after = { - c for c in rt.rootNode.Children - if rt.classOf(c) == rt.AlembicContainer + c for c in rt.RootNode.Children + if rt.ClassOf(c) == rt.AlembicContainer } # This should yield new AlembicContainer node @@ -59,22 +58,22 @@ importFile @"{file_path}" #noPrompt def update(self, container, representation): from pymxs import runtime as rt path = get_representation_path(representation) - node = rt.getNodeByName(container["instance_node"]) - rt.select(node.Children) + node = rt.GetNodeByName(container["instance_node"]) + rt.Select(node.Children) - for alembic in rt.selection: - abc = rt.getNodeByName(alembic.name) - rt.select(abc.Children) - for abc_con in rt.selection: - container = rt.getNodeByName(abc_con.name) + for alembic in rt.Selection: + abc = rt.GetNodeByName(alembic.name) + rt.Select(abc.Children) + for abc_con in rt.Selection: + container = rt.GetNodeByName(abc_con.name) container.source = path - rt.select(container.Children) - for abc_obj in rt.selection: - alembic_obj = rt.getNodeByName(abc_obj.name) + rt.Select(container.Children) + for abc_obj in rt.Selection: + alembic_obj = rt.GetNodeByName(abc_obj.name) alembic_obj.source = path with maintained_selection(): - rt.select(node) + rt.Select(node) lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) @@ -86,8 +85,8 @@ importFile @"{file_path}" #noPrompt def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) @staticmethod def get_container_children(parent, type_name): @@ -102,7 +101,7 @@ importFile @"{file_path}" #noPrompt filtered = [] for child in list_children(parent): - class_type = str(rt.classOf(child.baseObject)) + class_type = str(rt.ClassOf(child.baseObject)) if class_type == type_name: filtered.append(child) diff --git a/openpype/hosts/max/plugins/load/load_model_fbx.py b/openpype/hosts/max/plugins/load/load_model_fbx.py index 01e6acae12..2aef6f02c2 100644 --- a/openpype/hosts/max/plugins/load/load_model_fbx.py +++ b/openpype/hosts/max/plugins/load/load_model_fbx.py @@ -1,15 +1,13 @@ import os -from openpype.pipeline import ( - load, - get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib from openpype.hosts.max.api.lib import maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class FbxModelLoader(load.LoaderPlugin): - """Fbx Model Loader""" + """Fbx Model Loader.""" families = ["model"] representations = ["fbx"] @@ -24,17 +22,17 @@ class FbxModelLoader(load.LoaderPlugin): rt.FBXImporterSetParam("Animation", False) rt.FBXImporterSetParam("Cameras", False) rt.FBXImporterSetParam("Preserveinstances", True) - rt.importFile( + rt.ImportFile( filepath, - rt.name("noPrompt"), + rt.Name("noPrompt"), using=rt.FBXIMP) - container = rt.getNodeByName(f"{name}") + container = rt.GetNodeByName(name) if not container: - container = rt.container() - container.name = f"{name}" + container = rt.Container() + container.name = name - for selection in rt.getCurrentSelection(): + for selection in rt.GetCurrentSelection(): selection.Parent = container return containerise( @@ -44,8 +42,8 @@ class FbxModelLoader(load.LoaderPlugin): from pymxs import runtime as rt path = get_representation_path(representation) - node = rt.getNodeByName(container["instance_node"]) - rt.select(node.Children) + node = rt.GetNodeByName(container["instance_node"]) + rt.Select(node.Children) fbx_reimport_cmd = ( f""" FBXImporterSetParam "Animation" false @@ -56,10 +54,10 @@ FbxExporterSetParam "Preserveinstances" true importFile @"{path}" #noPrompt using:FBXIMP """) - rt.execute(fbx_reimport_cmd) + rt.Execute(fbx_reimport_cmd) with maintained_selection(): - rt.select(node) + rt.Select(node) lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) @@ -71,5 +69,5 @@ importFile @"{path}" #noPrompt using:FBXIMP def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) diff --git a/openpype/hosts/max/plugins/load/load_model_obj.py b/openpype/hosts/max/plugins/load/load_model_obj.py index ae42e1f3d3..77d4e08cfb 100644 --- a/openpype/hosts/max/plugins/load/load_model_obj.py +++ b/openpype/hosts/max/plugins/load/load_model_obj.py @@ -1,15 +1,13 @@ import os -from openpype.pipeline import ( - load, - get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib from openpype.hosts.max.api.lib import maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class ObjLoader(load.LoaderPlugin): - """Obj Loader""" + """Obj Loader.""" families = ["model"] representations = ["obj"] @@ -21,18 +19,18 @@ class ObjLoader(load.LoaderPlugin): from pymxs import runtime as rt filepath = os.path.normpath(self.fname) - self.log.debug(f"Executing command to import..") + self.log.debug("Executing command to import..") - rt.execute(f'importFile @"{filepath}" #noPrompt using:ObjImp') + rt.Execute(f'importFile @"{filepath}" #noPrompt using:ObjImp') # create "missing" container for obj import - container = rt.container() - container.name = f"{name}" + container = rt.Container() + container.name = name # get current selection - for selection in rt.getCurrentSelection(): + for selection in rt.GetCurrentSelection(): selection.Parent = container - asset = rt.getNodeByName(f"{name}") + asset = rt.GetNodeByName(name) return containerise( name, [asset], context, loader=self.__class__.__name__) @@ -42,20 +40,20 @@ class ObjLoader(load.LoaderPlugin): path = get_representation_path(representation) node_name = container["instance_node"] - node = rt.getNodeByName(node_name) + node = rt.GetNodeByName(node_name) instance_name, _ = node_name.split("_") - container = rt.getNodeByName(instance_name) - for n in container.Children: - rt.delete(n) + container = rt.GetNodeByName(instance_name) + for child in container.Children: + rt.Delete(child) - rt.execute(f'importFile @"{path}" #noPrompt using:ObjImp') + rt.Execute(f'importFile @"{path}" #noPrompt using:ObjImp') # get current selection - for selection in rt.getCurrentSelection(): + for selection in rt.GetCurrentSelection(): selection.Parent = container with maintained_selection(): - rt.select(node) + rt.Select(node) lib.imprint(node_name, { "representation": str(representation["_id"]) @@ -67,5 +65,5 @@ class ObjLoader(load.LoaderPlugin): def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) diff --git a/openpype/hosts/max/plugins/load/load_model_usd.py b/openpype/hosts/max/plugins/load/load_model_usd.py index 143f91f40b..2b34669278 100644 --- a/openpype/hosts/max/plugins/load/load_model_usd.py +++ b/openpype/hosts/max/plugins/load/load_model_usd.py @@ -1,10 +1,9 @@ import os -from openpype.pipeline import ( - load, get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib from openpype.hosts.max.api.lib import maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class ModelUSDLoader(load.LoaderPlugin): @@ -19,6 +18,7 @@ class ModelUSDLoader(load.LoaderPlugin): def load(self, context, name=None, namespace=None, data=None): from pymxs import runtime as rt + # asset_filepath filepath = os.path.normpath(self.fname) import_options = rt.USDImporter.CreateOptions() @@ -27,11 +27,11 @@ class ModelUSDLoader(load.LoaderPlugin): log_filepath = filepath.replace(ext, "txt") rt.LogPath = log_filepath - rt.LogLevel = rt.name('info') + rt.LogLevel = rt.Name("info") rt.USDImporter.importFile(filepath, importOptions=import_options) - asset = rt.getNodeByName(f"{name}") + asset = rt.GetNodeByName(name) return containerise( name, [asset], context, loader=self.__class__.__name__) @@ -41,11 +41,11 @@ class ModelUSDLoader(load.LoaderPlugin): path = get_representation_path(representation) node_name = container["instance_node"] - node = rt.getNodeByName(node_name) + node = rt.GetNodeByName(node_name) for n in node.Children: for r in n.Children: - rt.delete(r) - rt.delete(n) + rt.Delete(r) + rt.Delete(n) instance_name, _ = node_name.split("_") import_options = rt.USDImporter.CreateOptions() @@ -54,15 +54,15 @@ class ModelUSDLoader(load.LoaderPlugin): log_filepath = path.replace(ext, "txt") rt.LogPath = log_filepath - rt.LogLevel = rt.name('info') + rt.LogLevel = rt.Name("info") rt.USDImporter.importFile(path, importOptions=import_options) - asset = rt.getNodeByName(f"{instance_name}") + asset = rt.GetNodeByName(instance_name) asset.Parent = node with maintained_selection(): - rt.select(node) + rt.Select(node) lib.imprint(node_name, { "representation": str(representation["_id"]) @@ -74,5 +74,5 @@ class ModelUSDLoader(load.LoaderPlugin): def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) diff --git a/openpype/hosts/max/plugins/load/load_pointcache.py b/openpype/hosts/max/plugins/load/load_pointcache.py index 37cb6791db..4f7773d967 100644 --- a/openpype/hosts/max/plugins/load/load_pointcache.py +++ b/openpype/hosts/max/plugins/load/load_pointcache.py @@ -5,11 +5,10 @@ Because of limited api, alembics can be only loaded, but not easily updated. """ import os -from openpype.pipeline import ( - load, get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib, maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class AbcLoader(load.LoaderPlugin): @@ -30,29 +29,28 @@ class AbcLoader(load.LoaderPlugin): file_path = os.path.normpath(self.fname) abc_before = { - c for c in rt.rootNode.Children - if rt.classOf(c) == rt.AlembicContainer + c for c in rt.RootNode.Children + if rt.ClassOf(c) == rt.AlembicContainer } rt.AlembicImport.ImportToRoot = False rt.AlembicImport.StartFrame = True rt.AlembicImport.EndFrame = True - rt.importFile(file_path, rt.name("noPrompt")) + rt.ImportFile(file_path, rt.Name("noPrompt")) abc_after = { - c for c in rt.rootNode.Children - if rt.classOf(c) == rt.AlembicContainer + c for c in rt.RootNode.Children + if rt.ClassOf(c) == rt.AlembicContainer } # This should yield new AlembicContainer node abc_containers = abc_after.difference(abc_before) - if len(abc_containers) != 1: self.log.error("Something failed when loading.") abc_container = abc_containers.pop() - for abc in rt.getCurrentSelection(): + for abc in rt.GetCurrentSelection(): for cam_shape in abc.Children: cam_shape.playbackType = 2 @@ -63,27 +61,25 @@ class AbcLoader(load.LoaderPlugin): from pymxs import runtime as rt path = get_representation_path(representation) - node = rt.getNodeByName(container["instance_node"]) + node = rt.GetNodeByName(container["instance_node"]) lib.imprint(container["instance_node"], { "representation": str(representation["_id"]) }) - rt.select(node.Children) - - for alembic in rt.selection: - abc = rt.getNodeByName(alembic.name) - rt.select(abc.Children) - for abc_con in rt.selection: - container = rt.getNodeByName(abc_con.name) - container.source = path - rt.select(container.Children) - for abc_obj in rt.selection: - alembic_obj = rt.getNodeByName(abc_obj.name) - alembic_obj.source = path - with maintained_selection(): - rt.select(node) + rt.Select(node.Children) + + for alembic in rt.Selection: + abc = rt.GetNodeByName(alembic.name) + rt.Select(abc.Children) + for abc_con in rt.Selection: + container = rt.GetNodeByName(abc_con.name) + container.source = path + rt.Select(container.Children) + for abc_obj in rt.Selection: + alembic_obj = rt.GetNodeByName(abc_obj.name) + alembic_obj.source = path def switch(self, container, representation): self.update(container, representation) @@ -91,8 +87,8 @@ class AbcLoader(load.LoaderPlugin): def remove(self, container): from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) @staticmethod def get_container_children(parent, type_name): diff --git a/openpype/hosts/max/plugins/load/load_pointcloud.py b/openpype/hosts/max/plugins/load/load_pointcloud.py index d4ae721c8a..8634e1d51f 100644 --- a/openpype/hosts/max/plugins/load/load_pointcloud.py +++ b/openpype/hosts/max/plugins/load/load_pointcloud.py @@ -1,13 +1,12 @@ import os -from openpype.pipeline import ( - load, get_representation_path -) -from openpype.hosts.max.api.pipeline import containerise + from openpype.hosts.max.api import lib, maintained_selection +from openpype.hosts.max.api.pipeline import containerise +from openpype.pipeline import get_representation_path, load class PointCloudLoader(load.LoaderPlugin): - """Point Cloud Loader""" + """Point Cloud Loader.""" families = ["pointcloud"] representations = ["prt"] @@ -23,7 +22,7 @@ class PointCloudLoader(load.LoaderPlugin): obj = rt.tyCache() obj.filename = filepath - prt_container = rt.getNodeByName(f"{obj.name}") + prt_container = rt.GetNodeByName(obj.name) return containerise( name, [prt_container], context, loader=self.__class__.__name__) @@ -33,18 +32,16 @@ class PointCloudLoader(load.LoaderPlugin): from pymxs import runtime as rt path = get_representation_path(representation) - node = rt.getNodeByName(container["instance_node"]) - rt.select(node.Children) - for prt in rt.selection: - prt_object = rt.getNodeByName(prt.name) - prt_object.filename = path - + node = rt.GetNodeByName(container["instance_node"]) with maintained_selection(): - rt.select(node) + rt.Select(node.Children) + for prt in rt.Selection: + prt_object = rt.GetNodeByName(prt.name) + prt_object.filename = path - lib.imprint(container["instance_node"], { - "representation": str(representation["_id"]) - }) + lib.imprint(container["instance_node"], { + "representation": str(representation["_id"]) + }) def switch(self, container, representation): self.update(container, representation) @@ -53,5 +50,5 @@ class PointCloudLoader(load.LoaderPlugin): """remove the container""" from pymxs import runtime as rt - node = rt.getNodeByName(container["instance_node"]) - rt.delete(node) + node = rt.GetNodeByName(container["instance_node"]) + rt.Delete(node) diff --git a/openpype/hosts/max/plugins/publish/collect_members.py b/openpype/hosts/max/plugins/publish/collect_members.py index 4ceb6cdadf..54020d7dae 100644 --- a/openpype/hosts/max/plugins/publish/collect_members.py +++ b/openpype/hosts/max/plugins/publish/collect_members.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -"""Collect instance members""" +"""Collect instance members.""" import pyblish.api from pymxs import runtime as rt class CollectMembers(pyblish.api.InstancePlugin): - """Collect Render for Deadline""" + """Collect Render for Deadline.""" order = pyblish.api.CollectorOrder + 0.01 label = "Collect Instance Members" @@ -16,5 +16,6 @@ class CollectMembers(pyblish.api.InstancePlugin): if instance.data.get("instance_node"): container = rt.GetNodeByName(instance.data["instance_node"]) instance.data["members"] = [ - i.node for i in container.openPypeData.all_handles + member.node for member + in container.openPypeData.all_handles ] diff --git a/openpype/hosts/max/plugins/publish/extract_camera_abc.py b/openpype/hosts/max/plugins/publish/extract_camera_abc.py index d53c47fb51..c526de8960 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_abc.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_abc.py @@ -1,14 +1,14 @@ import os + import pyblish.api -from openpype.pipeline import publish, OptionalPyblishPluginMixin from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection, get_all_children + +from openpype.hosts.max.api import get_all_children, maintained_selection +from openpype.pipeline import OptionalPyblishPluginMixin, publish class ExtractCameraAlembic(publish.Extractor, OptionalPyblishPluginMixin): - """ - Extract Camera with AlembicExport - """ + """Extract Camera with AlembicExport.""" order = pyblish.api.ExtractorOrder - 0.1 label = "Extract Alembic Camera" @@ -31,20 +31,20 @@ class ExtractCameraAlembic(publish.Extractor, OptionalPyblishPluginMixin): path = os.path.join(stagingdir, filename) # We run the render - self.log.info("Writing alembic '%s' to '%s'" % (filename, stagingdir)) + self.log.info(f"Writing alembic '{filename}' to '{stagingdir}'") - rt.AlembicExport.ArchiveType = rt.name("ogawa") - rt.AlembicExport.CoordinateSystem = rt.name("maya") + rt.AlembicExport.ArchiveType = rt.Name("ogawa") + rt.AlembicExport.CoordinateSystem = rt.Name("maya") rt.AlembicExport.StartFrame = start rt.AlembicExport.EndFrame = end rt.AlembicExport.CustomAttributes = True with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.exportFile( + rt.Select(get_all_children(rt.GetNodeByName(container))) + rt.ExportFile( path, - rt.name("noPrompt"), + rt.Name("noPrompt"), selectedOnly=True, using=rt.AlembicExport, ) @@ -62,4 +62,4 @@ class ExtractCameraAlembic(publish.Extractor, OptionalPyblishPluginMixin): "frameEnd": end, } instance.data["representations"].append(representation) - self.log.info("Extracted instance '%s' to: %s" % (instance.name, path)) + self.log.info(f"Extracted instance '{instance.name}' to: {path}") diff --git a/openpype/hosts/max/plugins/publish/extract_camera_fbx.py b/openpype/hosts/max/plugins/publish/extract_camera_fbx.py index 4b4b349e19..0c8a82dcaa 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_fbx.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_fbx.py @@ -1,14 +1,14 @@ import os + import pyblish.api -from openpype.pipeline import publish, OptionalPyblishPluginMixin from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection, get_all_children + +from openpype.hosts.max.api import get_all_children, maintained_selection +from openpype.pipeline import OptionalPyblishPluginMixin, publish class ExtractCameraFbx(publish.Extractor, OptionalPyblishPluginMixin): - """ - Extract Camera with FbxExporter - """ + """Extract Camera with FbxExporter.""" order = pyblish.api.ExtractorOrder - 0.2 label = "Extract Fbx Camera" @@ -26,7 +26,7 @@ class ExtractCameraFbx(publish.Extractor, OptionalPyblishPluginMixin): filename = "{name}.fbx".format(**instance.data) filepath = os.path.join(stagingdir, filename) - self.log.info("Writing fbx file '%s' to '%s'" % (filename, filepath)) + self.log.info(f"Writing fbx file '{filename}' to '{filepath}'") rt.FBXExporterSetParam("Animation", True) rt.FBXExporterSetParam("Cameras", True) @@ -36,10 +36,10 @@ class ExtractCameraFbx(publish.Extractor, OptionalPyblishPluginMixin): with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) - rt.exportFile( + rt.Select(get_all_children(rt.GetNodeByName(container))) + rt.ExportFile( filepath, - rt.name("noPrompt"), + rt.Name("noPrompt"), selectedOnly=True, using=rt.FBXEXP, ) @@ -55,6 +55,4 @@ class ExtractCameraFbx(publish.Extractor, OptionalPyblishPluginMixin): "stagingDir": stagingdir, } instance.data["representations"].append(representation) - self.log.info( - "Extracted instance '%s' to: %s" % (instance.name, filepath) - ) + self.log.info(f"Extracted instance '{instance.name}' to: {filepath}") diff --git a/openpype/hosts/max/plugins/publish/extract_model_usd.py b/openpype/hosts/max/plugins/publish/extract_model_usd.py index 2500e6c905..da37c77bf7 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_usd.py +++ b/openpype/hosts/max/plugins/publish/extract_model_usd.py @@ -1,20 +1,15 @@ import os + import pyblish.api -from openpype.pipeline import ( - publish, - OptionalPyblishPluginMixin -) from pymxs import runtime as rt -from openpype.hosts.max.api import ( - maintained_selection -) + +from openpype.hosts.max.api import maintained_selection +from openpype.pipeline import OptionalPyblishPluginMixin, publish class ExtractModelUSD(publish.Extractor, OptionalPyblishPluginMixin): - """ - Extract Geometry in USDA Format - """ + """Extract Geometry in USDA Format.""" order = pyblish.api.ExtractorOrder - 0.05 label = "Extract Geometry (USD)" @@ -44,7 +39,7 @@ class ExtractModelUSD(publish.Extractor, with maintained_selection(): # select and export node_list = instance.data["members"] - rt.select(node_list) + rt.Select(node_list) rt.USDExporter.ExportFile(asset_filepath, exportOptions=export_options, contentSource=rt.Name("selected"), diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 9e1e7fdc72..618f9856fd 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -1,15 +1,15 @@ import os + import pyblish.api -from openpype.pipeline import publish from pymxs import runtime as rt -from openpype.hosts.max.api import ( - maintained_selection -) + +from openpype.hosts.max.api import maintained_selection +from openpype.pipeline import publish class ExtractPointCloud(publish.Extractor): """ - Extract PRT format with tyFlow operators + Extract PRT format with tyFlow operators. Notes: Currently only works for the default partition setting @@ -112,8 +112,7 @@ class ExtractPointCloud(publish.Extractor): job_args.append(mode) additional_args = self.get_custom_attr(operator) - for args in additional_args: - job_args.append(args) + job_args.extend(iter(additional_args)) prt_export = f"{operator}.exportPRT()" job_args.append(prt_export) diff --git a/openpype/hosts/max/plugins/publish/validate_model_contents.py b/openpype/hosts/max/plugins/publish/validate_model_contents.py index 1d834292b8..1ec08d9c5f 100644 --- a/openpype/hosts/max/plugins/publish/validate_model_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_model_contents.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- import pyblish.api -from openpype.pipeline import PublishValidationError from pymxs import runtime as rt +from openpype.pipeline import PublishValidationError + class ValidateModelContent(pyblish.api.InstancePlugin): """Validates Model instance contents. diff --git a/poetry.lock b/poetry.lock index 563f905fad..f71611cb6f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry and should not be changed by hand. [[package]] name = "acre" @@ -1456,13 +1456,11 @@ python-versions = ">=3.6" files = [ {file = "lief-0.12.3-cp310-cp310-macosx_10_14_arm64.whl", hash = "sha256:66724f337e6a36cea1a9380f13b59923f276c49ca837becae2e7be93a2e245d9"}, {file = "lief-0.12.3-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:6d18aafa2028587c98f6d4387bec94346e92f2b5a8a5002f70b1cf35b1c045cc"}, - {file = "lief-0.12.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d4f69d125caaa8d5ddb574f29cc83101e165ebea1a9f18ad042eb3544081a797"}, {file = "lief-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c078d6230279ffd3bca717c79664fb8368666f610b577deb24b374607936e9c1"}, {file = "lief-0.12.3-cp310-cp310-win32.whl", hash = "sha256:e3a6af926532d0aac9e7501946134513d63217bacba666e6f7f5a0b7e15ba236"}, {file = "lief-0.12.3-cp310-cp310-win_amd64.whl", hash = "sha256:0750b72e3aa161e1fb0e2e7f571121ae05d2428aafd742ff05a7656ad2288447"}, {file = "lief-0.12.3-cp311-cp311-macosx_10_14_arm64.whl", hash = "sha256:b5c123cb99a7879d754c059e299198b34e7e30e3b64cf22e8962013db0099f47"}, {file = "lief-0.12.3-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:8bc58fa26a830df6178e36f112cb2bbdd65deff593f066d2d51434ff78386ba5"}, - {file = "lief-0.12.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:74ac6143ac6ccd813c9b068d9c5f1f9d55c8813c8b407387eb57de01c3db2d74"}, {file = "lief-0.12.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04eb6b70d646fb5bd6183575928ee23715550f161f2832cbcd8c6ff2071fb408"}, {file = "lief-0.12.3-cp311-cp311-win32.whl", hash = "sha256:7e2d0a53c403769b04adcf8df92e83c5e25f9103a052aa7f17b0a9cf057735fb"}, {file = "lief-0.12.3-cp311-cp311-win_amd64.whl", hash = "sha256:7f6395c12ee1bc4a5162f567cba96d0c72dfb660e7902e84d4f3029daf14fe33"}, @@ -1482,7 +1480,6 @@ files = [ {file = "lief-0.12.3-cp38-cp38-win_amd64.whl", hash = "sha256:b00667257b43e93d94166c959055b6147d46d302598f3ee55c194b40414c89cc"}, {file = "lief-0.12.3-cp39-cp39-macosx_10_14_arm64.whl", hash = "sha256:e6a1b5b389090d524621c2455795e1262f62dc9381bedd96f0cd72b878c4066d"}, {file = "lief-0.12.3-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:ae773196df814202c0c51056163a1478941b299512b09660a3c37be3c7fac81e"}, - {file = "lief-0.12.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:66ddf88917ec7b00752687c476bb2771dc8ec19bd7e4c0dcff1f8ef774cad4e9"}, {file = "lief-0.12.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:4a47f410032c63ac3be051d963d0337d6b47f0e94bfe8e946ab4b6c428f4d0f8"}, {file = "lief-0.12.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbd11367c2259bd1131a6c8755dcde33314324de5ea029227bfbc7d3755871e6"}, {file = "lief-0.12.3-cp39-cp39-win32.whl", hash = "sha256:2ce53e311918c3e5b54c815ef420a747208d2a88200c41cd476f3dd1eb876bcf"}, @@ -2355,7 +2352,7 @@ files = [ cffi = ">=1.4.1" [package.extras] -docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] +docs = ["sphinx (>=1.6.5)", "sphinx_rtd_theme"] tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] [[package]] @@ -3248,21 +3245,6 @@ files = [ [package.dependencies] six = "*" -[[package]] -name = "wemake-python-styleguide" -version = "0.0.1" -description = "Opinionated styleguide that we use in wemake.services projects" -category = "dev" -optional = false -python-versions = "*" -files = [ - {file = "wemake-python-styleguide-0.0.1.tar.gz", hash = "sha256:e1f47a2be6aa79ca8a1cfbbbffdd67bf4df32b76306f4c3dd2a620a2af78e671"}, - {file = "wemake_python_styleguide-0.0.1-py2.py3-none-any.whl", hash = "sha256:505a19d82f9c4f450c6f06bb8c74d86c99cabcc4d5e6d8ea70e90b13b049f34f"}, -] - -[package.dependencies] -flake8 = "*" - [[package]] name = "wheel" version = "0.38.4" @@ -3480,4 +3462,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = ">=3.9.1,<3.10" -content-hash = "45e91b47f9e6697b0eb9fdbe76981f691d389ce74bc5a0e98d72e1109b39bc63" +content-hash = "02daca205796a0f29a0d9f50707544e6804f32027eba493cd2aa7f175a00dcea" diff --git a/setup.cfg b/setup.cfg index 1d57657a19..42cacdc93c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,7 @@ [flake8] +# ignore = D203 +ignore = BLK100, W504, W503 max-line-length = 79 -strictness = short exclude = .git, __pycache__, @@ -9,149 +10,8 @@ exclude = website, openpype/vendor, *deadline/repository/custom/plugins -max-complexity = 30 -ignore = - # line break before binary operator - W503, - # line break occurred after a binary operator - W504, - # wemake-python-styleguide warnings - # See https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html for doc - # Found incorrect module name pattern - WPS102, - # Found wrong variable name - WPS110, - # Found too short name - WPS111, - # Found upper-case constant in a class - WPS115, - # Found module with too many imports - WPS201, - # Found too many module members - WPS202, - # Found overused expression - WPS204, - # Found too many local variables - WPS210, - # Found too many arguments - WPS211, - # Found too many return statements - WPS212, - # Found too many expressions - WPS213, - # Found too many methods - WPS214, - # Found too many await expressions - WPS217, - # Found line with high Jones Complexity - WPS221, - # Found too many `elif` branches - WPS223, - # Found string constant over-use - WPS226, - # Found too long try body length - WPS229, - # Found too many public instance attributes - WPS230, - # Found function with too much cognitive complexity - WPS231, - # Found module cognitive complexity that is too high - WPS232, - # Found too many imported names from a module - WPS235, - # Found too many raises in a function - WPS238, - # Found too deep nesting - WPS220, - # Found `f` string - WPS305, - # Found incorrect multi-line parameters - WPS317, - # Found extra indentation - WPS318, - # Found bracket in wrong position - WPS319, - # Found percent string formatting - WPS323, - # Found implicit string concatenation - WPS326, - # Found variables that are only used for `return` - WPS331, - # Found explicit string concatenation - WPS336, - # Found multiline conditions - WPS337, - # Found incorrect order of methods in a class - WPS338, - # Found line starting with a dot - WPS348, - # Found multiline loop - WPS352, - # Found incorrect unpacking target - WPS414, - # Found wrong keyword - WPS420, - # Found wrong function - WPS421, - # Found statement that has no effect - WPS428, - # Found nested function - WPS430, - # Found magic number - WPS432, - # Found protected attribute usage - WPS437, - # Found block variables overlap - WPS440, - # Found an infinite while loop - WPS457, - # Found a getter without a return value - WPS463, - # Found negated condition - WPS504, - # flake8-quotes warnings - # Remove bad quotes - Q000, - # Remove bad quotes from multiline string - Q001, - # Darglint warnings - # Incorrect indentation - DAR003, - # Excess parameter(s) in Docstring - DAR102, - # Excess exception(s) in Raises section - DAR402, - # pydocstyle warnings - # Missing docstring in __init_ - D107, - # White space formatting for doc strings - D2, - # First line should end with a period - D400, - # Others - # function name - N802, - # Found backslash that is used for line breaking - N400, - E501, - S105, - RST, - # Black would make changes error - BLK100, - # Imperative mood of the first line on docstrings - D401, -[isort] -profile=wemake -src_paths=isort,test -# isort configuration: -# https://github.com/timothycrosley/isort/wiki/isort-Settings -include_trailing_comma = true -use_parentheses = true -# See https://github.com/timothycrosley/isort#multi-line-output-modes -multi_line_output = 3 -# Is the same as 80 in flake8: -line_length = 79 +max-complexity = 30 [pylint.'MESSAGES CONTROL'] disable = no-member From 4a8d6f7e8c26d2e9b2439c1ce017eb784acbfa75 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 24 May 2023 00:42:34 +0800 Subject: [PATCH 093/207] remove custom attributes while removing instance --- openpype/hosts/max/api/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 8df620b913..553031d72e 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -197,8 +197,8 @@ class MaxCreator(Creator, MaxCreatorBase): """ for instance in instances: if instance_node := rt.GetNodeByName(instance.data.get("instance_node")): # noqa - rt.Select(instance_node) - rt.execute(f'for o in selection do for c in o.children do c.parent = undefined') # noqa + count = rt.custAttributes.count(instance_node) + rt.custAttributes.delete(instance_node, count) rt.Delete(instance_node) self._remove_instance_from_context(instance) From 07a969df6ec384af473e3034eb678208aa5dfc77 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 10:29:41 +0200 Subject: [PATCH 094/207] adding resolve host to the pre ocio hook --- openpype/hooks/pre_ocio_hook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index 49a042caa8..eac7d2696f 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -18,7 +18,8 @@ class OCIOEnvHook(PreLaunchHook): "houdini", "maya", "nuke", - "hiero" + "hiero", + "resolve" ] def execute(self): From ca9defe36975ec373b4c247819e4b9d0bf1fb382 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 13:11:13 +0200 Subject: [PATCH 095/207] label improvements --- openpype/pipeline/colorspace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 652304ef33..1cf7e2e192 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -360,7 +360,7 @@ def get_imageio_config( # if global settings are disabled return empty dict because # it is expected that no colorspace management is needed log.info( - "Colorspace management is disabled." + "Colorspace management is disabled globally." ) return {} @@ -482,7 +482,7 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): if not activate_global_rules: log.info( - "Global File Rules are disabled." + "Colorspace global file rules are disabled." ) return {} From 379f838f03160f0b3ae4d24df980c06be06efc59 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 14:50:59 +0200 Subject: [PATCH 096/207] distributing settings via template schemas --- .../schema_project_aftereffects.json | 18 +------- .../schema_project_blender.json | 18 +------- .../schema_project_celaction.json | 18 +------- .../projects_schema/schema_project_flame.json | 17 +------- .../schema_project_fusion.json | 17 +------- .../schema_project_harmony.json | 18 +------- .../projects_schema/schema_project_hiero.json | 17 +------- .../schema_project_houdini.json | 18 +------- .../projects_schema/schema_project_max.json | 18 +------- .../projects_schema/schema_project_maya.json | 17 +------- .../schema_project_photoshop.json | 18 +------- .../schema_project_resolve.json | 18 +------- .../schema_project_substancepainter.json | 11 ++--- .../schema_project_traypublisher.json | 18 +------- .../schema_project_tvpaint.json | 18 +------- .../schema_project_unreal.json | 18 +------- .../schema_project_webpublisher.json | 18 +------- .../schemas/schema_imageio_config.json | 20 --------- .../schemas/schema_imageio_file_rules.json | 40 ------------------ .../schemas/schema_nuke_imageio.json | 17 +------- .../template_colorspace_remapping.json | 29 +++++++++++++ ...emplate_host_color_management_derived.json | 19 +++++++++ .../template_host_color_management_ocio.json | 19 +++++++++ ...mplate_host_color_management_remapped.json | 23 ++++++++++ .../schemas/template_imageio_config.json | 22 ++++++++++ .../schemas/template_imageio_file_rules.json | 42 +++++++++++++++++++ 26 files changed, 191 insertions(+), 335 deletions(-) delete mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json delete mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json create mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json create mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_derived.json create mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_ocio.json create mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_remapped.json create mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_config.json create mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 7262c17dd5..d4f52b50d4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json index 79eea3f192..78a1552ac3 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_blender.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json index 915f199b6e..9d50e85631 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_celaction.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_derived" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 16c9378194..102e2bdcc3 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -13,21 +13,8 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_remapped" }, { "key": "project", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json index 550e7a3cf4..656c50dd98 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_fusion.json @@ -13,21 +13,8 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } ] }, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json index 276b321b24..98a815f2d4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_harmony.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json index c2339d8200..d80edf902b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_hiero.json @@ -13,21 +13,8 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" }, { "key": "workfile", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json index a7032775c1..7f782e3647 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_houdini.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json index ee2bbd4ffa..e314174dff 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_max.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_max.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json index fe7c262603..dca955dab4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_maya.json @@ -53,21 +53,8 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" }, { "key": "workfile", diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json index 7ddd575dde..20d4ff0aa3 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_photoshop.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_remapped" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json index aea019b77b..2f10cc900a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_resolve.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation.." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_remapped" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_substancepainter.json b/openpype/settings/entities/schemas/projects_schema/schema_project_substancepainter.json index 79a39b8e6e..6be8cecad3 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_substancepainter.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_substancepainter.json @@ -8,18 +8,13 @@ { "key": "imageio", "type": "dict", - "label": "Color Management (ImageIO)", + "label": "Color Management (OCIO managed)", "is_group": true, "children": [ { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 6b55837f12..3703d82856 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_derived" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json index ed8887f93e..45fc13bdde 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_tvpaint.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_derived" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json index aa2fe40b4a..b23744f406 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_unreal.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index 7b65dddda6..87de732d69 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -13,23 +13,9 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_derived" } - ] }, { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json deleted file mode 100644 index bc65dd7826..0000000000 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "key": "ocio_config", - "type": "dict", - "label": "OCIO config", - "collapsible": true, - "children": [ - { - "type": "boolean", - "key": "override_global_config", - "label": "Override global OCIO config" - }, - { - "type": "path", - "key": "filepath", - "label": "Config path", - "multiplatform": false, - "multipath": true - } - ] -} diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json deleted file mode 100644 index 62b72c2518..0000000000 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_imageio_file_rules.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "key": "file_rules", - "type": "dict", - "label": "File Rules (OCIO v1 only)", - "collapsible": true, - "children": [ - { - "type": "boolean", - "key": "override_global_rules", - "label": "Override global File Rules" - }, - { - "key": "rules", - "label": "Rules", - "type": "dict-modifiable", - "highlight_content": true, - "collapsible": false, - "object_type": { - "type": "dict", - "children": [ - { - "key": "pattern", - "label": "Regex pattern", - "type": "text" - }, - { - "key": "colorspace", - "label": "Colorspace name", - "type": "text" - }, - { - "key": "ext", - "label": "File extension", - "type": "text" - } - ] - } - } - ] -} diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json index 864e084bde..d4cd332ef8 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_imageio.json @@ -6,21 +6,8 @@ "is_group": true, "children": [ { - "type": "label", - "label": "This application's colorspace management can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." - }, - { - "type": "boolean", - "key": "activate_host_color_management", - "label": "Enable Color Management" - }, - { - "type": "schema", - "name": "schema_imageio_config" - }, - { - "type": "schema", - "name": "schema_imageio_file_rules" + "type": "template", + "name": "template_host_color_management_ocio" }, { "key": "viewer", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json new file mode 100644 index 0000000000..9ae504fa81 --- /dev/null +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json @@ -0,0 +1,29 @@ +[ + { + "key": "remapping", + "type": "dict", + "label": "Remapping colorspace names", + "collapsible": true, + "children": [ + { + "type": "list", + "key": "inputs", + "object_type": { + "type": "dict", + "children": [ + { + "type": "text", + "key": "internal_name", + "label": "Internal colorspace name" + }, + { + "type": "text", + "key": "ocio_name", + "label": "OCIO colorspace name" + } + ] + } + } + ] + } +] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_derived.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_derived.json new file mode 100644 index 0000000000..a129d470c0 --- /dev/null +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_derived.json @@ -0,0 +1,19 @@ +[ + { + "type": "label", + "label": "The application does not include any built-in color management capabilities, OpenPype offers a solution
to this limitation by deriving valid colorspace names for the OpenColorIO (OCIO) color management
system from file paths, using File Rules feature only during Publishing.

Related documentation." + }, + { + "type": "boolean", + "key": "activate_host_color_management", + "label": "Enable Color Management" + }, + { + "type": "template", + "name": "template_imageio_config" + }, + { + "type": "template", + "name": "template_imageio_file_rules" + } +] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_ocio.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_ocio.json new file mode 100644 index 0000000000..88c22fa762 --- /dev/null +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_ocio.json @@ -0,0 +1,19 @@ +[ + { + "type": "label", + "label": "Colorspace management for the application can be controlled through OpenPype settings.
Specifically, the configured OpenColorIO (OCIO) config path is utilized in the application's workfile.
Additionally, the File Rules feature can be leveraged for both publishing and loading procedures.

Related documentation." + }, + { + "type": "boolean", + "key": "activate_host_color_management", + "label": "Enable Color Management" + }, + { + "type": "template", + "name": "template_imageio_config" + }, + { + "type": "template", + "name": "template_imageio_file_rules" + } +] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_remapped.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_remapped.json new file mode 100644 index 0000000000..780264947f --- /dev/null +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_host_color_management_remapped.json @@ -0,0 +1,23 @@ +[ + { + "type": "label", + "label": "The application includes internal color management functionality, but it does not offer external control
over this feature. To address this limitation, OpenPype uses mapping rules to remap the native
colorspace names used in the internal color management system to the OpenColorIO (OCIO)
color management system. Remapping feature is used in Publishing and Loading procedures.

Related documentation.." + }, + { + "type": "boolean", + "key": "activate_host_color_management", + "label": "Enable Color Management" + }, + { + "type": "template", + "name": "template_colorspace_remapping" + }, + { + "type": "template", + "name": "template_imageio_config" + }, + { + "type": "template", + "name": "template_imageio_file_rules" + } +] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_config.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_config.json new file mode 100644 index 0000000000..0550e5093c --- /dev/null +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_config.json @@ -0,0 +1,22 @@ +[ + { + "key": "ocio_config", + "type": "dict", + "label": "OCIO config", + "collapsible": true, + "children": [ + { + "type": "boolean", + "key": "override_global_config", + "label": "Override global OCIO config" + }, + { + "type": "path", + "key": "filepath", + "label": "Config path", + "multiplatform": false, + "multipath": true + } + ] + } +] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json new file mode 100644 index 0000000000..829fd02489 --- /dev/null +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json @@ -0,0 +1,42 @@ +[ + { + "key": "file_rules", + "type": "dict", + "label": "File Rules (OCIO v1 only)", + "collapsible": true, + "children": [ + { + "type": "boolean", + "key": "override_global_rules", + "label": "Override global File Rules" + }, + { + "key": "rules", + "label": "Rules", + "type": "dict-modifiable", + "highlight_content": true, + "collapsible": false, + "object_type": { + "type": "dict", + "children": [ + { + "key": "pattern", + "label": "Regex pattern", + "type": "text" + }, + { + "key": "colorspace", + "label": "Colorspace name", + "type": "text" + }, + { + "key": "ext", + "label": "File extension", + "type": "text" + } + ] + } + } + ] + } +] From c2055622ab98880eeb5a1a3475b7c9303bdcd93d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 15:51:29 +0200 Subject: [PATCH 097/207] adding remapping functionality --- openpype/pipeline/colorspace.py | 50 +++++++++++++++++++ .../projects_schema/schema_project_flame.json | 6 ++- .../template_colorspace_remapping.json | 6 +-- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 1cf7e2e192..fa7ad5133c 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -17,6 +17,8 @@ from openpype.pipeline import Anatomy log = Logger.get_logger(__name__) +class cashed_data: + remapping: dict = None @contextlib.contextmanager def _make_temp_json_file(): @@ -497,6 +499,54 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): return frules_global["rules"] +def get_remapped_colorspace_to_native( + ocio_colorspace_name, host_name, imageio_host_settings): + """Return native colorspace name. + + Args: + ocio_colorspace_name (str | None): ocio colorspace name + + Returns: + str: native colorspace name defined in remapping or None + """ + + if not cashed_data.remapping.get(host_name): + remapping_rules = imageio_host_settings["remapping"]["rules"] + cashed_data.remapping[host_name] = { + "to_native": { + rule["ocio_name"]: input["host_native_name"] + for rule in remapping_rules + } + } + + return cashed_data.remapping[host_name]["to_native"].get( + ocio_colorspace_name) + + +def get_remapped_colorspace_from_native( + host_native_colorspace_name, host_name, imageio_host_settings): + """Return ocio colorspace name remapped from host native used name. + + Args: + host_native_colorspace_name (str): host native colorspace name + + Returns: + str: ocio colorspace name defined in remapping or None + """ + + if not cashed_data.remapping.get(host_name): + remapping_rules = imageio_host_settings["remapping"]["rules"] + cashed_data.remapping[host_name] = { + "from_native": { + input["host_native_name"]: rule["ocio_name"] + for rule in remapping_rules + } + } + + return cashed_data.remapping[host_name]["from_native"].get( + host_native_colorspace_name) + + def _get_imageio_settings(project_settings, host_name): """Get ImageIO settings for global and host diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 102e2bdcc3..06f818966f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -44,10 +44,14 @@ } ] }, + { + "type": "label", + "label": "Profile names mapping settings is deprecated use ./imagio/remapping instead" + }, { "key": "profilesMapping", "type": "dict", - "label": "Profile names mapping", + "label": "Profile names mapping [deprecated]", "collapsible": true, "children": [ { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json index 9ae504fa81..acd36ece9d 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_colorspace_remapping.json @@ -7,14 +7,14 @@ "children": [ { "type": "list", - "key": "inputs", + "key": "rules", "object_type": { "type": "dict", "children": [ { "type": "text", - "key": "internal_name", - "label": "Internal colorspace name" + "key": "host_native_name", + "label": "Application native colorspace name" }, { "type": "text", From 05b0f61e0bad1db6226812c9d77f6dadef49ded5 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 16:22:33 +0200 Subject: [PATCH 098/207] flame: adding remapping implementation --- openpype/hosts/flame/api/plugin.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/flame/api/plugin.py b/openpype/hosts/flame/api/plugin.py index df8c1ac887..3289187fa0 100644 --- a/openpype/hosts/flame/api/plugin.py +++ b/openpype/hosts/flame/api/plugin.py @@ -10,6 +10,7 @@ from qtpy import QtCore, QtWidgets from openpype import style from openpype.lib import Logger, StringTemplate from openpype.pipeline import LegacyCreator, LoaderPlugin +from openpype.pipeline.colorspace import get_remapped_colorspace_to_native from openpype.settings import get_current_project_settings from . import constants @@ -701,6 +702,7 @@ class ClipLoader(LoaderPlugin): ] _mapping = None + _host_settings = None def apply_settings(cls, project_settings, system_settings): @@ -769,15 +771,26 @@ class ClipLoader(LoaderPlugin): Returns: str: native colorspace name defined in mapping or None """ + # TODO: rewrite to support only pipeline's remapping + if not cls._host_settings: + cls._host_settings = get_current_project_settings()["flame"] + + # [Deprecated] way of remapping if not cls._mapping: - settings = get_current_project_settings()["flame"] - mapping = settings["imageio"]["profilesMapping"]["inputs"] + mapping = ( + cls._host_settings["imageio"]["profilesMapping"]["inputs"]) cls._mapping = { input["ocioName"]: input["flameName"] for input in mapping } - return cls._mapping.get(input_colorspace) + native_name = cls._mapping.get(input_colorspace) + + if not native_name: + native_name = get_remapped_colorspace_to_native( + input_colorspace, "flame", cls._host_settings["imageio"]) + + return native_name class OpenClipSolver(flib.MediaInfoFile): From 6473fac9042e9257c05c2c4020c3352c178da5f5 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 16:25:34 +0200 Subject: [PATCH 099/207] fixing cashing nested data structure --- openpype/pipeline/colorspace.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index fa7ad5133c..5c449e0a4e 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -17,9 +17,11 @@ from openpype.pipeline import Anatomy log = Logger.get_logger(__name__) + class cashed_data: remapping: dict = None + @contextlib.contextmanager def _make_temp_json_file(): """Wrapping function for json temp file @@ -510,7 +512,7 @@ def get_remapped_colorspace_to_native( str: native colorspace name defined in remapping or None """ - if not cashed_data.remapping.get(host_name): + if not cashed_data.remapping.get(host_name, {}).get("to_native"): remapping_rules = imageio_host_settings["remapping"]["rules"] cashed_data.remapping[host_name] = { "to_native": { @@ -534,7 +536,7 @@ def get_remapped_colorspace_from_native( str: ocio colorspace name defined in remapping or None """ - if not cashed_data.remapping.get(host_name): + if not cashed_data.remapping.get(host_name, {}).get("from_native"): remapping_rules = imageio_host_settings["remapping"]["rules"] cashed_data.remapping[host_name] = { "from_native": { From 31d04e492b8277bcc6c982111bb783632a8c8e1d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 16:28:23 +0200 Subject: [PATCH 100/207] cosmetics --- openpype/pipeline/colorspace.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 5c449e0a4e..f0fb7cf7f5 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -18,8 +18,8 @@ from openpype.pipeline import Anatomy log = Logger.get_logger(__name__) -class cashed_data: - remapping: dict = None +class CashedData: + remapping = None @contextlib.contextmanager @@ -512,16 +512,16 @@ def get_remapped_colorspace_to_native( str: native colorspace name defined in remapping or None """ - if not cashed_data.remapping.get(host_name, {}).get("to_native"): + if not CashedData.remapping.get(host_name, {}).get("to_native"): remapping_rules = imageio_host_settings["remapping"]["rules"] - cashed_data.remapping[host_name] = { + CashedData.remapping[host_name] = { "to_native": { rule["ocio_name"]: input["host_native_name"] for rule in remapping_rules } } - return cashed_data.remapping[host_name]["to_native"].get( + return CashedData.remapping[host_name]["to_native"].get( ocio_colorspace_name) @@ -536,16 +536,16 @@ def get_remapped_colorspace_from_native( str: ocio colorspace name defined in remapping or None """ - if not cashed_data.remapping.get(host_name, {}).get("from_native"): + if not CashedData.remapping.get(host_name, {}).get("from_native"): remapping_rules = imageio_host_settings["remapping"]["rules"] - cashed_data.remapping[host_name] = { + CashedData.remapping[host_name] = { "from_native": { input["host_native_name"]: rule["ocio_name"] for rule in remapping_rules } } - return cashed_data.remapping[host_name]["from_native"].get( + return CashedData.remapping[host_name]["from_native"].get( host_native_colorspace_name) From 0f8a998e3aeac42e44c137ca837b75ab1cda15d1 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 16:30:32 +0200 Subject: [PATCH 101/207] old docstring fix --- openpype/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index f0fb7cf7f5..5af313c570 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -333,7 +333,7 @@ def get_imageio_config( Defaults to None. Returns: - dict or bool: config path data or None + dict: config path data or empty dict """ project_settings = project_settings or get_project_settings(project_name) anatomy = anatomy or Anatomy(project_name) From e6b301fecbfc6ec8e5bd784808f7654123f07384 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 24 May 2023 16:45:43 +0200 Subject: [PATCH 102/207] defaults update --- openpype/settings/defaults/project_settings/flame.json | 3 +++ openpype/settings/defaults/project_settings/photoshop.json | 3 +++ openpype/settings/defaults/project_settings/resolve.json | 3 +++ .../settings/defaults/project_settings/substancepainter.json | 5 +++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index 64021baeef..19773727ca 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -1,6 +1,9 @@ { "imageio": { "activate_host_color_management": true, + "remapping": { + "rules": [] + }, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/photoshop.json b/openpype/settings/defaults/project_settings/photoshop.json index 17da5dd738..ffcf87d8a5 100644 --- a/openpype/settings/defaults/project_settings/photoshop.json +++ b/openpype/settings/defaults/project_settings/photoshop.json @@ -1,6 +1,9 @@ { "imageio": { "activate_host_color_management": true, + "remapping": { + "rules": [] + }, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/resolve.json b/openpype/settings/defaults/project_settings/resolve.json index 7379e74200..f2d3727be1 100644 --- a/openpype/settings/defaults/project_settings/resolve.json +++ b/openpype/settings/defaults/project_settings/resolve.json @@ -1,6 +1,9 @@ { "imageio": { "activate_host_color_management": true, + "remapping": { + "rules": [] + }, "ocio_config": { "override_global_config": false, "filepath": [] diff --git a/openpype/settings/defaults/project_settings/substancepainter.json b/openpype/settings/defaults/project_settings/substancepainter.json index 60929e85fd..4a1b86f3f4 100644 --- a/openpype/settings/defaults/project_settings/substancepainter.json +++ b/openpype/settings/defaults/project_settings/substancepainter.json @@ -1,11 +1,12 @@ { "imageio": { + "activate_host_color_management": true, "ocio_config": { - "enabled": true, + "override_global_config": true, "filepath": [] }, "file_rules": { - "enabled": true, + "override_global_rules": true, "rules": {} } }, From 3ea8425fd5f16450b9beef93413aa69aa98de238 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 29 May 2023 11:37:13 +0100 Subject: [PATCH 103/207] Support working with single frame renders. --- openpype/plugins/publish/extract_color_transcode.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openpype/plugins/publish/extract_color_transcode.py b/openpype/plugins/publish/extract_color_transcode.py index 45b10620d1..f7c8af9318 100644 --- a/openpype/plugins/publish/extract_color_transcode.py +++ b/openpype/plugins/publish/extract_color_transcode.py @@ -184,6 +184,11 @@ class ExtractOIIOTranscode(publish.Extractor): if tag == "review": added_review = True + # If there is only 1 file outputted then convert list to + # string, cause that'll indicate that its not a sequence. + if len(new_repre["files"]) == 1: + new_repre["files"] = new_repre["files"][0] + new_representations.append(new_repre) added_representations = True From 2388cf53cb10f0989b57d86ff0963670556e7ebb Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 29 May 2023 11:44:05 +0100 Subject: [PATCH 104/207] Support same attribute names on different node types. --- .../publish/validate_rendersettings.py | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py index ebf7b3138d..0ca7c6f5a7 100644 --- a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py +++ b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py @@ -274,16 +274,18 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): # go through definitions and test if such node.attribute exists. # if so, compare its value from the one required. - for attribute, data in cls.get_nodes(instance, renderer).items(): + for data in cls.get_nodes(instance, renderer): for node in data["nodes"]: try: render_value = cmds.getAttr( - "{}.{}".format(node, attribute) + "{}.{}".format(node, data["attribute"]) ) except RuntimeError: invalid = True cls.log.error( - "Cannot get value of {}.{}".format(node, attribute) + "Cannot get value of {}.{}".format( + node, data["attribute"] + ) ) else: if render_value not in data["values"]: @@ -291,7 +293,10 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): cls.log.error( "Invalid value {} set on {}.{}. Expecting " "{}".format( - render_value, node, attribute, data["values"] + render_value, + node, + data["attribute"], + data["values"] ) ) @@ -305,7 +310,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): "{}_render_attributes".format(renderer) ) or [] ) - result = {} + result = [] for attr, values in OrderedDict(validation_settings).items(): values = [convert_to_int_or_float(v) for v in values if v] @@ -335,7 +340,13 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): ) continue - result[attribute_name] = {"nodes": nodes, "values": values} + result.append( + { + "attribute": attribute_name, + "nodes": nodes, + "values": values + } + ) return result @@ -350,11 +361,11 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): "{aov_separator}", instance.data.get("aovSeparator", "_") ) - for attribute, data in cls.get_nodes(instance, renderer).items(): + for data in cls.get_nodes(instance, renderer): if not data["values"]: continue for node in data["nodes"]: - lib.set_attribute(attribute, data["values"][0], node) + lib.set_attribute(data["attribute"], data["values"][0], node) with lib.renderlayer(layer_node): default = lib.RENDER_ATTRS['default'] From ee41b877e666db4984d7525b05187b56d1e7b2b6 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 31 May 2023 16:10:17 +0200 Subject: [PATCH 105/207] refactor file rules logic to separate host activation This is implementing logic introduced here https://github.com/ynput/OpenPype/pull/4700#discussion_r1193612003 --- openpype/pipeline/colorspace.py | 12 ++++++------ .../defaults/project_settings/aftereffects.json | 2 +- .../settings/defaults/project_settings/blender.json | 2 +- .../defaults/project_settings/celaction.json | 2 +- .../settings/defaults/project_settings/flame.json | 2 +- .../settings/defaults/project_settings/fusion.json | 2 +- .../settings/defaults/project_settings/harmony.json | 2 +- .../settings/defaults/project_settings/hiero.json | 2 +- .../settings/defaults/project_settings/houdini.json | 2 +- openpype/settings/defaults/project_settings/max.json | 2 +- .../settings/defaults/project_settings/maya.json | 2 +- .../settings/defaults/project_settings/nuke.json | 2 +- .../defaults/project_settings/photoshop.json | 2 +- .../settings/defaults/project_settings/resolve.json | 2 +- .../defaults/project_settings/substancepainter.json | 2 +- .../defaults/project_settings/traypublisher.json | 2 +- .../settings/defaults/project_settings/tvpaint.json | 2 +- .../settings/defaults/project_settings/unreal.json | 2 +- .../defaults/project_settings/webpublisher.json | 2 +- .../schemas/template_imageio_file_rules.json | 4 ++-- 20 files changed, 26 insertions(+), 26 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 5af313c570..d4011d32c9 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -483,22 +483,22 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): frules_global = imageio_global["file_rules"] activate_global_rules = frules_global.get( "activate_global_file_rules", False) + global_rules = frules_global["rules"] if not activate_global_rules: log.info( "Colorspace global file rules are disabled." ) - return {} + global_rules = {} # host is optional, some might not have any settings frules_host = imageio_host.get("file_rules", {}) # compile file rules dictionary - override_global_rules = frules_host.get("override_global_rules") - if override_global_rules: - return frules_host["rules"] - else: - return frules_global["rules"] + activate_host_rules = frules_host.get("activate_host_rules") + + # return host rules if activated or global rules + return frules_host["rules"] if activate_host_rules else global_rules def get_remapped_colorspace_to_native( diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index 1a312c27df..9be8a6e7d5 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/blender.json b/openpype/settings/defaults/project_settings/blender.json index 7cdbb0e6fb..eae5b239c8 100644 --- a/openpype/settings/defaults/project_settings/blender.json +++ b/openpype/settings/defaults/project_settings/blender.json @@ -11,7 +11,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/celaction.json b/openpype/settings/defaults/project_settings/celaction.json index 0e8b465118..af56a36649 100644 --- a/openpype/settings/defaults/project_settings/celaction.json +++ b/openpype/settings/defaults/project_settings/celaction.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index 19773727ca..5b4b62c140 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -9,7 +9,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} }, "project": { diff --git a/openpype/settings/defaults/project_settings/fusion.json b/openpype/settings/defaults/project_settings/fusion.json index 822ec422df..0ee7d6127d 100644 --- a/openpype/settings/defaults/project_settings/fusion.json +++ b/openpype/settings/defaults/project_settings/fusion.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/harmony.json b/openpype/settings/defaults/project_settings/harmony.json index e6fb00a700..02f51d1d2b 100644 --- a/openpype/settings/defaults/project_settings/harmony.json +++ b/openpype/settings/defaults/project_settings/harmony.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/hiero.json b/openpype/settings/defaults/project_settings/hiero.json index 01eb15bfbc..9c83733b09 100644 --- a/openpype/settings/defaults/project_settings/hiero.json +++ b/openpype/settings/defaults/project_settings/hiero.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} }, "workfile": { diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 2b7192ff99..a53f1ff202 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/max.json b/openpype/settings/defaults/project_settings/max.json index db203f7f46..bfb1aa4aeb 100644 --- a/openpype/settings/defaults/project_settings/max.json +++ b/openpype/settings/defaults/project_settings/max.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 14d4408138..19c3da13e6 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -416,7 +416,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} }, "workfile": { diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 5262694484..cdfc236d5c 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -15,7 +15,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} }, "viewer": { diff --git a/openpype/settings/defaults/project_settings/photoshop.json b/openpype/settings/defaults/project_settings/photoshop.json index ffcf87d8a5..71f94f5bfc 100644 --- a/openpype/settings/defaults/project_settings/photoshop.json +++ b/openpype/settings/defaults/project_settings/photoshop.json @@ -9,7 +9,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/resolve.json b/openpype/settings/defaults/project_settings/resolve.json index f2d3727be1..da47ae2553 100644 --- a/openpype/settings/defaults/project_settings/resolve.json +++ b/openpype/settings/defaults/project_settings/resolve.json @@ -9,7 +9,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/substancepainter.json b/openpype/settings/defaults/project_settings/substancepainter.json index 4a1b86f3f4..4adeff98ef 100644 --- a/openpype/settings/defaults/project_settings/substancepainter.json +++ b/openpype/settings/defaults/project_settings/substancepainter.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": true, + "activate_host_rules": true, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 6f22f8a6ec..3a42c93515 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/tvpaint.json b/openpype/settings/defaults/project_settings/tvpaint.json index 3c930b84eb..1f4f468656 100644 --- a/openpype/settings/defaults/project_settings/tvpaint.json +++ b/openpype/settings/defaults/project_settings/tvpaint.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/unreal.json b/openpype/settings/defaults/project_settings/unreal.json index 5adf1cce60..20e55c74f0 100644 --- a/openpype/settings/defaults/project_settings/unreal.json +++ b/openpype/settings/defaults/project_settings/unreal.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/defaults/project_settings/webpublisher.json b/openpype/settings/defaults/project_settings/webpublisher.json index 17d61ef028..e451bcfc17 100644 --- a/openpype/settings/defaults/project_settings/webpublisher.json +++ b/openpype/settings/defaults/project_settings/webpublisher.json @@ -6,7 +6,7 @@ "filepath": [] }, "file_rules": { - "override_global_rules": false, + "activate_host_rules": false, "rules": {} } }, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json index 829fd02489..5c6c696578 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_imageio_file_rules.json @@ -7,8 +7,8 @@ "children": [ { "type": "boolean", - "key": "override_global_rules", - "label": "Override global File Rules" + "key": "activate_host_rules", + "label": "Activate Host File Rules" }, { "key": "rules", From 711dd888e960fb3cdb5ce246fbcefb920ca1b217 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 1 Jun 2023 12:37:39 +0200 Subject: [PATCH 106/207] updating testing data --- tests/unit/openpype/pipeline/publish/test_publish_plugins.py | 2 +- tests/unit/openpype/pipeline/test_colorspace.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/openpype/pipeline/publish/test_publish_plugins.py b/tests/unit/openpype/pipeline/publish/test_publish_plugins.py index bbeab2cc90..aace8cf7e3 100644 --- a/tests/unit/openpype/pipeline/publish/test_publish_plugins.py +++ b/tests/unit/openpype/pipeline/publish/test_publish_plugins.py @@ -37,7 +37,7 @@ class TestPipelinePublishPlugins(TestPipeline): # files are the same as those used in `test_pipeline_colorspace` TEST_FILES = [ ( - "1YinxOToVyAd3-jAMFgVf7EWQa2x8Ma-O", + "1Lf-mFxev7xiwZCWfImlRcw7Fj8XgNQMh", "test_pipeline_colorspace.zip", "" ) diff --git a/tests/unit/openpype/pipeline/test_colorspace.py b/tests/unit/openpype/pipeline/test_colorspace.py index d0981723ad..c22acee2d4 100644 --- a/tests/unit/openpype/pipeline/test_colorspace.py +++ b/tests/unit/openpype/pipeline/test_colorspace.py @@ -31,7 +31,7 @@ class TestPipelineColorspace(TestPipeline): TEST_FILES = [ ( - "1YinxOToVyAd3-jAMFgVf7EWQa2x8Ma-O", + "1Lf-mFxev7xiwZCWfImlRcw7Fj8XgNQMh", "test_pipeline_colorspace.zip", "" ) From 99fbc6dc3537115734b23b718cd04b050723495f Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 6 Jun 2023 21:43:22 +0800 Subject: [PATCH 107/207] refactor the redshiftproxy family --- openpype/hosts/max/plugins/create/create_redshift_proxy.py | 7 ------- .../hosts/max/plugins/publish/extract_redshift_proxy.py | 5 ++--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/max/plugins/create/create_redshift_proxy.py b/openpype/hosts/max/plugins/create/create_redshift_proxy.py index 698ea82b69..6eb59f0a73 100644 --- a/openpype/hosts/max/plugins/create/create_redshift_proxy.py +++ b/openpype/hosts/max/plugins/create/create_redshift_proxy.py @@ -9,10 +9,3 @@ class CreateRedshiftProxy(plugin.MaxCreator): label = "Redshift Proxy" family = "redshiftproxy" icon = "gear" - - def create(self, subset_name, instance_data, pre_create_data): - - _ = super(CreateRedshiftProxy, self).create( - subset_name, - instance_data, - pre_create_data) # type: CreatedInstance diff --git a/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py b/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py index 3b44099609..8f76eef5ec 100644 --- a/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py +++ b/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py @@ -2,7 +2,7 @@ import os import pyblish.api from openpype.pipeline import publish from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection +from openpype.hosts.max.api import get_all_children, maintained_selection class ExtractRedshiftProxy(publish.Extractor): @@ -30,8 +30,7 @@ class ExtractRedshiftProxy(publish.Extractor): with maintained_selection(): # select and export - con = rt.getNodeByName(container) - rt.select(con.Children) + rt.select(get_all_children(rt.getNodeByName(container))) # Redshift rsProxy command # rsProxy fp selected compress connectivity startFrame endFrame # camera warnExisting transformPivotToOrigin From a4e2b18636aa77fbc538fb2493169ce9b19261c1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 6 Jun 2023 21:47:33 +0800 Subject: [PATCH 108/207] remove duplicated imported function --- openpype/hosts/max/plugins/load/load_model.py | 1 - openpype/hosts/max/plugins/load/load_model_fbx.py | 1 - openpype/hosts/max/plugins/load/load_pointcache.py | 2 -- 3 files changed, 4 deletions(-) diff --git a/openpype/hosts/max/plugins/load/load_model.py b/openpype/hosts/max/plugins/load/load_model.py index 0ec94ab074..58c6d3c889 100644 --- a/openpype/hosts/max/plugins/load/load_model.py +++ b/openpype/hosts/max/plugins/load/load_model.py @@ -3,7 +3,6 @@ from openpype.pipeline import load, get_representation_path from openpype.hosts.max.api.pipeline import containerise from openpype.hosts.max.api import lib from openpype.hosts.max.api.lib import maintained_selection -from openpype.pipeline import get_representation_path, load class ModelAbcLoader(load.LoaderPlugin): diff --git a/openpype/hosts/max/plugins/load/load_model_fbx.py b/openpype/hosts/max/plugins/load/load_model_fbx.py index ee7d04d5eb..663f79f9f5 100644 --- a/openpype/hosts/max/plugins/load/load_model_fbx.py +++ b/openpype/hosts/max/plugins/load/load_model_fbx.py @@ -3,7 +3,6 @@ from openpype.pipeline import load, get_representation_path from openpype.hosts.max.api.pipeline import containerise from openpype.hosts.max.api import lib from openpype.hosts.max.api.lib import maintained_selection -from openpype.pipeline import get_representation_path, load class FbxModelLoader(load.LoaderPlugin): diff --git a/openpype/hosts/max/plugins/load/load_pointcache.py b/openpype/hosts/max/plugins/load/load_pointcache.py index 8a51e86000..cadbe7cac2 100644 --- a/openpype/hosts/max/plugins/load/load_pointcache.py +++ b/openpype/hosts/max/plugins/load/load_pointcache.py @@ -6,10 +6,8 @@ Because of limited api, alembics can be only loaded, but not easily updated. """ import os from openpype.pipeline import load, get_representation_path - from openpype.hosts.max.api import lib, maintained_selection from openpype.hosts.max.api.pipeline import containerise -from openpype.pipeline import get_representation_path, load class AbcLoader(load.LoaderPlugin): From a98ef68549d090a738615f1cefdbf3cbeac22c95 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 6 Jun 2023 16:49:34 +0200 Subject: [PATCH 109/207] fixing publisher parent --- openpype/hosts/nuke/api/pipeline.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/nuke/api/pipeline.py b/openpype/hosts/nuke/api/pipeline.py index 88f7144542..e7c1c0ba0e 100644 --- a/openpype/hosts/nuke/api/pipeline.py +++ b/openpype/hosts/nuke/api/pipeline.py @@ -240,12 +240,14 @@ def _install_menu(): menu.addCommand( "Create...", lambda: host_tools.show_publisher( + parent=main_window, tab="create" ) ) menu.addCommand( "Publish...", lambda: host_tools.show_publisher( + parent=main_window, tab="publish" ) ) From bb56d5dc16f73f15c502281516361385cc4d06d8 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 6 Jun 2023 16:49:48 +0200 Subject: [PATCH 110/207] fixing nuke settings default --- .../settings/defaults/project_settings/nuke.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 3f8be4c872..8eca824a6a 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -148,7 +148,7 @@ }, { "plugins": [ - "CreateWriteStill" + "CreateWriteImage" ], "nukeNodeClass": "Write", "knobs": [ @@ -556,15 +556,7 @@ "load": { "LoadImage": { "enabled": true, - "_representations": [ - "exr", - "dpx", - "jpg", - "jpeg", - "png", - "psd", - "tiff" - ], + "_representations": [], "node_name_template": "{class_name}_{ext}" }, "LoadClip": { From fbb6afe5c370101918b77e54ec8aeeec6ab9409a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 6 Jun 2023 17:17:42 +0200 Subject: [PATCH 111/207] adding psd to IMAGE_EXTENSIONS constant --- openpype/lib/transcoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/lib/transcoding.py b/openpype/lib/transcoding.py index 57968b3700..de6495900e 100644 --- a/openpype/lib/transcoding.py +++ b/openpype/lib/transcoding.py @@ -51,7 +51,7 @@ IMAGE_EXTENSIONS = { ".jng", ".jpeg", ".jpeg-ls", ".jpeg", ".2000", ".jpg", ".xr", ".jpeg", ".xt", ".jpeg-hdr", ".kra", ".mng", ".miff", ".nrrd", ".ora", ".pam", ".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".pgf", - ".pictor", ".png", ".psb", ".psp", ".qtvr", ".ras", + ".pictor", ".png", ".psd", ".psb", ".psp", ".qtvr", ".ras", ".rgbe", ".logluv", ".tiff", ".sgi", ".tga", ".tiff", ".tiff/ep", ".tiff/it", ".ufo", ".ufp", ".wbmp", ".webp", ".xbm", ".xcf", ".xpm", ".xwd" From b3cab6a88b1fd2c8e3eb3606bfc4d5f8cafa10cb Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 7 Jun 2023 11:34:59 +0200 Subject: [PATCH 112/207] adding parent to publisher only if nuke higher then 14 --- openpype/hosts/nuke/api/__init__.py | 4 +++- openpype/hosts/nuke/api/lib.py | 11 +++++++++++ openpype/hosts/nuke/api/pipeline.py | 12 +++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/nuke/api/__init__.py b/openpype/hosts/nuke/api/__init__.py index 1af5ff365d..55c4b8c808 100644 --- a/openpype/hosts/nuke/api/__init__.py +++ b/openpype/hosts/nuke/api/__init__.py @@ -43,7 +43,8 @@ from .lib import ( get_node_data, set_node_data, update_node_data, - create_write_node + create_write_node, + get_app_version_info ) from .utils import ( colorspace_exists_on_node, @@ -90,6 +91,7 @@ __all__ = ( "set_node_data", "update_node_data", "create_write_node", + "get_app_version_info", "colorspace_exists_on_node", "get_colorspace_list" diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 4a57bc3165..bf66b9e1a9 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -3116,3 +3116,14 @@ def get_viewer_config_from_string(input_string): ).format(input_string)) return (display, viewer) + + +def get_app_version_info(): + """ Return dict of Nuke's version semantic info""" + dot_split = nuke.NUKE_VERSION_STRING.split(".") + v_spit = dot_split[1].split("v") + return { + "major": int(dot_split[0]), + "minor": int(v_spit[0]), + "patch": int(v_spit[1]) + } diff --git a/openpype/hosts/nuke/api/pipeline.py b/openpype/hosts/nuke/api/pipeline.py index e7c1c0ba0e..998c03b3dd 100644 --- a/openpype/hosts/nuke/api/pipeline.py +++ b/openpype/hosts/nuke/api/pipeline.py @@ -43,7 +43,8 @@ from .lib import ( add_scripts_menu, add_scripts_gizmo, get_node_data, - set_node_data + set_node_data, + get_app_version_info ) from .workfile_template_builder import ( NukePlaceholderLoadPlugin, @@ -218,6 +219,7 @@ def _install_menu(): main_window = get_main_window() menubar = nuke.menu("Nuke") menu = menubar.addMenu(MENU_LABEL) + app_version = get_app_version_info() if not ASSIST: label = "{0}, {1}".format( @@ -237,17 +239,21 @@ def _install_menu(): menu.addSeparator() if not ASSIST: + # only add parent if nuke version is 14 or higher + # known issue with no solution yet menu.addCommand( "Create...", lambda: host_tools.show_publisher( - parent=main_window, + parent=main_window if app_version["major"] >= 14 else None, tab="create" ) ) + # only add parent if nuke version is 14 or higher + # known issue with no solution yet menu.addCommand( "Publish...", lambda: host_tools.show_publisher( - parent=main_window, + parent=main_window if app_version["major"] >= 14 else None, tab="publish" ) ) From 4c4eeb29bed247982edad6d402aaf5903996be01 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 8 Jun 2023 00:04:41 +0800 Subject: [PATCH 113/207] connect custom write node script to the OP setting --- .../hosts/nuke/startup/custom_write_node.py | 99 +++++++++++++++---- 1 file changed, 78 insertions(+), 21 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index d9313231d8..f2244b84c5 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -1,6 +1,11 @@ +""" OpenPype custom script for setting up write nodes for non-publish """ import os import nuke -from openpype.hosts.nuke.api.lib import set_node_knobs_from_settings +import nukescripts +from openpype.hosts.nuke.api.lib import ( + set_node_knobs_from_settings, + get_nuke_imageio_settings +) frame_padding = 5 @@ -53,24 +58,76 @@ knobs_setting = { } -def main(): - write_selected_nodes = [ - s for s in nuke.selectedNodes() if s.Class() == "Write"] +class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): + """ Write Node's Knobs Settings Panel """ + def __init__(self): + nukescripts.PythonPanel.__init__(self, "Set Knobs Value(Write Node)") - ext = None - knobs = knobs_setting["knobs"] - for knob in knobs: - if knob["name"] == "file_type": - ext = knob["value"] - for w in write_selected_nodes: - # data for mapping the path - data = { - "work": os.getenv("AVALON_WORKDIR"), - "subset": w["name"].value(), - "frame": "#" * frame_padding, - "ext": ext - } - file_path = temp_rendering_path_template.format(**data) - file_path = file_path.replace("\\", "/") - w["file"].setValue(file_path) - set_node_knobs_from_settings(w, knobs) + knobs_value = self.get_node_knobs_override() + # create knobs + + self.typeKnob = nuke.Enumeration_Knob( + 'override_subsets', 'override subsets', knobs_value) + # add knobs to panel + self.addKnob(self.typeKnob) + + def process(self): + """ Process the panel values. """ + write_selected_nodes = [ + s for s in nuke.selectedNodes() if s.Class() == "Write"] + + node_knobs = self.typeKnob.value() + ext = None + knobs = None + if node_knobs: + knobs = self.get_node_knobs_setting(node_knobs) + if not knobs: + nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa + knobs = knobs_setting["knobs"] + else: + knobs = knobs_setting["knobs"] + + for knob in knobs: + if knob["name"] == "file_type": + ext = knob["value"] + for w in write_selected_nodes: + # data for mapping the path + data = { + "work": os.getenv("AVALON_WORKDIR"), + "subset": w["name"].value(), + "frame": "#" * frame_padding, + "ext": ext + } + file_path = temp_rendering_path_template.format(**data) + file_path = file_path.replace("\\", "/") + w["file"].setValue(file_path) + set_node_knobs_from_settings(w, knobs) + + def get_node_knobs_setting(self, value): + settings = [ + node for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + ] + if not settings: + return + for i, setting in enumerate(settings): + if value in settings[i]["subsets"]: + return settings[i]["knobs"] + + def get_node_knobs_override(self): + knobs_value = [] + settings = [ + node for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + ] + if not settings: + return + + for setting in settings: + if setting["nukeNodeClass"] == "Write" and setting["subsets"]: + for knob in setting["subsets"]: + knobs_value.append(knob) + return knobs_value + +def main(): + p_ = WriteNodeKnobSettingPanel() + if p_.showModalDialog(): + print(p_.process()) From 5dd066804bbc42e5fc1f1cc722e6bf69fc2643b4 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 8 Jun 2023 00:07:12 +0800 Subject: [PATCH 114/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index f2244b84c5..66095409a6 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -105,18 +105,20 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): def get_node_knobs_setting(self, value): settings = [ - node for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + node + for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] ] if not settings: return - for i, setting in enumerate(settings): + for i, _ in enumerate(settings): if value in settings[i]["subsets"]: return settings[i]["knobs"] def get_node_knobs_override(self): knobs_value = [] settings = [ - node for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + node + for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] ] if not settings: return @@ -127,6 +129,7 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): knobs_value.append(knob) return knobs_value + def main(): p_ = WriteNodeKnobSettingPanel() if p_.showModalDialog(): From f423ebcfcbeadacc12a8af5ff5a5e32f13c1a1e2 Mon Sep 17 00:00:00 2001 From: Oscar Domingo Date: Thu, 8 Jun 2023 10:40:46 +0100 Subject: [PATCH 115/207] Keep `publisher.create_widget` variant when creating subsets Whenever a person is creating a subset to publish, the "creator" widget resets (where you choose the variant, product, etc.) so if the person is publishing several images of the a variant which is not the default one, they have to keep selecting the correct one after every "create". This commit resets the original variant upon successful creation of a subset for publishing. --- openpype/tools/publisher/widgets/create_widget.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/tools/publisher/widgets/create_widget.py b/openpype/tools/publisher/widgets/create_widget.py index 30980af03d..b7605b1188 100644 --- a/openpype/tools/publisher/widgets/create_widget.py +++ b/openpype/tools/publisher/widgets/create_widget.py @@ -828,6 +828,7 @@ class CreateWidget(QtWidgets.QWidget): if success: self._set_creator(self._selected_creator) + self.variant_input.setText(variant) self._controller.emit_card_message("Creation finished...") self._last_thumbnail_path = None self._thumbnail_widget.set_current_thumbnails() From d345b3e1b178c45cdce4bca315a9d5ce0e69a88f Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 14:29:32 +0800 Subject: [PATCH 116/207] select the object from the node references for extractions instead of selecting children of the container --- openpype/hosts/max/plugins/publish/collect_members.py | 1 + openpype/hosts/max/plugins/publish/extract_camera_abc.py | 5 +++-- openpype/hosts/max/plugins/publish/extract_camera_fbx.py | 5 +++-- openpype/hosts/max/plugins/publish/extract_max_scene_raw.py | 3 +-- openpype/hosts/max/plugins/publish/extract_model.py | 5 +++-- openpype/hosts/max/plugins/publish/extract_model_fbx.py | 5 +++-- openpype/hosts/max/plugins/publish/extract_model_obj.py | 5 +++-- openpype/hosts/max/plugins/publish/extract_pointcache.py | 5 +++-- openpype/hosts/max/plugins/publish/extract_redshift_proxy.py | 5 +++-- 9 files changed, 23 insertions(+), 16 deletions(-) diff --git a/openpype/hosts/max/plugins/publish/collect_members.py b/openpype/hosts/max/plugins/publish/collect_members.py index 54020d7dae..0acb4f408d 100644 --- a/openpype/hosts/max/plugins/publish/collect_members.py +++ b/openpype/hosts/max/plugins/publish/collect_members.py @@ -19,3 +19,4 @@ class CollectMembers(pyblish.api.InstancePlugin): member.node for member in container.openPypeData.all_handles ] + self.log.debug("{}".format(instance.data["members"])) diff --git a/openpype/hosts/max/plugins/publish/extract_camera_abc.py b/openpype/hosts/max/plugins/publish/extract_camera_abc.py index c526de8960..b42732e70d 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_abc.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_abc.py @@ -3,7 +3,7 @@ import os import pyblish.api from pymxs import runtime as rt -from openpype.hosts.max.api import get_all_children, maintained_selection +from openpype.hosts.max.api import maintained_selection from openpype.pipeline import OptionalPyblishPluginMixin, publish @@ -41,7 +41,8 @@ class ExtractCameraAlembic(publish.Extractor, OptionalPyblishPluginMixin): with maintained_selection(): # select and export - rt.Select(get_all_children(rt.GetNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) rt.ExportFile( path, rt.Name("noPrompt"), diff --git a/openpype/hosts/max/plugins/publish/extract_camera_fbx.py b/openpype/hosts/max/plugins/publish/extract_camera_fbx.py index 0c8a82dcaa..06ac3da093 100644 --- a/openpype/hosts/max/plugins/publish/extract_camera_fbx.py +++ b/openpype/hosts/max/plugins/publish/extract_camera_fbx.py @@ -3,7 +3,7 @@ import os import pyblish.api from pymxs import runtime as rt -from openpype.hosts.max.api import get_all_children, maintained_selection +from openpype.hosts.max.api import maintained_selection from openpype.pipeline import OptionalPyblishPluginMixin, publish @@ -36,7 +36,8 @@ class ExtractCameraFbx(publish.Extractor, OptionalPyblishPluginMixin): with maintained_selection(): # select and export - rt.Select(get_all_children(rt.GetNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) rt.ExportFile( filepath, rt.Name("noPrompt"), diff --git a/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py b/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py index f0c2aff7f3..de5db9ab56 100644 --- a/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py +++ b/openpype/hosts/max/plugins/publish/extract_max_scene_raw.py @@ -2,7 +2,6 @@ import os import pyblish.api from openpype.pipeline import publish, OptionalPyblishPluginMixin from pymxs import runtime as rt -from openpype.hosts.max.api import get_all_children class ExtractMaxSceneRaw(publish.Extractor, OptionalPyblishPluginMixin): @@ -33,7 +32,7 @@ class ExtractMaxSceneRaw(publish.Extractor, OptionalPyblishPluginMixin): if "representations" not in instance.data: instance.data["representations"] = [] - nodes = get_all_children(rt.getNodeByName(container)) + nodes = instance.data["members"] rt.saveNodes(nodes, max_path, quiet=True) self.log.info("Performing Extraction ...") diff --git a/openpype/hosts/max/plugins/publish/extract_model.py b/openpype/hosts/max/plugins/publish/extract_model.py index 4c7c98e2cc..c7ecf7efc9 100644 --- a/openpype/hosts/max/plugins/publish/extract_model.py +++ b/openpype/hosts/max/plugins/publish/extract_model.py @@ -2,7 +2,7 @@ import os import pyblish.api from openpype.pipeline import publish, OptionalPyblishPluginMixin from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection, get_all_children +from openpype.hosts.max.api import maintained_selection class ExtractModel(publish.Extractor, OptionalPyblishPluginMixin): @@ -40,7 +40,8 @@ class ExtractModel(publish.Extractor, OptionalPyblishPluginMixin): with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) rt.exportFile( filepath, rt.name("noPrompt"), diff --git a/openpype/hosts/max/plugins/publish/extract_model_fbx.py b/openpype/hosts/max/plugins/publish/extract_model_fbx.py index 815438d378..56c2cadd94 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_fbx.py +++ b/openpype/hosts/max/plugins/publish/extract_model_fbx.py @@ -2,7 +2,7 @@ import os import pyblish.api from openpype.pipeline import publish, OptionalPyblishPluginMixin from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection, get_all_children +from openpype.hosts.max.api import maintained_selection class ExtractModelFbx(publish.Extractor, OptionalPyblishPluginMixin): @@ -40,7 +40,8 @@ class ExtractModelFbx(publish.Extractor, OptionalPyblishPluginMixin): with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) rt.exportFile( filepath, rt.name("noPrompt"), diff --git a/openpype/hosts/max/plugins/publish/extract_model_obj.py b/openpype/hosts/max/plugins/publish/extract_model_obj.py index ed3d68c990..4fde65cf22 100644 --- a/openpype/hosts/max/plugins/publish/extract_model_obj.py +++ b/openpype/hosts/max/plugins/publish/extract_model_obj.py @@ -2,7 +2,7 @@ import os import pyblish.api from openpype.pipeline import publish, OptionalPyblishPluginMixin from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection, get_all_children +from openpype.hosts.max.api import maintained_selection class ExtractModelObj(publish.Extractor, OptionalPyblishPluginMixin): @@ -31,7 +31,8 @@ class ExtractModelObj(publish.Extractor, OptionalPyblishPluginMixin): with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) rt.exportFile( filepath, rt.name("noPrompt"), diff --git a/openpype/hosts/max/plugins/publish/extract_pointcache.py b/openpype/hosts/max/plugins/publish/extract_pointcache.py index 8658cecb1b..6d1e8d03b4 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcache.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcache.py @@ -41,7 +41,7 @@ import os import pyblish.api from openpype.pipeline import publish from pymxs import runtime as rt -from openpype.hosts.max.api import maintained_selection, get_all_children +from openpype.hosts.max.api import maintained_selection class ExtractAlembic(publish.Extractor): @@ -72,7 +72,8 @@ class ExtractAlembic(publish.Extractor): with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) rt.exportFile( path, rt.name("noPrompt"), diff --git a/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py b/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py index 8f76eef5ec..ab569ecbcb 100644 --- a/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py +++ b/openpype/hosts/max/plugins/publish/extract_redshift_proxy.py @@ -2,7 +2,7 @@ import os import pyblish.api from openpype.pipeline import publish from pymxs import runtime as rt -from openpype.hosts.max.api import get_all_children, maintained_selection +from openpype.hosts.max.api import maintained_selection class ExtractRedshiftProxy(publish.Extractor): @@ -30,7 +30,8 @@ class ExtractRedshiftProxy(publish.Extractor): with maintained_selection(): # select and export - rt.select(get_all_children(rt.getNodeByName(container))) + node_list = instance.data["members"] + rt.Select(node_list) # Redshift rsProxy command # rsProxy fp selected compress connectivity startFrame endFrame # camera warnExisting transformPivotToOrigin From 8958585da07a7ba07fb2d84e8d26efee6f20d68c Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 15:22:51 +0800 Subject: [PATCH 117/207] oscar's comment --- .../hosts/nuke/startup/custom_write_node.py | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 66095409a6..708f40db27 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -63,7 +63,7 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): def __init__(self): nukescripts.PythonPanel.__init__(self, "Set Knobs Value(Write Node)") - knobs_value = self.get_node_knobs_override() + knobs_value, _ = self.get_node_knobs_setting() # create knobs self.typeKnob = nuke.Enumeration_Knob( @@ -78,56 +78,51 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): node_knobs = self.typeKnob.value() ext = None - knobs = None + knobs = knobs_setting["knobs"] + if node_knobs: - knobs = self.get_node_knobs_setting(node_knobs) - if not knobs: + _, node_knobs_settings = self.get_node_knobs_setting(node_knobs) + if not node_knobs_settings: nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa - knobs = knobs_setting["knobs"] - else: - knobs = knobs_setting["knobs"] + else: + knobs = node_knobs_settings for knob in knobs: if knob["name"] == "file_type": ext = knob["value"] - for w in write_selected_nodes: + for write_node in write_selected_nodes: # data for mapping the path data = { "work": os.getenv("AVALON_WORKDIR"), - "subset": w["name"].value(), + "subset": write_node["name"].value(), "frame": "#" * frame_padding, "ext": ext } file_path = temp_rendering_path_template.format(**data) file_path = file_path.replace("\\", "/") - w["file"].setValue(file_path) - set_node_knobs_from_settings(w, knobs) + write_node["file"].setValue(file_path) + set_node_knobs_from_settings(write_node, knobs) - def get_node_knobs_setting(self, value): + def get_node_knobs_setting(self, value=None): + knobs_value = [] + knobs_nodes = [] settings = [ node for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] ] if not settings: return + for i, _ in enumerate(settings): if value in settings[i]["subsets"]: - return settings[i]["knobs"] - - def get_node_knobs_override(self): - knobs_value = [] - settings = [ - node - for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] - ] - if not settings: - return + knobs_nodes = settings[i]["knobs"] for setting in settings: if setting["nukeNodeClass"] == "Write" and setting["subsets"]: - for knob in setting["subsets"]: - knobs_value.append(knob) - return knobs_value + for knob in setting["subsets"]: + knobs_value.append(knob) + + return knobs_value, knobs_nodes def main(): From 4b0b06ea4f7201dd274866544de51a750ed30395 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 15:23:48 +0800 Subject: [PATCH 118/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 708f40db27..d229b6b268 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -119,8 +119,8 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): for setting in settings: if setting["nukeNodeClass"] == "Write" and setting["subsets"]: - for knob in setting["subsets"]: - knobs_value.append(knob) + for knob in setting["subsets"]: + knobs_value.append(knob) return knobs_value, knobs_nodes From fbf4605417493ed5c0cf4646a9b0645ffc9f7c46 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 12:40:05 +0200 Subject: [PATCH 119/207] removing get_app_version_info --- openpype/hosts/nuke/api/__init__.py | 4 +--- openpype/hosts/nuke/api/lib.py | 11 ----------- openpype/hosts/nuke/api/pipeline.py | 12 +++++++----- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/openpype/hosts/nuke/api/__init__.py b/openpype/hosts/nuke/api/__init__.py index 55c4b8c808..1af5ff365d 100644 --- a/openpype/hosts/nuke/api/__init__.py +++ b/openpype/hosts/nuke/api/__init__.py @@ -43,8 +43,7 @@ from .lib import ( get_node_data, set_node_data, update_node_data, - create_write_node, - get_app_version_info + create_write_node ) from .utils import ( colorspace_exists_on_node, @@ -91,7 +90,6 @@ __all__ = ( "set_node_data", "update_node_data", "create_write_node", - "get_app_version_info", "colorspace_exists_on_node", "get_colorspace_list" diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index bf66b9e1a9..4a57bc3165 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -3116,14 +3116,3 @@ def get_viewer_config_from_string(input_string): ).format(input_string)) return (display, viewer) - - -def get_app_version_info(): - """ Return dict of Nuke's version semantic info""" - dot_split = nuke.NUKE_VERSION_STRING.split(".") - v_spit = dot_split[1].split("v") - return { - "major": int(dot_split[0]), - "minor": int(v_spit[0]), - "patch": int(v_spit[1]) - } diff --git a/openpype/hosts/nuke/api/pipeline.py b/openpype/hosts/nuke/api/pipeline.py index 998c03b3dd..8406a251e9 100644 --- a/openpype/hosts/nuke/api/pipeline.py +++ b/openpype/hosts/nuke/api/pipeline.py @@ -43,8 +43,7 @@ from .lib import ( add_scripts_menu, add_scripts_gizmo, get_node_data, - set_node_data, - get_app_version_info + set_node_data ) from .workfile_template_builder import ( NukePlaceholderLoadPlugin, @@ -219,7 +218,6 @@ def _install_menu(): main_window = get_main_window() menubar = nuke.menu("Nuke") menu = menubar.addMenu(MENU_LABEL) - app_version = get_app_version_info() if not ASSIST: label = "{0}, {1}".format( @@ -244,7 +242,9 @@ def _install_menu(): menu.addCommand( "Create...", lambda: host_tools.show_publisher( - parent=main_window if app_version["major"] >= 14 else None, + parent=( + main_window if nuke.NUKE_VERSION_RELEASE >= 14 else None + ), tab="create" ) ) @@ -253,7 +253,9 @@ def _install_menu(): menu.addCommand( "Publish...", lambda: host_tools.show_publisher( - parent=main_window if app_version["major"] >= 14 else None, + parent=( + main_window if nuke.NUKE_VERSION_RELEASE >= 14 else None + ), tab="publish" ) ) From a80b1b0f766ad127927575a4e91b7bb48fdb446d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 13:59:27 +0200 Subject: [PATCH 120/207] fixing still to image family conversion --- openpype/hosts/nuke/plugins/publish/extract_render_local.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/nuke/plugins/publish/extract_render_local.py b/openpype/hosts/nuke/plugins/publish/extract_render_local.py index e5feda4cd8..e2cf2addc5 100644 --- a/openpype/hosts/nuke/plugins/publish/extract_render_local.py +++ b/openpype/hosts/nuke/plugins/publish/extract_render_local.py @@ -23,7 +23,7 @@ class NukeRenderLocal(publish.Extractor, order = pyblish.api.ExtractorOrder label = "Render Local" hosts = ["nuke"] - families = ["render.local", "prerender.local", "still.local"] + families = ["render.local", "prerender.local", "image.local"] def process(self, instance): child_nodes = ( @@ -136,9 +136,9 @@ class NukeRenderLocal(publish.Extractor, families.remove('prerender.local') families.insert(0, "prerender") instance.data["anatomyData"]["family"] = "prerender" - elif "still.local" in families: + elif "image.local" in families: instance.data['family'] = 'image' - families.remove('still.local') + families.remove('image.local') instance.data["anatomyData"]["family"] = "image" instance.data["families"] = families From 7c3229db704c8b12529f68e2f6d053a76ae85f51 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 20:19:04 +0800 Subject: [PATCH 121/207] Jakub's comment --- .../hosts/nuke/startup/custom_write_node.py | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index d229b6b268..3edc74ceac 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -2,6 +2,7 @@ import os import nuke import nukescripts +from openpype.pipeline import Anatomy from openpype.hosts.nuke.api.lib import ( set_node_knobs_from_settings, get_nuke_imageio_settings @@ -66,30 +67,43 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): knobs_value, _ = self.get_node_knobs_setting() # create knobs - self.typeKnob = nuke.Enumeration_Knob( - 'override_subsets', 'override subsets', knobs_value) + self.selected_preset_name = nuke.Enumeration_Knob( + 'preset_selector', 'presets', knobs_value) # add knobs to panel - self.addKnob(self.typeKnob) + self.addKnob(self.selected_preset_name ) def process(self): """ Process the panel values. """ write_selected_nodes = [ s for s in nuke.selectedNodes() if s.Class() == "Write"] - node_knobs = self.typeKnob.value() + node_knobs = self.selected_preset_name.value() ext = None knobs = knobs_setting["knobs"] - - if node_knobs: - _, node_knobs_settings = self.get_node_knobs_setting(node_knobs) + knobs_value, node_knobs_settings = self.get_node_knobs_setting(node_knobs) + if node_knobs and knobs_value: if not node_knobs_settings: nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa else: knobs = node_knobs_settings - for knob in knobs: - if knob["name"] == "file_type": + ext_knob_list = [knob for knob in knobs if knob["name"]== "file_type"] + if not ext_knob_list: + for knob in knobs_setting["knobs"]: ext = knob["value"] + nuke.message("No file type found in the subset's knobs.Default file_type value will be used..") + else: + for knob in ext_knob_list: + ext = knob["value"] + + + anatomy = Anatomy() + + frame_padding = int( + anatomy.templates["render"].get( + "frame_padding" + ) + ) for write_node in write_selected_nodes: # data for mapping the path data = { From 399562d950ab277967ded5c02ed52fbd66771436 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 20:20:44 +0800 Subject: [PATCH 122/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 3edc74ceac..d708b277a6 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -67,10 +67,10 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): knobs_value, _ = self.get_node_knobs_setting() # create knobs - self.selected_preset_name = nuke.Enumeration_Knob( + self.selected_preset_name = nuke.Enumeration_Knob( 'preset_selector', 'presets', knobs_value) # add knobs to panel - self.addKnob(self.selected_preset_name ) + self.addKnob(self.selected_preset_name) def process(self): """ Process the panel values. """ @@ -80,18 +80,20 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): node_knobs = self.selected_preset_name.value() ext = None knobs = knobs_setting["knobs"] - knobs_value, node_knobs_settings = self.get_node_knobs_setting(node_knobs) + knobs_value, node_knobs_settings = ( + self.get_node_knobs_setting(node_knobs) + ) if node_knobs and knobs_value: if not node_knobs_settings: nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa else: knobs = node_knobs_settings - ext_knob_list = [knob for knob in knobs if knob["name"]== "file_type"] + ext_knob_list = [knob for knob in knobs if knob["name"] == "file_type"] if not ext_knob_list: for knob in knobs_setting["knobs"]: ext = knob["value"] - nuke.message("No file type found in the subset's knobs.Default file_type value will be used..") + nuke.message("No file type found in the subset's knobs.\nDefault file_type value will be used..") # noqa else: for knob in ext_knob_list: ext = knob["value"] From 1a1afee31957f1c5f12957a313b7c4438de4317c Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 20:21:57 +0800 Subject: [PATCH 123/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index d708b277a6..3e2a6fa652 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -82,7 +82,8 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): knobs = knobs_setting["knobs"] knobs_value, node_knobs_settings = ( self.get_node_knobs_setting(node_knobs) - ) + ) + if node_knobs and knobs_value: if not node_knobs_settings: nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa @@ -98,7 +99,6 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): for knob in ext_knob_list: ext = knob["value"] - anatomy = Anatomy() frame_padding = int( From feff57de37708f70e30e602ce0fe0edda3e2a3e0 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 20:30:50 +0800 Subject: [PATCH 124/207] tell the user no file type in knobs --- openpype/hosts/nuke/startup/custom_write_node.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 3e2a6fa652..08b11ee0fc 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -92,9 +92,8 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): ext_knob_list = [knob for knob in knobs if knob["name"] == "file_type"] if not ext_knob_list: - for knob in knobs_setting["knobs"]: - ext = knob["value"] nuke.message("No file type found in the subset's knobs.\nDefault file_type value will be used..") # noqa + break else: for knob in ext_knob_list: ext = knob["value"] From 704620287c479880ad0205772db96112ca8e8dfb Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 20:31:41 +0800 Subject: [PATCH 125/207] tell the user no file type in knobs and ask them to add one --- openpype/hosts/nuke/startup/custom_write_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 08b11ee0fc..2b326d2a64 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -92,8 +92,8 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): ext_knob_list = [knob for knob in knobs if knob["name"] == "file_type"] if not ext_knob_list: - nuke.message("No file type found in the subset's knobs.\nDefault file_type value will be used..") # noqa - break + nuke.message("No file type found in the subset's knobs.\nPlease add one...") # noqa + return else: for knob in ext_knob_list: ext = knob["value"] From e1b2b723d7bbf2846e1bf5577dc3ed8790187c27 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Jun 2023 20:33:06 +0800 Subject: [PATCH 126/207] tell the user no file type in knobs and ask them to add one --- openpype/hosts/nuke/startup/custom_write_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 2b326d2a64..a221a26424 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -92,7 +92,7 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): ext_knob_list = [knob for knob in knobs if knob["name"] == "file_type"] if not ext_knob_list: - nuke.message("No file type found in the subset's knobs.\nPlease add one...") # noqa + nuke.message("ERROR: No file type found in the subset's knobs.\nPlease add one to complete setting up the node") # noqa return else: for knob in ext_knob_list: From 13efd0eceb3cbeb41e1acb909667b173b363e353 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 9 Jun 2023 16:16:43 +0200 Subject: [PATCH 127/207] :bug: fix 3dsmax host name 3dsmax host name is just `max` --- openpype/hooks/pre_ocio_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index eac7d2696f..7af0f4ceef 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -14,7 +14,7 @@ class OCIOEnvHook(PreLaunchHook): "fusion", "blender", "aftereffects", - "3dsmax", + "max", "houdini", "maya", "nuke", From 4d40857ed80757a762ade8c49359c14490eb32f5 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 16:24:42 +0200 Subject: [PATCH 128/207] removing redundant hook --- openpype/hooks/pre_host_set_ocio.py | 37 ----------------------------- 1 file changed, 37 deletions(-) delete mode 100644 openpype/hooks/pre_host_set_ocio.py diff --git a/openpype/hooks/pre_host_set_ocio.py b/openpype/hooks/pre_host_set_ocio.py deleted file mode 100644 index 3620d88db6..0000000000 --- a/openpype/hooks/pre_host_set_ocio.py +++ /dev/null @@ -1,37 +0,0 @@ -from openpype.lib import PreLaunchHook - -from openpype.pipeline.colorspace import get_imageio_config -from openpype.pipeline.template_data import get_template_data - - -class PreLaunchHostSetOCIO(PreLaunchHook): - """Set OCIO environment for the host""" - - order = 0 - app_groups = ["substancepainter"] - - def execute(self): - """Hook entry method.""" - - anatomy_data = get_template_data( - project_doc=self.data["project_doc"], - asset_doc=self.data["asset_doc"], - task_name=self.data["task_name"], - host_name=self.host_name, - system_settings=self.data["system_settings"] - ) - - ocio_config = get_imageio_config( - project_name=self.data["project_doc"]["name"], - host_name=self.host_name, - project_settings=self.data["project_settings"], - anatomy_data=anatomy_data, - anatomy=self.data["anatomy"] - ) - - if ocio_config: - ocio_path = ocio_config["path"] - self.log.info(f"Setting OCIO config path: {ocio_path}") - self.launch_context.env["OCIO"] = ocio_path - else: - self.log.debug("OCIO not set or enabled") From 4595813ea6031e7147a3daa2c825fd6b70dd0b02 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 16:25:33 +0200 Subject: [PATCH 129/207] merge from redundant hook --- openpype/hooks/pre_ocio_hook.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/hooks/pre_ocio_hook.py b/openpype/hooks/pre_ocio_hook.py index 7af0f4ceef..8f462665bc 100644 --- a/openpype/hooks/pre_ocio_hook.py +++ b/openpype/hooks/pre_ocio_hook.py @@ -11,6 +11,7 @@ class OCIOEnvHook(PreLaunchHook): order = 0 hosts = [ + "substancepainter", "fusion", "blender", "aftereffects", @@ -48,3 +49,5 @@ class OCIOEnvHook(PreLaunchHook): f"Setting OCIO environment to config path: {ocio_path}") self.launch_context.env["OCIO"] = ocio_path + else: + self.log.debug("OCIO not set or enabled") From f0d7876db70b09e5763906d91f9660b7019552e8 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 16:26:22 +0200 Subject: [PATCH 130/207] backward compatibility - for hosts which had activated ocio_config in overrides - those are group settings. --- openpype/pipeline/colorspace.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index d4011d32c9..7e6efabf20 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -357,8 +357,12 @@ def get_imageio_config( imageio_global, imageio_host = _get_imageio_settings( project_settings, host_name) - activate_color_management = imageio_global.get( - "activate_global_color_management", False) + activate_color_management = ( + imageio_global.get("activate_global_color_management", False) + # for already saved overrides from previous version + # TODO: remove this in future - backward compatibility + or imageio_host.get("ocio_config").get("enabled") + ) if not activate_color_management: # if global settings are disabled return empty dict because @@ -391,7 +395,12 @@ def get_imageio_config( # depending on override flag # TODO: in future rewrite this to be more explicit config_data = None - override_global_config = config_host.get("override_global_config") + override_global_config = ( + config_host.get("override_global_config") + # for already saved overrides from previous version + # TODO: remove this in future - backward compatibility + or config_host.get("enabled") + ) if override_global_config: config_data = _get_config_data( config_host["filepath"], formatting_data From a71fed7a566579740eb34d4066fa420ccceaf109 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 16:27:06 +0200 Subject: [PATCH 131/207] nuke: backward compatibility for older project settings --- openpype/hosts/nuke/api/lib.py | 67 ++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 912bc5963b..777f4454dc 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -39,6 +39,7 @@ from openpype.settings import ( from openpype.modules import ModulesManager from openpype.pipeline.template_data import get_template_data_with_names from openpype.pipeline import ( + get_current_project_name, discover_legacy_creator_plugins, legacy_io, Anatomy, @@ -2008,37 +2009,65 @@ class WorkfileSettings(object): imageio_host (dict): host colorspace configurations ''' + config_data = get_imageio_config( + project_name=get_current_project_name(), + host_name="nuke" + ) + workfile_settings = imageio_host["workfile"] - # first set OCIO - if self._root_node["colorManagement"].value() \ - not in str(workfile_settings["colorManagement"]): - self._root_node["colorManagement"].setValue( - str(workfile_settings["colorManagement"])) + if not config_data: + # TODO: backward compatibility for old projects - remove later + # perhaps old project overrides is having it set to older version + # with use of `customOCIOConfigPath` + if workfile_settings.get("customOCIOConfigPath"): + unresolved_path = workfile_settings["customOCIOConfigPath"] + ocio_paths = unresolved_path[platform.system().lower()] - # we dont need the key anymore - workfile_settings.pop("colorManagement") + resolved_path = None + for ocio_p in ocio_paths: + resolved_path = str(ocio_p).format(**os.environ) + if not os.path.exists(resolved_path): + continue + if resolved_path: + # set values to root + self._root_node["colorManagement"].setValue("OCIO") + self._root_node["OCIO_config"].setValue("custom") + self._root_node["customOCIOConfigPath"].setValue( + resolved_path) + else: + # no ocio config found and no custom path used + if self._root_node["colorManagement"].value() \ + not in str(workfile_settings["colorManagement"]): + self._root_node["colorManagement"].setValue( + str(workfile_settings["colorManagement"])) - # second set ocio version - if self._root_node["OCIO_config"].value() \ - not in str(workfile_settings["OCIO_config"]): - self._root_node["OCIO_config"].setValue( - str(workfile_settings["OCIO_config"])) + # second set ocio version + if self._root_node["OCIO_config"].value() \ + not in str(workfile_settings["OCIO_config"]): + self._root_node["OCIO_config"].setValue( + str(workfile_settings["OCIO_config"])) - # we dont need the key anymore - workfile_settings.pop("OCIO_config") + else: + # set values to root + self._root_node["colorManagement"].setValue("OCIO") + + # we dont need the key anymore + workfile_settings.pop("customOCIOConfigPath") + workfile_settings.pop("colorManagement") + workfile_settings.pop("OCIO_config") # then set the rest - for knob, value in workfile_settings.items(): + for knob, value_ in workfile_settings.items(): # skip unfilled ocio config path # it will be dict in value - if isinstance(value, dict): + if isinstance(value_, dict): continue - if self._root_node[knob].value() not in value: - self._root_node[knob].setValue(str(value)) + if self._root_node[knob].value() not in value_: + self._root_node[knob].setValue(str(value_)) log.debug("nuke.root()['{}'] changed to: {}".format( - knob, value)) + knob, value_)) def set_writes_colorspace(self): ''' Adds correct colorspace to write node dict From 44bf1dcc8a1111f0b8d10319c0dce48fe24fd733 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 16:33:47 +0200 Subject: [PATCH 132/207] backward combability for file rules --- openpype/pipeline/colorspace.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 7e6efabf20..899b14148b 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -490,8 +490,11 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): # get file rules from global and host_name frules_global = imageio_global["file_rules"] - activate_global_rules = frules_global.get( - "activate_global_file_rules", False) + activate_global_rules = ( + frules_global.get("activate_global_file_rules", False) + # TODO: remove this in future - backward compatibility + or frules_global.get("enabled") + ) global_rules = frules_global["rules"] if not activate_global_rules: @@ -504,7 +507,11 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): frules_host = imageio_host.get("file_rules", {}) # compile file rules dictionary - activate_host_rules = frules_host.get("activate_host_rules") + activate_host_rules = ( + frules_host.get("activate_host_rules") + # TODO: remove this in future - backward compatibility + or frules_host.get("enabled") + ) # return host rules if activated or global rules return frules_host["rules"] if activate_host_rules else global_rules From aaf8756e18008552b89dacaff19ba1d4b0de12f4 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 9 Jun 2023 16:57:14 +0200 Subject: [PATCH 133/207] hiero: backward compatibility --- openpype/hosts/hiero/api/lib.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/hiero/api/lib.py b/openpype/hosts/hiero/api/lib.py index 0d4368529f..fa874f9e9d 100644 --- a/openpype/hosts/hiero/api/lib.py +++ b/openpype/hosts/hiero/api/lib.py @@ -23,11 +23,17 @@ except ImportError: from openpype.client import get_project from openpype.settings import get_project_settings -from openpype.pipeline import legacy_io, Anatomy +from openpype.pipeline import ( + get_current_project_name, legacy_io, Anatomy +) from openpype.pipeline.load import filter_containers from openpype.lib import Logger from . import tags +from openpype.pipeline.colorspace import ( + get_imageio_config +) + class DeprecatedWarning(DeprecationWarning): pass @@ -1047,6 +1053,18 @@ def apply_colorspace_project(): imageio = get_project_settings(project_name)["hiero"]["imageio"] presets = imageio.get("workfile") + # backward compatibility layer + # TODO: remove this after some time + config_data = get_imageio_config( + project_name=get_current_project_name(), + host_name="hiero" + ) + + if config_data: + presets.update({ + "ocioConfigName": "custom" + }) + # save the workfile as subversion "comment:_colorspaceChange" split_current_file = os.path.splitext(current_file) copy_current_file = current_file From 7be1d97118e2c2b3cb159b2fe192caa233872002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Fri, 9 Jun 2023 17:01:05 +0200 Subject: [PATCH 134/207] Update openpype/hosts/flame/hooks/pre_flame_setup.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fabià Serra Arrizabalaga --- openpype/hosts/flame/hooks/pre_flame_setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/flame/hooks/pre_flame_setup.py b/openpype/hosts/flame/hooks/pre_flame_setup.py index 1f01499333..83110bb6b5 100644 --- a/openpype/hosts/flame/hooks/pre_flame_setup.py +++ b/openpype/hosts/flame/hooks/pre_flame_setup.py @@ -47,7 +47,11 @@ class FlamePrelaunch(PreLaunchHook): imageio_flame = project_settings["flame"]["imageio"] - # get host imageio settings enabled key if exists + # Check whether 'enabled' key from host imageio settings exists + # so we can tell if host is using the new colormanagement framework. + # If the 'enabled' isn't found we want 'colormanaged' set to True + # because prior to the key existing we always did colormanagement for + # Flame colormanaged = imageio_flame.get("enabled") # if key was not found, set to True # ensuring backward compatibility From cd7317410be99bdd1d109e5227bd8c5301f84c21 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Fri, 9 Jun 2023 15:28:20 +0000 Subject: [PATCH 135/207] [Automated] Release --- CHANGELOG.md | 393 ++++++++++++++++++++++++++++++++++++++++++++ openpype/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 395 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6544e659..882620f26c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,399 @@ # Changelog +## [3.15.10](https://github.com/ynput/OpenPype/tree/3.15.10) + + +[Full Changelog](https://github.com/ynput/OpenPype/compare/3.15.9...3.15.10) + +### **🆕 New features** + + +
+ImageIO: Adding ImageIO activation toggle to all hosts #4700 + +Colorspace management can now be enabled at the project level, although it is disabled by default. Once enabled, all hosts will use the OCIO config file defined in the settings. If settings are disabled, the system switches to DCC's native color space management, and we do not store colorspace information at the representative level. + + +___ + +
+ + +
+Redshift Proxy Support in 3dsMax #4625 + +Redshift Proxy Support for 3dsMax. +- [x] Creator +- [x] Loader +- [x] Extractor +- [x] Validator +- [x] Add documentation + + +___ + +
+ + +
+Houdini farm publishing and rendering #4825 + +Deadline Farm publishing and Rendering for Houdini +- [x] Mantra +- [x] Karma(including usd renders) +- [x] Arnold +- [x] Elaborate Redshift ROP for deadline submission +- [x] fix the existing bug in Redshift ROP +- [x] Vray +- [x] add docs + + +___ + +
+ + +
+Feature: Blender hook to execute python scripts at launch #4905 + +Hook to allow hooks to add path to a python script that will be executed when Blender starts. + + +___ + +
+ + +
+Feature: Resolve: Open last workfile on launch through .scriptlib #5047 + +Added implementation to Resolve integration to open last workfile on launch. + + +___ + +
+ + +
+General: Remove default windowFlags from publisher #5089 + +The default windowFlags is making the publisher window (in Linux at least) only show the close button and it's frustrating as many times you just want to minimize the window and get back to the validation after. Removing that line I get what I'd expect.**Before:****After:** + + +___ + +
+ + +
+General: Show user who created the workfile on the details pane of workfile manager #5093 + +New PR for https://github.com/ynput/OpenPype/pull/5087, which was closed after merging `next-minor` branch and then realizing we don't need to target it as it was decided it's not required to support windows. More info on that PR discussion.Small addition to add name of the `user` who created the workfile on the details pane of the workfile manager: + + +___ + +
+ + +
+Loader: Hide inactive versions in UI #5100 + +Hide versions with `active` set to `False` in Loader UI. + + +___ + +
+ +### **🚀 Enhancements** + + +
+Maya: Repair RenderPass token when merging AOVs. #5055 + +Validator was flagging that `` was in the image prefix, but did not repair the issue. + + +___ + +
+ + +
+Maya: Improve error feedback when no renderable cameras exist for ASS family. #5092 + +When collecting cameras for `ass` family, this improves the error message when no cameras are renderable. + + +___ + +
+ + +
+Nuke: Custom script to set frame range of read nodes #5039 + +Adding option to set frame range specifically for the read nodes in Openpype Panel. User can set up their preferred frame range with the frame range dialog, which can be showed after clicking `Set Frame Range (Read Node)` in Openpype Tools + + +___ + +
+ + +
+Update extract review letterbox docs #5074 + +Update Extract Review - Letter Box section in Docs. Letterbox type description is removed. + + +___ + +
+ + +
+Project pack: Documents only skips roots validation #5082 + +Single roots validation is skipped if only documents are extracted. + + +___ + +
+ + +
+Nuke: custom settings for write node without publish #5084 + +Set Render Output and other settings to write nodes for non-publish purposes. + + +___ + +
+ +### **🐛 Bug fixes** + + +
+Maya: Deadline servers #5052 + +Fix working with multiple Deadline servers in Maya. +- Pools (primary and secondary) attributes were not recreated correctly. +- Order of collector plugins were wrong, so collected data was not injected into render instances. +- Server attribute was not converted to string so comparing with settings was incorrect. +- Improve debug logging for where the webservice url is getting fetched from. + + +___ + +
+ + +
+Maya: Fix Load Reference. #5091 + +Fix bug introduced with https://github.com/ynput/OpenPype/pull/4751 where `cmds.ls` returns a list. + + +___ + +
+ + +
+3dsmax: Publishing Deadline jobs from RedShift #4960 + +Fix the bug of being uable to publish deadline jobs from RedshiftUse Current File instead of Published Scene for just Redshift. +- add save scene before rendering to ensure the scene is saved after the modification. +- add separated aov files option to allow users to choose to have aovs in render output +- add validator for render publish to aovid overriding the previous renders + + +___ + +
+ + +
+Houdini: Fix missing frame range for pointcache and camera exports #5026 + +Fix missing frame range for pointcache and camera exports on published version. + + +___ + +
+ + +
+Global: collect_frame_fix plugin fix and cleanup #5064 + +Previous implementation https://github.com/ynput/OpenPype/pull/5036 was broken this is fixing the issue where attribute is found in instance data although the settings were disabled for the plugin. + + +___ + +
+ + +
+Hiero: Fix apply settings Clip Load #5073 + +Changed `apply_settings` to classmethod which fixes the issue with settings. + + +___ + +
+ + +
+Resolve: Make sure scripts dir exists #5078 + +Make sure the scripts directory exists before looping over it's content. + + +___ + +
+ + +
+removing info knob from nuke creators #5083 + +- removing instance node if removed via publisher +- removing info knob since it is not needed any more (was there only for the transition phase) + + +___ + +
+ + +
+Tray: Fix restart arguments on update #5085 + +Fix arguments on restart. + + +___ + +
+ + +
+Maya: bug fix on repair action in Arnold Scene Source CBID Validator #5096 + +Fix the bug of not being able to use repair action in Arnold Scene Source CBID Validator + + +___ + +
+ + +
+Nuke: batch of small fixes #5103 + +- default settings for `imageio.requiredNodes` **CreateWriteImage** +- default settings for **LoadImage** representations +- **Create** and **Publish** menu items with `parent=main_window` (version > 14) + + +___ + +
+ + +
+Deadline: make prerender check safer #5104 + +Prerender wasn't correctly recognized and was replaced with just 'render' family.In Nuke it is correctly `prerender.farm` in families, which wasn't handled here. It resulted into using `render` in templates even if `render` and `prerender` templates were split. + + +___ + +
+ + +
+General: Sort launcher actions alphabetically #5106 + +The launcher actions weren't being sorted by its label but its name (which on the case of the apps it's the version number) and thus the order wasn't consistent and we kept getting a different order on every launch. From my debugging session, this was the result of what the `actions` variable held after the `filter_compatible_actions` function before these changes: +``` +(Pdb) for p in actions: print(p.order, p.name) +0 14-02 +0 14-02 +0 14-02 +0 14-02 +0 14-02 +0 19-5-493 +0 2023 +0 3-41 +0 6-01 +```This caused already a couple bugs from our artists thinking they had launched Nuke X and instead launched Nuke and telling us their Nuke was missing nodes**Before:****After:** + + +___ + +
+ + +
+TrayPublisher: Editorial video stream discovery #5120 + +Editorial create plugin in traypublisher does not expect that first stream in input is video. + + +___ + +
+ +### **🔀 Refactored code** + + +
+3dsmax: Move from deprecated interface #5117 + +`INewPublisher` interface is deprecated, this PR is changing the use to `IPublishHost` instead. + + +___ + +
+ +### **Merged pull requests** + + +
+add movalex as a contributor for code #5076 + +Adds @movalex as a contributor for code. + +This was requested by mkolar [in this comment](https://github.com/ynput/OpenPype/pull/4916#issuecomment-1571498425) + +[skip ci] +___ + +
+ + +
+3dsmax: refactor load plugins #5079 + + +___ + +
+ + + + ## [3.15.9](https://github.com/ynput/OpenPype/tree/3.15.9) diff --git a/openpype/version.py b/openpype/version.py index 868664c601..cf4e1efc66 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.15.10-nightly.2" +__version__ = "3.15.10" diff --git a/pyproject.toml b/pyproject.toml index 633899d3a0..56c130982c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "OpenPype" -version = "3.15.9" # OpenPype +version = "3.15.10" # OpenPype description = "Open VFX and Animation pipeline with support." authors = ["OpenPype Team "] license = "MIT License" From 333249b4d8ee32116851c6aabad25a9bc29cac16 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 9 Jun 2023 15:29:28 +0000 Subject: [PATCH 136/207] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e614d2fa65..aa5a99f66e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.15.10 - 3.15.10-nightly.2 - 3.15.10-nightly.1 - 3.15.9 @@ -134,7 +135,6 @@ body: - 3.14.3-nightly.4 - 3.14.3-nightly.3 - 3.14.3-nightly.2 - - 3.14.3-nightly.1 validations: required: true - type: dropdown From 54294abb49e1e1b215aad6d07c3fa50000ccf52a Mon Sep 17 00:00:00 2001 From: Ynbot Date: Sat, 10 Jun 2023 03:25:04 +0000 Subject: [PATCH 137/207] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index cf4e1efc66..300f5546ae 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.15.10" +__version__ = "3.15.11-nightly.1" From 6f0c5083d310af4291ce14e87dde80dff479fa5d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 Jun 2023 03:25:49 +0000 Subject: [PATCH 138/207] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index aa5a99f66e..0b1d0f5087 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.15.11-nightly.1 - 3.15.10 - 3.15.10-nightly.2 - 3.15.10-nightly.1 @@ -134,7 +135,6 @@ body: - 3.14.3-nightly.5 - 3.14.3-nightly.4 - 3.14.3-nightly.3 - - 3.14.3-nightly.2 validations: required: true - type: dropdown From e9d60c96f50e5a278aa602e80a6a7b677a8decf9 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Mon, 12 Jun 2023 12:44:12 +0200 Subject: [PATCH 139/207] :bug: handle cancelled dialog --- openpype/hosts/max/api/plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index f52e78de70..5eb4eaf391 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -35,6 +35,7 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" ( current_selection = selectByName title:"Select Objects to add to the Container" buttontext:"Add" + if current_selection == undefined then return False temp_arr = #() i_node_arr = #() for c in current_selection do @@ -52,8 +53,10 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" ( current_selection = selectByName title:"Select Objects to remove from the Container" buttontext:"Remove" + if current_selection == undefined then return False temp_arr = #() i_node_arr = #() + for c in current_selection do ( node_ref = NodeTransformMonitor node:c From 74efe431765272ff640b6478b15ac06e03a5e0a4 Mon Sep 17 00:00:00 2001 From: Alexey Bogomolov Date: Tue, 13 Jun 2023 10:03:05 +0300 Subject: [PATCH 140/207] hide macos dock icon on build --- tools/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build.sh b/tools/build.sh index 753a9c55b8..e828cc149e 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -196,6 +196,8 @@ if [ "$disable_submodule_update" == 1 ]; then echo -e "${BIGreen}>>>${RST} Fixing libs ..." mv "$openpype_root/build/OpenPype $openpype_version.app/Contents/MacOS/dependencies/cx_Freeze" "$openpype_root/build/OpenPype $openpype_version.app/Contents/MacOS/lib/" || { echo -e "${BIRed}!!!>${RST} ${BIYellow}Can't move cx_Freeze libs${RST}"; return 1; } + # force hide icon from Dock + defaults write "$openpype_root/build/OpenPype $openpype_version.app/Contents/Info" LSUIElement 1 # fix code signing issue echo -e "${BIGreen}>>>${RST} Fixing code signatures ...\c" From 0a0c374ee1fc874b4f5521a72cd5273b00082ec7 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 13 Jun 2023 18:26:31 +0800 Subject: [PATCH 141/207] removing the node references successfully in the parameter --- openpype/hosts/max/api/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 5eb4eaf391..6bf3756e72 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -72,13 +72,13 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" DeleteItem list_node.items idx ) ) - all_handles = join i_node_arr all_handles - list_node.items = join temp_arr list_node.items + all_handles = i_node_arr + list_node.items = temp_arr ) on OPparams open do ( - if all_handles.count != 0 do + if all_handles.count != 0 then ( temp_arr = #() for x in all_handles do From 15dd1e13b6e37dce8dbc8d1f5d0262ea3639f412 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 13 Jun 2023 19:00:37 +0800 Subject: [PATCH 142/207] removing the node references successfully in the parameter --- openpype/hosts/max/api/plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 6bf3756e72..3fa4fa55b1 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -56,6 +56,8 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" if current_selection == undefined then return False temp_arr = #() i_node_arr = #() + new_temp_arr = #() + new_i_node_arr = #() for c in current_selection do ( @@ -65,15 +67,17 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" if idx do ( DeleteItem all_nodes idx + for i in all_nodes do append new_i_node_arr i ) idx = finditem list_node.items handle_name if idx do ( DeleteItem list_node.items idx + for i in list_node.items do append new_temp_arr i ) ) - all_handles = i_node_arr - list_node.items = temp_arr + all_handles = new_i_node_arr + list_node.items = new_temp_arr ) on OPparams open do From fc4c4668d0dca05cd40c4b671a38f8ea8cd78d5b Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 13 Jun 2023 20:50:24 +0800 Subject: [PATCH 143/207] removing the node references successfully in the parameter --- openpype/hosts/max/api/plugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 3fa4fa55b1..be40a765fb 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -56,7 +56,6 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" if current_selection == undefined then return False temp_arr = #() i_node_arr = #() - new_temp_arr = #() new_i_node_arr = #() for c in current_selection do @@ -73,11 +72,10 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" if idx do ( DeleteItem list_node.items idx - for i in list_node.items do append new_temp_arr i ) ) all_handles = new_i_node_arr - list_node.items = new_temp_arr + list_node.items = temp_arr ) on OPparams open do From 1c77dffc3d45e6ec7a8876b2f19eac572eb04cab Mon Sep 17 00:00:00 2001 From: Ynbot Date: Wed, 14 Jun 2023 03:25:23 +0000 Subject: [PATCH 144/207] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index 300f5546ae..c44b1d29fb 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.15.11-nightly.1" +__version__ = "3.15.11-nightly.2" From fa9d348b321abfc4efa94065925055212dd8e8b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 14 Jun 2023 03:26:11 +0000 Subject: [PATCH 145/207] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0b1d0f5087..2339ec878f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.15.11-nightly.2 - 3.15.11-nightly.1 - 3.15.10 - 3.15.10-nightly.2 @@ -134,7 +135,6 @@ body: - 3.14.3-nightly.6 - 3.14.3-nightly.5 - 3.14.3-nightly.4 - - 3.14.3-nightly.3 validations: required: true - type: dropdown From bfde7cba51e99fc2de2cb15b831e9c4910c21680 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 14 Jun 2023 14:02:01 +0800 Subject: [PATCH 146/207] fix the bug of not deleting instance with delete button lasted in Openpype attribute --- openpype/hosts/max/api/plugin.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index be40a765fb..3427c85d98 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -57,25 +57,34 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" temp_arr = #() i_node_arr = #() new_i_node_arr = #() + new_temp_arr = #() for c in current_selection do ( - node_ref = NodeTransformMonitor node:c + node_ref = NodeTransformMonitor node:c as string handle_name = node_to_name c - idx = finditem all_handles node_ref + tmp_all_handles = #() + for i in all_handles do + ( + tmp = i as string + append tmp_all_handles tmp + ) + print all_handles + print node_ref + idx = finditem tmp_all_handles node_ref if idx do ( - DeleteItem all_nodes idx - for i in all_nodes do append new_i_node_arr i + new_i_node_arr = DeleteItem all_handles idx + ) idx = finditem list_node.items handle_name if idx do ( - DeleteItem list_node.items idx + new_temp_arr = DeleteItem list_node.items idx ) ) - all_handles = new_i_node_arr - list_node.items = temp_arr + all_handles = join i_node_arr new_i_node_arr + list_node.items = join temp_arr new_temp_arr ) on OPparams open do From cb92481676bd1f9f9720e2489e04eaf3b73a8065 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 14 Jun 2023 14:02:29 +0800 Subject: [PATCH 147/207] fix the docstring --- openpype/hosts/max/plugins/publish/collect_members.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/collect_members.py b/openpype/hosts/max/plugins/publish/collect_members.py index 0acb4f408d..812d82ff26 100644 --- a/openpype/hosts/max/plugins/publish/collect_members.py +++ b/openpype/hosts/max/plugins/publish/collect_members.py @@ -5,7 +5,7 @@ from pymxs import runtime as rt class CollectMembers(pyblish.api.InstancePlugin): - """Collect Render for Deadline.""" + """Collect Set Members.""" order = pyblish.api.CollectorOrder + 0.01 label = "Collect Instance Members" From b736c8c632157facc24cf9ac36bccfff8851d09a Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 14 Jun 2023 10:06:45 +0200 Subject: [PATCH 148/207] :recycle: remove debug prints --- openpype/hosts/max/api/plugin.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 3427c85d98..4fc852e2fe 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -69,8 +69,6 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData" tmp = i as string append tmp_all_handles tmp ) - print all_handles - print node_ref idx = finditem tmp_all_handles node_ref if idx do ( From 37e17f3ba03d6b0c101492d9d9a7da41be5fedc9 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 15 Jun 2023 14:52:41 +0800 Subject: [PATCH 149/207] bug fix the standin being not loaded when they are first loaded --- .../hosts/maya/plugins/load/load_arnold_standin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 7c3a732389..dd2e8d0885 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -1,5 +1,6 @@ import os import clique +import time import maya.cmds as cmds @@ -35,9 +36,14 @@ class ArnoldStandinLoader(load.LoaderPlugin): color = "orange" def load(self, context, name, namespace, options): - - # Make sure to load arnold before importing `mtoa.ui.arnoldmenu` - cmds.loadPlugin("mtoa", quiet=True) + # Make sure user has loaded arnold before importing `mtoa.ui.arnoldmenu` + # and getting attribute from defaultArnoldRenderOption.operator + # Otherwises standins will not be loaded successfully for + # every first time using this loader after the build + if not cmds.pluginInfo("mtoa", query=True, loaded=True): + raise RuntimeError("Plugin 'mtoa' must be loaded" + " before using this loader") + # cmds.loadPlugin("mtoa", quiet=True) import mtoa.ui.arnoldmenu version = context['version'] From 9ba54ecace3a5554c737f83f489154a99d597a49 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 15 Jun 2023 15:09:40 +0800 Subject: [PATCH 150/207] hound fix --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index dd2e8d0885..f41afefcf4 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -1,6 +1,5 @@ import os import clique -import time import maya.cmds as cmds @@ -36,7 +35,8 @@ class ArnoldStandinLoader(load.LoaderPlugin): color = "orange" def load(self, context, name, namespace, options): - # Make sure user has loaded arnold before importing `mtoa.ui.arnoldmenu` + # Make sure user has loaded arnold + # before importing `mtoa.ui.arnoldmenu` # and getting attribute from defaultArnoldRenderOption.operator # Otherwises standins will not be loaded successfully for # every first time using this loader after the build From 59b7e265dab01adbd393f9aa934a699d64502aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hector?= Date: Thu, 15 Jun 2023 10:13:49 +0200 Subject: [PATCH 151/207] add label to matching family (#5128) * add label to matching family * Update openpype/tools/creator/model.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --------- Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/tools/creator/model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openpype/tools/creator/model.py b/openpype/tools/creator/model.py index 7bb2757a11..6e905d0b56 100644 --- a/openpype/tools/creator/model.py +++ b/openpype/tools/creator/model.py @@ -53,6 +53,9 @@ class CreatorsModel(QtGui.QStandardItemModel): index = self.index(row, 0) item_id = index.data(ITEM_ID_ROLE) creator_plugin = self._creators_by_id.get(item_id) - if creator_plugin and creator_plugin.family == family: + if creator_plugin and ( + creator_plugin.label.lower() == family.lower() + or creator_plugin.family.lower() == family.lower() + ): indexes.append(index) return indexes From 22296aeb6e8ae078cde738cea8f3c38d47c3a76b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 15 Jun 2023 14:32:53 +0200 Subject: [PATCH 152/207] Pack project: Raise exception with reasonable message (#5145) * raise exception with reasonable message * raise errors at better places --- openpype/lib/project_backpack.py | 11 +++++++++++ openpype/pype_commands.py | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/openpype/lib/project_backpack.py b/openpype/lib/project_backpack.py index 674eaa3b91..55a96664d8 100644 --- a/openpype/lib/project_backpack.py +++ b/openpype/lib/project_backpack.py @@ -113,6 +113,12 @@ def pack_project( project_name )) + if only_documents and not destination_dir: + raise ValueError(( + "Destination directory must be defined" + " when only documents should be packed." + )) + root_path = None source_root = {} project_source_path = None @@ -141,6 +147,11 @@ def pack_project( if not destination_dir: destination_dir = root_path + if not destination_dir: + raise ValueError( + "Project {} does not have any roots.".format(project_name) + ) + destination_dir = os.path.normpath(destination_dir) if not os.path.exists(destination_dir): os.makedirs(destination_dir) diff --git a/openpype/pype_commands.py b/openpype/pype_commands.py index 6a24cb0ebc..56a0fe60cd 100644 --- a/openpype/pype_commands.py +++ b/openpype/pype_commands.py @@ -356,6 +356,13 @@ class PypeCommands: def pack_project(self, project_name, dirpath, database_only): from openpype.lib.project_backpack import pack_project + if database_only and not dirpath: + raise ValueError(( + "Destination dir must be defined when using --dbonly." + " Use '--dirpath {output dir path}' flag" + " to specify directory." + )) + pack_project(project_name, dirpath, database_only) def unpack_project(self, zip_filepath, new_root, database_only): From 359d6856442f8d9f3d992ec3af335d8b9aa300f2 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 15 Jun 2023 14:35:47 +0200 Subject: [PATCH 153/207] Draft to allow "inventory" actions to be supplied by a Module or Addon. --- openpype/modules/README.md | 3 ++- openpype/modules/base.py | 22 +++++++++++++++++++--- openpype/modules/interfaces.py | 23 +++++++++++++++++++---- openpype/pipeline/context_tools.py | 5 +++++ 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/openpype/modules/README.md b/openpype/modules/README.md index 86afdb9d91..ce3f99b338 100644 --- a/openpype/modules/README.md +++ b/openpype/modules/README.md @@ -138,7 +138,8 @@ class ClockifyModule( "publish": [], "create": [], "load": [], - "actions": [] + "actions": [], + "inventory": [] } ``` diff --git a/openpype/modules/base.py b/openpype/modules/base.py index 732525b6eb..fb9b4e1096 100644 --- a/openpype/modules/base.py +++ b/openpype/modules/base.py @@ -740,15 +740,16 @@ class ModulesManager: Unknown keys are logged out. Returns: - dict: Output is dictionary with keys "publish", "create", "load" - and "actions" each containing list of paths. + dict: Output is dictionary with keys "publish", "create", "load", + "actions" and "inventory" each containing list of paths. """ # Output structure output = { "publish": [], "create": [], "load": [], - "actions": [] + "actions": [], + "inventory": [] } unknown_keys_by_module = {} for module in self.get_enabled_modules(): @@ -853,6 +854,21 @@ class ModulesManager: host_name ) + def collect_inventory_action_paths(self, host_name): + """Helper to collect load plugin paths from modules. + + Args: + host_name (str): For which host are load plugins meant. + + Returns: + list: List of pyblish plugin paths. + """ + + return self._collect_plugin_paths( + "get_inventory_action_paths", + host_name + ) + def get_host_module(self, host_name): """Find host module by host name. diff --git a/openpype/modules/interfaces.py b/openpype/modules/interfaces.py index 8c9a6ee1dd..40a42e9290 100644 --- a/openpype/modules/interfaces.py +++ b/openpype/modules/interfaces.py @@ -33,8 +33,8 @@ class OpenPypeInterface: class IPluginPaths(OpenPypeInterface): """Module has plugin paths to return. - Expected result is dictionary with keys "publish", "create", "load" or - "actions" and values as list or string. + Expected result is dictionary with keys "publish", "create", "load", + "actions" or "inventory" and values as list or string. { "publish": ["path/to/publish_plugins"] } @@ -109,6 +109,21 @@ class IPluginPaths(OpenPypeInterface): return self._get_plugin_paths_by_type("publish") + def get_inventory_action_paths(self, host_name): + """Receive inventory action paths. + + Give addons ability to add inventory action plugin paths. + + Notes: + Default implementation uses 'get_plugin_paths' and always return + all publish plugin paths. + + Args: + host_name (str): For which host are the plugins meant. + """ + + return self._get_plugin_paths_by_type("inventory") + class ILaunchHookPaths(OpenPypeInterface): """Module has launch hook paths to return. @@ -397,8 +412,8 @@ class ITrayService(ITrayModule): class ISettingsChangeListener(OpenPypeInterface): """Module has plugin paths to return. - Expected result is dictionary with keys "publish", "create", "load" or - "actions" and values as list or string. + Expected result is dictionary with keys "publish", "create", "load", + "actions" or "inventory" and values as list or string. { "publish": ["path/to/publish_plugins"] } diff --git a/openpype/pipeline/context_tools.py b/openpype/pipeline/context_tools.py index ada78b989d..97a5c1ba69 100644 --- a/openpype/pipeline/context_tools.py +++ b/openpype/pipeline/context_tools.py @@ -181,6 +181,11 @@ def install_openpype_plugins(project_name=None, host_name=None): for path in load_plugin_paths: register_loader_plugin_path(path) + inventory_action_paths = modules_manager.collect_inventory_action_paths( + host_name) + for path in inventory_action_paths: + register_inventory_action_path(path) + if project_name is None: project_name = os.environ.get("AVALON_PROJECT") From b01424111aa579f95a77b3d0b39bace1e02a8a03 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 15 Jun 2023 21:25:41 +0800 Subject: [PATCH 154/207] roy's comment --- .../maya/plugins/load/load_arnold_standin.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index f41afefcf4..a729e0bb06 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -23,6 +23,20 @@ def is_sequence(files): return sequence +def post_process(): + import maya.utils + from qtpy import QtWidgets + + # I'm not sure this would work, but it'd be the simplest trick to try + cmds.refresh(force=True) + + # I suspect this might work + maya.utils.processIdleEvents() + + # I suspect this one might work too but it's might be a hard to track whether it solves all cases (and whether the events were already submitted to Qt at that time this command starts to run) So I'd always try to avoid this when possible. + QtWidgets.QApplication.instance().processEvents() + + class ArnoldStandinLoader(load.LoaderPlugin): """Load as Arnold standin""" @@ -40,10 +54,13 @@ class ArnoldStandinLoader(load.LoaderPlugin): # and getting attribute from defaultArnoldRenderOption.operator # Otherwises standins will not be loaded successfully for # every first time using this loader after the build + """ if not cmds.pluginInfo("mtoa", query=True, loaded=True): raise RuntimeError("Plugin 'mtoa' must be loaded" " before using this loader") - # cmds.loadPlugin("mtoa", quiet=True) + """ + cmds.loadPlugin("mtoa", quiet=True) + post_process() import mtoa.ui.arnoldmenu version = context['version'] From 5bb476cfa439d168c4e5668c30bc7945f38713a7 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 15 Jun 2023 21:27:38 +0800 Subject: [PATCH 155/207] hound fix --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index a729e0bb06..9016359c2f 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -27,13 +27,8 @@ def post_process(): import maya.utils from qtpy import QtWidgets - # I'm not sure this would work, but it'd be the simplest trick to try cmds.refresh(force=True) - - # I suspect this might work maya.utils.processIdleEvents() - - # I suspect this one might work too but it's might be a hard to track whether it solves all cases (and whether the events were already submitted to Qt at that time this command starts to run) So I'd always try to avoid this when possible. QtWidgets.QApplication.instance().processEvents() From d077491617d2c1f8b95b7c86568a88c16ff290b5 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 15 Jun 2023 21:28:56 +0800 Subject: [PATCH 156/207] add docstring --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 9016359c2f..f45a070c85 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -24,6 +24,10 @@ def is_sequence(files): def post_process(): + """ + Make sure mtoa script finished loading + before the loader doing any action + """ import maya.utils from qtpy import QtWidgets From 0fe552a01485e52512139a3aa92eb62a513f6885 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 15 Jun 2023 15:35:06 +0200 Subject: [PATCH 157/207] Update invalid docstring --- openpype/modules/interfaces.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openpype/modules/interfaces.py b/openpype/modules/interfaces.py index 40a42e9290..0d73bc35a3 100644 --- a/openpype/modules/interfaces.py +++ b/openpype/modules/interfaces.py @@ -410,13 +410,11 @@ class ITrayService(ITrayModule): class ISettingsChangeListener(OpenPypeInterface): - """Module has plugin paths to return. + """Module tries to listen to settings changes. + + Only settings changes in the current process are propagated. + Changes made in other processes or machines won't trigger the callbacks. - Expected result is dictionary with keys "publish", "create", "load", - "actions" or "inventory" and values as list or string. - { - "publish": ["path/to/publish_plugins"] - } """ @abstractmethod From 6087b27c32d46c0e8c67cd133f031305eb1ae54f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 15 Jun 2023 16:05:59 +0200 Subject: [PATCH 158/207] Ftrack: Task status during publishing (#5123) * ftrack status is not set in deadline plugin during celaction integration * implemented new logic to set task status during publishing * added missing settings for new plugins * integrate hierarchy ftrack is filling status names for newly created tasks * resaved default settings * change label in settings * Remove leftover docstring Co-authored-by: Roy Nieterau * Use smaller differentiation in order to keep plugin in integration range * formatting changes --------- Co-authored-by: Roy Nieterau --- .../publish/submit_celaction_deadline.py | 1 - .../plugins/publish/integrate_ftrack_api.py | 41 -- .../publish/integrate_ftrack_farm_status.py | 150 ------ .../publish/integrate_ftrack_status.py | 433 ++++++++++++++++++ .../publish/integrate_hierarchy_ftrack.py | 26 +- .../defaults/project_settings/ftrack.json | 24 +- .../schema_project_ftrack.json | 140 +++++- 7 files changed, 609 insertions(+), 206 deletions(-) delete mode 100644 openpype/modules/ftrack/plugins/publish/integrate_ftrack_farm_status.py create mode 100644 openpype/modules/ftrack/plugins/publish/integrate_ftrack_status.py diff --git a/openpype/modules/deadline/plugins/publish/submit_celaction_deadline.py b/openpype/modules/deadline/plugins/publish/submit_celaction_deadline.py index bcf0850768..ee28612b44 100644 --- a/openpype/modules/deadline/plugins/publish/submit_celaction_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_celaction_deadline.py @@ -59,7 +59,6 @@ class CelactionSubmitDeadline(pyblish.api.InstancePlugin): render_path).replace("\\", "/") instance.data["publishJobState"] = "Suspended" - instance.context.data['ftrackStatus'] = "Render" # adding 2d render specific family for version identification in Loader instance.data["families"] = ["render2d"] diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_api.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_api.py index cec48ef54f..deb8b414f0 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_api.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_api.py @@ -109,8 +109,6 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): for status in asset_version_statuses } - self._set_task_status(instance, project_entity, task_entity, session) - # Prepare AssetTypes asset_types_by_short = self._ensure_asset_types_exists( session, component_list @@ -180,45 +178,6 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): if asset_version not in instance.data[asset_versions_key]: instance.data[asset_versions_key].append(asset_version) - def _set_task_status(self, instance, project_entity, task_entity, session): - if not project_entity: - self.log.info("Task status won't be set, project is not known.") - return - - if not task_entity: - self.log.info("Task status won't be set, task is not known.") - return - - status_name = instance.context.data.get("ftrackStatus") - if not status_name: - self.log.info("Ftrack status name is not set.") - return - - self.log.debug( - "Ftrack status name will be (maybe) set to \"{}\"".format( - status_name - ) - ) - - project_schema = project_entity["project_schema"] - task_statuses = project_schema.get_statuses( - "Task", task_entity["type_id"] - ) - task_statuses_by_low_name = { - status["name"].lower(): status for status in task_statuses - } - status = task_statuses_by_low_name.get(status_name.lower()) - if not status: - self.log.warning(( - "Task status \"{}\" won't be set," - " status is now allowed on task type \"{}\"." - ).format(status_name, task_entity["type"]["name"])) - return - - self.log.info("Setting task status to \"{}\"".format(status_name)) - task_entity["status"] = status - session.commit() - def _fill_component_locations(self, session, component_list): components_by_location_name = collections.defaultdict(list) components_by_location_id = collections.defaultdict(list) diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_farm_status.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_farm_status.py deleted file mode 100644 index ab5738c33f..0000000000 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_farm_status.py +++ /dev/null @@ -1,150 +0,0 @@ -import pyblish.api -from openpype.lib import filter_profiles - - -class IntegrateFtrackFarmStatus(pyblish.api.ContextPlugin): - """Change task status when should be published on farm. - - Instance which has set "farm" key in data to 'True' is considered as will - be rendered on farm thus it's status should be changed. - """ - - order = pyblish.api.IntegratorOrder + 0.48 - label = "Integrate Ftrack Farm Status" - - farm_status_profiles = [] - - def process(self, context): - # Quick end - if not self.farm_status_profiles: - project_name = context.data["projectName"] - self.log.info(( - "Status profiles are not filled for project \"{}\". Skipping" - ).format(project_name)) - return - - filtered_instances = self.filter_instances(context) - instances_with_status_names = self.get_instances_with_statuse_names( - context, filtered_instances - ) - if instances_with_status_names: - self.fill_statuses(context, instances_with_status_names) - - def filter_instances(self, context): - filtered_instances = [] - for instance in context: - # Skip disabled instances - if instance.data.get("publish") is False: - continue - subset_name = instance.data["subset"] - msg_start = "Skipping instance {}.".format(subset_name) - if not instance.data.get("farm"): - self.log.debug( - "{} Won't be rendered on farm.".format(msg_start) - ) - continue - - task_entity = instance.data.get("ftrackTask") - if not task_entity: - self.log.debug( - "{} Does not have filled task".format(msg_start) - ) - continue - - filtered_instances.append(instance) - return filtered_instances - - def get_instances_with_statuse_names(self, context, instances): - instances_with_status_names = [] - for instance in instances: - family = instance.data["family"] - subset_name = instance.data["subset"] - task_entity = instance.data["ftrackTask"] - host_name = context.data["hostName"] - task_name = task_entity["name"] - task_type = task_entity["type"]["name"] - status_profile = filter_profiles( - self.farm_status_profiles, - { - "hosts": host_name, - "task_types": task_type, - "task_names": task_name, - "families": family, - "subsets": subset_name, - }, - logger=self.log - ) - if not status_profile: - # There already is log in 'filter_profiles' - continue - - status_name = status_profile["status_name"] - if status_name: - instances_with_status_names.append((instance, status_name)) - return instances_with_status_names - - def fill_statuses(self, context, instances_with_status_names): - # Prepare available task statuses on the project - project_name = context.data["projectName"] - session = context.data["ftrackSession"] - project_entity = session.query(( - "select project_schema from Project where full_name is \"{}\"" - ).format(project_name)).one() - project_schema = project_entity["project_schema"] - - task_type_ids = set() - for item in instances_with_status_names: - instance, _ = item - task_entity = instance.data["ftrackTask"] - task_type_ids.add(task_entity["type"]["id"]) - - task_statuses_by_type_id = { - task_type_id: project_schema.get_statuses("Task", task_type_id) - for task_type_id in task_type_ids - } - - # Keep track if anything has changed - skipped_status_names = set() - status_changed = False - for item in instances_with_status_names: - instance, status_name = item - task_entity = instance.data["ftrackTask"] - task_statuses = task_statuses_by_type_id[task_entity["type"]["id"]] - status_name_low = status_name.lower() - - status_id = None - status_name = None - # Skip if status name was already tried to be found - for status in task_statuses: - if status["name"].lower() == status_name_low: - status_id = status["id"] - status_name = status["name"] - break - - if status_id is None: - if status_name_low not in skipped_status_names: - skipped_status_names.add(status_name_low) - joined_status_names = ", ".join({ - '"{}"'.format(status["name"]) - for status in task_statuses - }) - self.log.warning(( - "Status \"{}\" is not available on project \"{}\"." - " Available statuses are {}" - ).format(status_name, project_name, joined_status_names)) - continue - - # Change task status id - if status_id != task_entity["status_id"]: - task_entity["status_id"] = status_id - status_changed = True - path = "/".join([ - item["name"] - for item in task_entity["link"] - ]) - self.log.debug("Set status \"{}\" to \"{}\"".format( - status_name, path - )) - - if status_changed: - session.commit() diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_status.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_status.py new file mode 100644 index 0000000000..e862dba7fc --- /dev/null +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_status.py @@ -0,0 +1,433 @@ +import copy + +import pyblish.api +from openpype.lib import filter_profiles + + +def create_chunks(iterable, chunk_size=None): + """Separate iterable into multiple chunks by size. + + Args: + iterable(list|tuple|set): Object that will be separated into chunks. + chunk_size(int): Size of one chunk. Default value is 200. + + Returns: + list: Chunked items. + """ + chunks = [] + + tupled_iterable = tuple(iterable) + if not tupled_iterable: + return chunks + iterable_size = len(tupled_iterable) + if chunk_size is None: + chunk_size = 200 + + if chunk_size < 1: + chunk_size = 1 + + for idx in range(0, iterable_size, chunk_size): + chunks.append(tupled_iterable[idx:idx + chunk_size]) + return chunks + + +class CollectFtrackTaskStatuses(pyblish.api.ContextPlugin): + """Collect available task statuses on the project. + + This is preparation for integration of task statuses. + + Requirements: + ftrackSession (ftrack_api.Session): Prepared ftrack session. + + Provides: + ftrackTaskStatuses (dict[str, list[Any]]): Dictionary of available + task statuses on project by task type id. + ftrackStatusByTaskId (dict[str, str]): Empty dictionary of task + statuses by task id. Status on task can be set only once. + Value should be a name of status. + """ + + # After 'CollectFtrackApi' + order = pyblish.api.CollectorOrder + 0.4992 + label = "Collect Ftrack Task Statuses" + settings_category = "ftrack" + + def process(self, context): + ftrack_session = context.data("ftrackSession") + if ftrack_session is None: + self.log.info("Ftrack session is not created.") + return + + # Prepare available task statuses on the project + project_name = context.data["projectName"] + project_entity = ftrack_session.query(( + "select project_schema from Project where full_name is \"{}\"" + ).format(project_name)).one() + project_schema = project_entity["project_schema"] + + task_type_ids = { + task_type["id"] + for task_type in ftrack_session.query("select id from Type").all() + } + task_statuses_by_type_id = { + task_type_id: project_schema.get_statuses("Task", task_type_id) + for task_type_id in task_type_ids + } + context.data["ftrackTaskStatuses"] = task_statuses_by_type_id + context.data["ftrackStatusByTaskId"] = {} + self.log.info("Collected ftrack task statuses.") + + +class IntegrateFtrackStatusBase(pyblish.api.InstancePlugin): + """Base plugin for status collection. + + Requirements: + projectName (str): Name of the project. + hostName (str): Name of the host. + ftrackSession (ftrack_api.Session): Prepared ftrack session. + ftrackTaskStatuses (dict[str, list[Any]]): Dictionary of available + task statuses on project by task type id. + ftrackStatusByTaskId (dict[str, str]): Empty dictionary of task + statuses by task id. Status on task can be set only once. + Value should be a name of status. + """ + + active = False + settings_key = None + status_profiles = [] + + @classmethod + def apply_settings(cls, project_settings): + settings_key = cls.settings_key + if settings_key is None: + settings_key = cls.__name__ + + try: + settings = project_settings["ftrack"]["publish"][settings_key] + except KeyError: + return + + for key, value in settings.items(): + setattr(cls, key, value) + + def process(self, instance): + context = instance.context + # No profiles -> skip + profiles = self.get_status_profiles() + if not profiles: + project_name = context.data["projectName"] + self.log.info(( + "Status profiles are not filled for project \"{}\". Skipping" + ).format(project_name)) + return + + # Task statuses were not collected -> skip + task_statuses_by_type_id = context.data.get("ftrackTaskStatuses") + if not task_statuses_by_type_id: + self.log.info( + "Ftrack task statuses are not collected. Skipping.") + return + + self.prepare_status_names(context, instance, profiles) + + def get_status_profiles(self): + """List of profiles to determine status name. + + Example profile item: + { + "host_names": ["nuke"], + "task_types": ["Compositing"], + "task_names": ["Comp"], + "families": ["render"], + "subset_names": ["renderComp"], + "status_name": "Rendering", + } + + Returns: + list[dict[str, Any]]: List of profiles. + """ + + return self.status_profiles + + def prepare_status_names(self, context, instance, profiles): + if not self.is_valid_instance(context, instance): + return + + filter_data = self.get_profile_filter_data(context, instance) + status_profile = filter_profiles( + profiles, + filter_data, + logger=self.log + ) + if not status_profile: + return + + status_name = status_profile["status_name"] + if status_name: + self.fill_status(context, instance, status_name) + + def get_profile_filter_data(self, context, instance): + task_entity = instance.data["ftrackTask"] + return { + "host_names": context.data["hostName"], + "task_types": task_entity["type"]["name"], + "task_names": task_entity["name"], + "families": instance.data["family"], + "subset_names": instance.data["subset"], + } + + def is_valid_instance(self, context, instance): + """Filter instances that should be processed. + + Ignore instances that are not enabled for publishing or don't have + filled task. Also skip instances with tasks that already have defined + status. + + Plugin should do more filtering which is custom for plugin logic. + + Args: + context (pyblish.api.Context): Pyblish context. + instance (pyblish.api.Instance): Instance to process. + + Returns: + list[pyblish.api.Instance]: List of instances that should be + processed. + """ + + ftrack_status_by_task_id = context.data["ftrackStatusByTaskId"] + # Skip disabled instances + if instance.data.get("publish") is False: + return False + + task_entity = instance.data.get("ftrackTask") + if not task_entity: + self.log.debug( + "Skipping instance Does not have filled task".format( + instance.data["subset"])) + return False + + task_id = task_entity["id"] + if task_id in ftrack_status_by_task_id: + self.log.debug("Status for task {} was already defined".format( + task_entity["name"] + )) + return False + + return True + + def fill_status(self, context, instance, status_name): + """Fill status for instance task. + + If task already had set status, it will be skipped. + + Args: + context (pyblish.api.Context): Pyblish context. + instance (pyblish.api.Instance): Pyblish instance. + status_name (str): Name of status to set. + """ + + task_entity = instance.data["ftrackTask"] + task_id = task_entity["id"] + ftrack_status_by_task_id = context.data["ftrackStatusByTaskId"] + if task_id in ftrack_status_by_task_id: + self.log.debug("Status for task {} was already defined".format( + task_entity["name"] + )) + return + + ftrack_status_by_task_id[task_id] = status_name + self.log.info(( + "Task {} will be set to \"{}\" status." + ).format(task_entity["name"], status_name)) + + +class IntegrateFtrackFarmStatus(IntegrateFtrackStatusBase): + """Collect task status names for instances that are sent to farm. + + Instance which has set "farm" key in data to 'True' is considered as will + be rendered on farm thus it's status should be changed. + + Requirements: + projectName (str): Name of the project. + hostName (str): Name of the host. + ftrackSession (ftrack_api.Session): Prepared ftrack session. + ftrackTaskStatuses (dict[str, list[Any]]): Dictionary of available + task statuses on project by task type id. + ftrackStatusByTaskId (dict[str, str]): Empty dictionary of task + statuses by task id. Status on task can be set only once. + Value should be a name of status. + """ + + order = pyblish.api.IntegratorOrder + 0.48 + label = "Ftrack Task Status To Farm Status" + active = True + + farm_status_profiles = [] + status_profiles = None + + def is_valid_instance(self, context, instance): + if not instance.data.get("farm"): + self.log.debug("{} Won't be rendered on farm.".format( + instance.data["subset"] + )) + return False + return super(IntegrateFtrackFarmStatus, self).is_valid_instance( + context, instance) + + def get_status_profiles(self): + if self.status_profiles is None: + profiles = copy.deepcopy(self.farm_status_profiles) + for profile in profiles: + profile["host_names"] = profile.pop("hosts") + profile["subset_names"] = profile.pop("subsets") + self.status_profiles = profiles + return self.status_profiles + + +class IntegrateFtrackLocalStatus(IntegrateFtrackStatusBase): + """Collect task status names for instances that are published locally. + + Instance which has set "farm" key in data to 'True' is considered as will + be rendered on farm thus it's status should be changed. + + Requirements: + projectName (str): Name of the project. + hostName (str): Name of the host. + ftrackSession (ftrack_api.Session): Prepared ftrack session. + ftrackTaskStatuses (dict[str, list[Any]]): Dictionary of available + task statuses on project by task type id. + ftrackStatusByTaskId (dict[str, str]): Empty dictionary of task + statuses by task id. Status on task can be set only once. + Value should be a name of status. + """ + + order = IntegrateFtrackFarmStatus.order + 0.001 + label = "Ftrack Task Status Local Publish" + active = True + targets = ["local"] + settings_key = "ftrack_task_status_local_publish" + + def is_valid_instance(self, context, instance): + if instance.data.get("farm"): + self.log.debug("{} Will be rendered on farm.".format( + instance.data["subset"] + )) + return False + return super(IntegrateFtrackLocalStatus, self).is_valid_instance( + context, instance) + + +class IntegrateFtrackOnFarmStatus(IntegrateFtrackStatusBase): + """Collect task status names for instances that are published on farm. + + Requirements: + projectName (str): Name of the project. + hostName (str): Name of the host. + ftrackSession (ftrack_api.Session): Prepared ftrack session. + ftrackTaskStatuses (dict[str, list[Any]]): Dictionary of available + task statuses on project by task type id. + ftrackStatusByTaskId (dict[str, str]): Empty dictionary of task + statuses by task id. Status on task can be set only once. + Value should be a name of status. + """ + + order = IntegrateFtrackLocalStatus.order + 0.001 + label = "Ftrack Task Status On Farm Status" + active = True + targets = ["farm"] + settings_key = "ftrack_task_status_on_farm_publish" + + +class IntegrateFtrackTaskStatus(pyblish.api.ContextPlugin): + # Use order of Integrate Ftrack Api plugin and offset it before or after + base_order = pyblish.api.IntegratorOrder + 0.499 + # By default is after Integrate Ftrack Api + order = base_order + 0.0001 + label = "Integrate Ftrack Task Status" + + @classmethod + def apply_settings(cls, project_settings): + """Apply project settings to plugin. + + Args: + project_settings (dict[str, Any]): Project settings. + """ + + settings = ( + project_settings["ftrack"]["publish"]["IntegrateFtrackTaskStatus"] + ) + diff = 0.001 + if not settings["after_version_statuses"]: + diff = -diff + cls.order = cls.base_order + diff + + def process(self, context): + task_statuses_by_type_id = context.data.get("ftrackTaskStatuses") + if not task_statuses_by_type_id: + self.log.info("Ftrack task statuses are not collected. Skipping.") + return + + status_by_task_id = self._get_status_by_task_id(context) + if not status_by_task_id: + self.log.info("No statuses to set. Skipping.") + return + + ftrack_session = context.data["ftrackSession"] + + task_entities = self._get_task_entities( + ftrack_session, status_by_task_id) + + for task_entity in task_entities: + task_path = "/".join([ + item["name"] for item in task_entity["link"] + ]) + task_id = task_entity["id"] + type_id = task_entity["type_id"] + new_status = None + status_name = status_by_task_id[task_id] + self.log.debug( + "Status to set {} on task {}.".format(status_name, task_path)) + status_name_low = status_name.lower() + available_statuses = task_statuses_by_type_id[type_id] + for status in available_statuses: + if status["name"].lower() == status_name_low: + new_status = status + break + + if new_status is None: + joined_statuses = ", ".join([ + "'{}'".format(status["name"]) + for status in available_statuses + ]) + self.log.debug(( + "Status '{}' was not found in available statuses: {}." + ).format(status_name, joined_statuses)) + continue + + if task_entity["status_id"] != new_status["id"]: + task_entity["status_id"] = new_status["id"] + + self.log.debug("Changing status of task '{}' to '{}'".format( + task_path, status_name + )) + ftrack_session.commit() + + def _get_status_by_task_id(self, context): + status_by_task_id = context.data["ftrackStatusByTaskId"] + return { + task_id: status_name + for task_id, status_name in status_by_task_id.items() + if status_name + } + + def _get_task_entities(self, ftrack_session, status_by_task_id): + task_entities = [] + for chunk_ids in create_chunks(status_by_task_id.keys()): + joined_ids = ",".join( + ['"{}"'.format(task_id) for task_id in chunk_ids] + ) + task_entities.extend(ftrack_session.query(( + "select id, type_id, status_id, link from Task" + " where id in ({})" + ).format(joined_ids)).all()) + return task_entities diff --git a/openpype/modules/ftrack/plugins/publish/integrate_hierarchy_ftrack.py b/openpype/modules/ftrack/plugins/publish/integrate_hierarchy_ftrack.py index 6daaea5f18..a1aa7c0daa 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_hierarchy_ftrack.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_hierarchy_ftrack.py @@ -63,7 +63,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): """ order = pyblish.api.IntegratorOrder - 0.04 - label = 'Integrate Hierarchy To Ftrack' + label = "Integrate Hierarchy To Ftrack" families = ["shot"] hosts = [ "hiero", @@ -94,14 +94,13 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): "Project \"{}\" was not found on ftrack.".format(project_name) ) - self.context = context self.session = session self.ft_project = project self.task_types = self.get_all_task_types(project) self.task_statuses = self.get_task_statuses(project) # import ftrack hierarchy - self.import_to_ftrack(project_name, hierarchy_context) + self.import_to_ftrack(context, project_name, hierarchy_context) def query_ftrack_entitites(self, session, ft_project): project_id = ft_project["id"] @@ -227,7 +226,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): return output - def import_to_ftrack(self, project_name, hierarchy_context): + def import_to_ftrack(self, context, project_name, hierarchy_context): # Prequery hiearchical custom attributes hier_attrs = get_pype_attr(self.session)[1] hier_attr_by_key = { @@ -258,7 +257,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): self.session, matching_entities, hier_attrs) # Get ftrack api module (as they are different per python version) - ftrack_api = self.context.data["ftrackPythonModule"] + ftrack_api = context.data["ftrackPythonModule"] # Use queue of hierarchy items to process import_queue = collections.deque() @@ -292,7 +291,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): # CUSTOM ATTRIBUTES custom_attributes = entity_data.get('custom_attributes', {}) instances = [] - for instance in self.context: + for instance in context: instance_asset_name = instance.data.get("asset") if ( instance_asset_name @@ -369,6 +368,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): if task_name: instances_by_task_name[task_name.lower()].append(instance) + ftrack_status_by_task_id = context.data["ftrackStatusByTaskId"] tasks = entity_data.get('tasks', []) existing_tasks = [] tasks_to_create = [] @@ -389,11 +389,11 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): for task_name, task_type in tasks_to_create: task_entity = self.create_task( - name=task_name, - task_type=task_type, - parent=entity + task_name, + task_type, + entity, + ftrack_status_by_task_id ) - for instance in instances_by_task_name[task_name.lower()]: instance.data["ftrackTask"] = task_entity @@ -481,7 +481,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): for status in task_workflow_statuses } - def create_task(self, name, task_type, parent): + def create_task(self, name, task_type, parent, ftrack_status_by_task_id): filter_data = { "task_names": name, "task_types": task_type @@ -491,12 +491,14 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): filter_data ) status_id = None + status_name = None if profile: status_name = profile["status_name"] status_name_low = status_name.lower() for _status_id, status in self.task_statuses.items(): if status["name"].lower() == status_name_low: status_id = _status_id + status_name = status["name"] break if status_id is None: @@ -523,6 +525,8 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): self.session._configure_locations() six.reraise(tp, value, tb) + if status_id is not None: + ftrack_status_by_task_id[task["id"]] = None return task def _get_active_assets(self, context): diff --git a/openpype/settings/defaults/project_settings/ftrack.json b/openpype/settings/defaults/project_settings/ftrack.json index 4ca4a35d1f..b87c45666d 100644 --- a/openpype/settings/defaults/project_settings/ftrack.json +++ b/openpype/settings/defaults/project_settings/ftrack.json @@ -493,7 +493,29 @@ "upload_reviewable_with_origin_name": false }, "IntegrateFtrackFarmStatus": { - "farm_status_profiles": [] + "farm_status_profiles": [ + { + "hosts": [ + "celaction" + ], + "task_types": [], + "task_names": [], + "families": [ + "render" + ], + "subsets": [], + "status_name": "Render" + } + ] + }, + "ftrack_task_status_local_publish": { + "status_profiles": [] + }, + "ftrack_task_status_on_farm_publish": { + "status_profiles": [] + }, + "IntegrateFtrackTaskStatus": { + "after_version_statuses": true } } } diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json b/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json index 7050721742..157a8d297e 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json @@ -1058,7 +1058,7 @@ { "type": "dict", "key": "IntegrateFtrackFarmStatus", - "label": "Integrate Ftrack Farm Status", + "label": "Ftrack Status To Farm", "children": [ { "type": "label", @@ -1068,7 +1068,7 @@ "type": "list", "collapsible": true, "key": "farm_status_profiles", - "label": "Farm status profiles", + "label": "Profiles", "use_label_wrap": true, "object_type": { "type": "dict", @@ -1114,6 +1114,142 @@ } } ] + }, + { + "type": "dict", + "key": "ftrack_task_status_local_publish", + "label": "Ftrack Status Local Integration", + "children": [ + { + "type": "label", + "label": "Change status of task when is integrated locally" + }, + { + "type": "list", + "collapsible": true, + "key": "status_profiles", + "label": "Profiles", + "use_label_wrap": true, + "object_type": { + "type": "dict", + "children": [ + { + "key": "host_names", + "label": "Host names", + "type": "hosts-enum", + "multiselection": true + }, + { + "key": "task_types", + "label": "Task types", + "type": "task-types-enum" + }, + { + "key": "task_names", + "label": "Task names", + "type": "list", + "object_type": "text" + }, + { + "key": "families", + "label": "Families", + "type": "list", + "object_type": "text" + }, + { + "key": "subset_names", + "label": "Subset names", + "type": "list", + "object_type": "text" + }, + { + "type": "separator" + }, + { + "key": "status_name", + "label": "Status name", + "type": "text" + } + ] + } + } + ] + }, + { + "type": "dict", + "key": "ftrack_task_status_on_farm_publish", + "label": "Ftrack Status On Farm", + "children": [ + { + "type": "label", + "label": "Change status of task when it's subset is integrated on farm" + }, + { + "type": "list", + "collapsible": true, + "key": "status_profiles", + "label": "Profiles", + "use_label_wrap": true, + "object_type": { + "type": "dict", + "children": [ + { + "key": "host_names", + "label": "Host names", + "type": "hosts-enum", + "multiselection": true + }, + { + "key": "task_types", + "label": "Task types", + "type": "task-types-enum" + }, + { + "key": "task_names", + "label": "Task names", + "type": "list", + "object_type": "text" + }, + { + "key": "families", + "label": "Families", + "type": "list", + "object_type": "text" + }, + { + "key": "subset_names", + "label": "Subset names", + "type": "list", + "object_type": "text" + }, + { + "type": "separator" + }, + { + "key": "status_name", + "label": "Status name", + "type": "text" + } + ] + } + } + ] + }, + { + "type": "dict", + "key": "IntegrateFtrackTaskStatus", + "label": "Integrate Ftrack Task Status", + "children": [ + { + "type": "label", + "label": "Apply collected task statuses. This plugin can run before or after version integration. Some status automations may conflict with status changes on versions because of wrong order." + }, + { + "type": "boolean", + "key": "after_version_statuses", + "label": "After version integration" + } + ] } ] } From 2f95aab31efdd90dbdf0b899059d87416190e329 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 15 Jun 2023 22:31:55 +0800 Subject: [PATCH 159/207] clean up the code --- .../maya/plugins/load/load_arnold_standin.py | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index f45a070c85..1a582647cc 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -2,6 +2,7 @@ import os import clique import maya.cmds as cmds +import maya.utils from openpype.settings import get_project_settings from openpype.pipeline import ( @@ -23,19 +24,6 @@ def is_sequence(files): return sequence -def post_process(): - """ - Make sure mtoa script finished loading - before the loader doing any action - """ - import maya.utils - from qtpy import QtWidgets - - cmds.refresh(force=True) - maya.utils.processIdleEvents() - QtWidgets.QApplication.instance().processEvents() - - class ArnoldStandinLoader(load.LoaderPlugin): """Load as Arnold standin""" @@ -48,18 +36,15 @@ class ArnoldStandinLoader(load.LoaderPlugin): color = "orange" def load(self, context, name, namespace, options): - # Make sure user has loaded arnold - # before importing `mtoa.ui.arnoldmenu` - # and getting attribute from defaultArnoldRenderOption.operator - # Otherwises standins will not be loaded successfully for - # every first time using this loader after the build - """ if not cmds.pluginInfo("mtoa", query=True, loaded=True): - raise RuntimeError("Plugin 'mtoa' must be loaded" - " before using this loader") - """ - cmds.loadPlugin("mtoa", quiet=True) - post_process() + # Allow mtoa plugin load to process all its events + # because otherwise `defaultArnoldRenderOptions.operator` + # does not exist yet and some connections to the standin + # can't be correctly generated on create resulting in an error + cmds.loadPlugin("mtoa") + cmds.refresh(force=True) + maya.utils.processIdleEvents() + import mtoa.ui.arnoldmenu version = context['version'] From f9a64192b37d5c474d2be7803d6f0242415e7539 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 16 Jun 2023 10:50:38 +0200 Subject: [PATCH 160/207] fix match check of save sequence (#5148) --- openpype/tools/publisher/window.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index 006098cb37..2bda0c1cfe 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -453,7 +453,11 @@ class PublisherWindow(QtWidgets.QDialog): return save_match = event.matches(QtGui.QKeySequence.Save) - if save_match == QtGui.QKeySequence.ExactMatch: + # PySide2 and PySide6 support + if not isinstance(save_match, bool): + save_match = save_match == QtGui.QKeySequence.ExactMatch + + if save_match: if not self._controller.publish_has_started: self._save_changes(True) event.accept() From 97faf90463773c8d6e8ed8323133df18953cf3b1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 16 Jun 2023 17:01:47 +0800 Subject: [PATCH 161/207] bug fix arnoldExportAss unable to export selected set members --- .../plugins/publish/collect_arnold_scene_source.py | 9 ++++++++- .../plugins/publish/extract_arnold_scene_source.py | 11 +++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py index f160a3a0c5..1bacd80f11 100644 --- a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py @@ -25,11 +25,18 @@ class CollectArnoldSceneSource(pyblish.api.InstancePlugin): members = cmds.ls(members, long=True) children = get_all_children(members) instance.data["contentMembers"] = children + # TODO: include another instance.data for content members + instance.data["contentMembersTransform"] = members self.log.debug("content members: {}".format(children)) + self.log.debug("content members Transform : {}".format(members)) elif objset.endswith("proxy_SET"): - set_members = get_all_children(cmds.ls(members, long=True)) + proxy_members = cmds.ls(members, long=True) + set_members = get_all_children(proxy_members) instance.data["proxy"] = set_members + instance.data["proxyTransform"] = proxy_members + # TODO: include another instance.data for proxy self.log.debug("proxy members: {}".format(set_members)) + self.log.debug("proxy members Transform: {}".format(proxy_members)) # Use camera in object set if present else default to render globals # camera. diff --git a/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py index 14bcc71da6..9ed475e20f 100644 --- a/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py @@ -69,9 +69,10 @@ class ExtractArnoldSceneSource(publish.Extractor): "camera": instance.data["camera"], "mask": mask } - + # TODO: dont use instance.data["contentMembers"] + # but use the new instance.data["contentMemberTransforms"] filenames, nodes_by_id = self._extract( - instance.data["contentMembers"], attribute_data, kwargs + instance.data["contentMembersTransform"], attribute_data, kwargs ) if "representations" not in instance.data: @@ -109,8 +110,10 @@ class ExtractArnoldSceneSource(publish.Extractor): return kwargs["filename"] = file_path.replace(".ass", "_proxy.ass") + # TODO: dont use instance.data["proxy"] + # but use the new instance.data["proxyTransforms"] filenames, _ = self._extract( - instance.data["proxy"], attribute_data, kwargs + instance.data["proxyTransform"], attribute_data, kwargs ) representation = { @@ -187,7 +190,7 @@ class ExtractArnoldSceneSource(publish.Extractor): self.log.info( "Extracting ass sequence with: {}".format(kwargs) ) - + # arnoldExportAss -selected needs an active selection or a list of objects exported_files = cmds.arnoldExportAss(**kwargs) for file in exported_files: From e10b228be2a460f7a606dba19044bfed1459f56d Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 16 Jun 2023 17:07:56 +0800 Subject: [PATCH 162/207] hound fix --- igniter/.ass | 212 ++++++++++++++++++ .../publish/collect_arnold_scene_source.py | 6 +- .../publish/extract_arnold_scene_source.py | 2 +- 3 files changed, 217 insertions(+), 3 deletions(-) create mode 100644 igniter/.ass diff --git a/igniter/.ass b/igniter/.ass new file mode 100644 index 0000000000..599a76d732 --- /dev/null +++ b/igniter/.ass @@ -0,0 +1,212 @@ +### exported: Thu Jun 15 17:07:53 2023 +### from: Arnold 7.1.3.2 [2a385cac] windows clang-10.0.1 oiio-2.4.1 osl-1.12.0 vdb-7.1.1 adlsdk-6.3.1.44 clmhub-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/09/12 08:50:17 +### host app: MtoA 5.2.1.1 6a048927 (fix-5.2.1) Maya 2023 +### bounds: -1.207354 -0.269835 -1.207354 1.207354 2.144874 1.207354 +### user: Kayla +### render_layer: defaultRenderLayer +### scene: D:/dummy_test/test_Project/test/work/test_v002/test_project_test_test_v002_v070.mb +### meters_per_unit: 0.010000 + + + +options +{ + AA_samples 3 + outputs 4 1 STRING + "RGBA RGBA defaultArnoldFilter/gaussian_filter defaultArnoldDriver/driver_exr.RGBA" + "P VECTOR aiAOVFilter1/closest_filter defaultArnoldDriver/driver_exr.RGBA" + "Pref RGB aiAOVFilter2/closest_filter defaultArnoldDriver/driver_exr.RGBA" + "albedo RGB defaultArnoldFilter/gaussian_filter defaultArnoldDriver/driver_exr.RGBA" + xres 1920 + yres 1080 + texture_per_file_stats on + texture_searchpath "[OPENPYPE_PROJECT_ROOT_WORK];D:/dummy_test/test_Project/test/work/test_v002/sourceimages" + texture_automip off + camera "/camera1/cameraShape1" + color_manager "defaultColorMgtGlobals" + operator "aiMerge1" + meters_per_unit 0.00999999978 + frame 1 + fps 25 + procedural_searchpath "[OPENPYPE_PROJECT_ROOT_WORK];D:/dummy_test/test_Project/test/work/test_v002/" + GI_diffuse_depth 1 + GI_specular_depth 1 + GI_transmission_depth 8 + declare render_layer constant STRING + render_layer "defaultRenderLayer" +} + +gaussian_filter +{ + name defaultArnoldFilter/gaussian_filter +} + +driver_exr +{ + name defaultArnoldDriver/driver_exr.RGBA + filename "D:/dummy_test/test_Project/test/work/test_v002/renders/test_project_test_test_v002_v070/masterLayer/masterLayer.exr" + color_space "" +} + +closest_filter +{ + name aiAOVFilter1/closest_filter +} + +closest_filter +{ + name aiAOVFilter2/closest_filter +} + +merge +{ + name aiMerge1 + inputs "test_01_:string_replace_operator" +} + +string_replace +{ + name test_01_:string_replace_operator + selection "*.(@node=='alembic')" + match "resources/test_project_test_modelMain_v067_proxy.abc" + replace "test_project_test_modelMain_v067.abc" +} + +color_manager_ocio +{ + name defaultColorMgtGlobals + config "D:/maya_config/OCIO-configs/Maya2022-default/config.ocio" + color_space_linear "ACEScg" +} + +polymesh +{ + name /proxy/pSphere/pSphereShape + visibility 255 + sidedness 255 + matrix + 2.41470838 0 0 0 + 0 2.41470838 0 0 + 0 0 2.41470838 0 + 0 0.937519372 0 1 + shader "lambert1" + id 2564139679 + nsides 6 1 UINT +4 4 4 4 4 4 + vidxs 24 1 b85UINT +B$ZuK*%:$$-?2$vMr4%:&UObB$w/J=(3BP? + vlist 8 1 b85VECTOR +aDq99aDq9989+]c89+]caDq9989+]caDq99!89+]c$$$$)aDq9989+]caDq9989+]c89+]c!aDq99$$$$(89+]caDq99aDq99 + nlist 24 1 b85VECTOR +zzyzzyzzyzzyzyzzyzzyzzy!$$$$$$$$$'aRT=dzzaRT=dzzaRT=dzzaRT=dzaRT=dzzaRT=dzzaRT=dzzaRT=dzyzzyzzyzzyzzaRT=dzzaRT=dzzaRT=dzzaRT=dzz + uvlist 14 1 b85VECTOR2 +82:0xz80l$K@wi$mMpJ$pnKs$PHvV$PKhS$rXa4$v$<]$USg@$UVY=$wcQs%&/-G$Z^X*$ZaJ'%'nB]%+9s1$_iHi$_l:f%-$3G%0Dcp$dt9S$dw+P%2/$1$h@,s$j**=$j,q:%79ip%:ZED$o4p'$o7b$%j%8uiM%8x[J%[0T+%^Q/T%>+Z7%>.L4%`;Dj%c[u>%C6Jv%C9%mqVg%ML,J%MNsG%o[l(%s'GQ%RVr4%RYd1%tf\g%x28;%5U-2%WdT\&$qMQ&(=)%%\lS]%\oEZ&*'>;&-Gnd%awDG%b%6D&/2/%&2R_N%g-51%g0'.&4RV8&As1a%vM\D%vPNA&C]Fw&$nOd&&XM.&&[?+&Hh7a&L3h5&+c=m&+f/j&Ms(K&Q>Xt&0n.W&0puT&S(n5&VII^&5xtA&6&f>&X3^t&[T:H&;.e+&;1W(&]>O^&`_+2&@9Uj&@x&jta[&JO7>&JR);&l^vq&p*RE&OZ((&O\o%&qig[&u5C/&Tdmg&Tg_d&vtXE'%@3n&Yo^Q&YrPN''*I/'*K$X&_%O;&_(A8',59n'/UjB&d0@%&d31w'1@*X'4`[,&G.Ox&i=wM'6JpB'9kKk&nEvN&nHhK';Ua,'>vb'VriE'Vu[B($*ai('N/L'\(Z/'\+L,()8Db(,Xu6'a3Jn'a6;X'fA-U(3N&6(6nV_'kI,B'kKs?(8Xku(<$GI'pSr,'pVd)(=c\_(A/83'u^bk'uaTh(BnMI(F:(r'X\ri(%lE>(H$>3(KDn\(*tD?(*w6<(M/.r(PO_F(0*5)(0-'&(R9t\(UZP0(55%h(57le(WDeF(Ze@o(:?kR(:B]O(\OV0(_p1Y(?J\<(?MN9(aZFo(e%wC(DUM&(DX>x(fe7Y(Gv@F(I`=e(Ic/b(kp(C(o;Xl(Nk.O(NmuL(q%n-(tFIV(Sut9(Sxf6(v0^l)$Q:@(Y+dx(Y.Vu)&;OV))\+*(^6Ub(^9G_)+F@@).fpi(cAFL(cD8I)0Q1*)3qaS(hL76(hO)3)5Y/Z)9'R=(mW'u(mYnr):fgS)>2C'(ram_(rd_\)?qX=)C=3f(wl^I(woPF)E'I')HH$P)'wO3)(%A0)J29f)MRj:)--?r)-01o)O=*P)R][$)280\)2:wY)TGp:)WhKc(j6@Z)7Eh/)YRa$)\sc`)Kn9C)Kq+@)n(xv)qITJ)Q$*-)Q&q*)s3i`)vTE4)V.ol)V1ai)x>ZJ)YOc7)[9`V)[Z)toi=)tr[:*B*Sp*EK/D*%%Z'*%(L$*G2RK*JUu.**0Jf**3-M*QK&.*TkVW*4F,:*4Hs7*VUkm*YvGA*9Pr$*9Scv*[`\W*_,8+*>[bc*>^T`*`kMA*d7(j*CfSM*CiEJ*ev>+*iAnT*&dcK*Ht5u*k,.j*nL_>*N'4v*N*&s*p6tT*sWP(*S2%`*S4l]*uAe>*xb@g*Xp+/b7Q+3-h%*g]=]*g`/Z+4m(;*k)1(*lh.G*ljuD+9wn%+=CIN*qrt1*quf.+?-^d+BN:8*w(dp*w+Vm+D8ON+GY*w+'3UZ+'6GW+IC@8+Lcpa+,>FD+,A8A+NN0w+QnaK+1I7.+1L)++SXva+W$R5+6T'm+6Vnj+X`u<+Yj%R+Yj1W+Yj=\+YjIa+YjUf+Yjak+Yjmp+Yk$u+Yk1%+Yk=*+YkI/+YkU4+Yka9+Ykm>+Yl$C+Yl0H+Yl$GoW-$IVb>$IVnF$K>Tg$R08V$SlCg$SlOo$UT6;$\Eo*$^-%;$^-1C$_ild$f[PS$$)E7$)3rI$j*)Y$ka82$/uZ&$0%nh$mMp;$plM,$:6;M$:;,-$rXa($uwb%$DKqs$DP>G$wcQj%&-vs$NaSD$NePa%'nBW%+96l$Xw4j$Y%c&%-$3D%0DKe$c7k;$c:u@%2/$1$j$j?$hC+1$hEr-%5R^`%:ZED$o4p'$o7b$%+Z7%>.L4%`;Dj%c[u>%C6Jv%C9%mqVg%ML,J%MNsG%o[l(%s'GQ%RVr4%RYd1%tf\g%x28;%7<8B%YK_m&&XL\&(=)$%\lS\%\oEZ&*'>;&-Gnd%awDG%b%6D&/2/%&2R_N%g-51%g0'.&4RV8&As1a%vM\D%vPNA&C]Fw&&Ufx&$qMw&$t?s&G,,Q&L3h5&+c=m&+f/j&Ms(K&Q>Xt&0n.W&0puT&S(n5&VII^&5xtA&6&f>&X3^t&[T:H&;.e+&;1W(&]>O^&`_+2&@9Uj&@vb'VriE'Vu[B($*mn(%fm9'\(N,'\+@(()8Db(,Xu6'a3Jn'a6;X'fA-U(3N&6(6nV_'kI,B'kKs?(8Xku(<$GI'pSr,'pVd)(=c\_(A/83'u^bk'uaTh(BnMI(F:(r'ZD)$('SPO(I`=>(KDn[(*tD>(*w6<(M/.r(PO_F(0*5)(0-'&(R9t\(UZP0(55%h(57le(WDeF(Ze@o(:?kR(:B]O(\OV0(_p1Y(?J\<(?MN9(aZFo(e%wC(DUM&(DX>x(fe7Y(I]WZ(H$>Y(H'0U(j3r3(o;Xl(Nk.O(NmuL(q%n-(tFIV(Sut9(Sxf6(v0^l)$Q:@(Y+dx(Y.Vu)&;OV))\+*(^6Ub(^9G_)+F@@).fpi(cAFL(cD8I)0Q1*)3qaS(hL76(hO)3)5Y;_)7@;*(mVpr(mYbn):fgS)>2C'(ram_(rd_\)?qX=)C=3f(wl^I(woPF)E'I')HH$P)'wO3)(%A0)J29f)MRj:)--?r)-01o)O=*P)R][$)280\)2:wY)TGp:)WhKc(krKj)9,s@)[9`/)\sc`)Kn9C)Kq+@)n(xv)qITJ)Q$*-)Q&q*)s3i`)vTE4)V.ol)V1ai)x>ZJ)[7%K)YRaJ)YUSF*&b@$*+j&])`DQ@)`GC=*-T;s*0tlG)eOB*)eR4'*2_,]*6*]1)jZ2i)j]$f*7irG*;5Mp)odxS)ogjP*Z)toi=)tr[:*B*Sp*EK/D*%%Z'*%(L$*G2^P*Hn]p**0>c**30_*L@5D*O`em*/;;P*/>-M*QK&.*TkVW*4F,:*4Hs7*VUkm*YvGA*9Pr$*9Scv*[`\W*_,8+*>[bc*>^T`*`kMA*d7(j*CfSM*CiEJ*ev>+*iAnT*(Kn[*J[A1*lh-u*nL_=*N'4u*N*&s*p6tT*sWP(*S2%`*S4l]*uAe>*xb@g*Xp+/b7Q+3-h%*g]=]*g`/Z+4m(;*leH<*k,/;*k.v7+8;bj+=CIN*qrt1*quf.+?-^d+BN:8*w(dp*w+Vm+D8ON+GY*w+'3UZ+'6GW+IC@8+Lcpa+,>FD+,A8A+NN0w+QnaK+1I7.+1L)++SXva+W$R5+6T'm+6Vnj+Xa,A+Yj%R+Yj1Y+YjUg+Yjmq+Yk1&+YkI0+Yka:+Yl$D+YlHN$N^ls$,R7G$,U5H$PI98$Si]]$1](1$1`&2$UT)w$XtNG$6gmp$6jkq$Z^oa$^*?1$;r^Z$;u\[$_i`K$c5/p$A(OD$A+ME$dtQ5$h?uZ$F3@.$GrI?$kfY4$o2(Y$M%H-$M(F.$pqIs$t'W%&2+G%)ROl$\Eo@$\HmA%++Z8%>.X9%aw\)%eC+N%C6Jw%C9Hx%g-Lh%jMq8%HA;a%HD9b%l8=R%oXaw%ML,K%MO*L%qC.<%tcRa%RVr5%RYp6%vMt&&$nCK%Wabt%Wd`u&&Xde&*$45%\lS^%^V\o&-Jld&0k<4%c^[]%caY^&2U]N&5v,s%hiLG%hlJH&7`N8&;+r]%mt=1%mw;2&w&@6cG%s*-p%s-+q&Av/a&EAT1%x4sZ%x7q[&G+uK&JLDp&(?dD&(BbE&L6f5&OW5Z&/1lB&/4jD&S(n4&VI=Y&4<]-&4?[.&X3^s&[T.C&9GMl&9JKm&]>O]&`^t-&>R>V&>U''3'Al'6Gf<&i;0e&i>.f'822V';RW&&nEvO&nHtP'=xwt'?&uu'bp$e'f;I5'Ek*r'En(t'ib,d'm-Q4'Jup]'Jxn^'nlrN'r8As'P+aG'P._H'swc8'wC2]'U6R1'U9P2($-Sw('MxG'ZABp'ZD@q()8Da(,Xi1'_L3Z'_O1[(.C5K(1cYp'dW$D'dYwE(3N&5(8Uao'kI,C'kL*D(:@.4(=`RY'pSr-'pVp.(?Jss(BkCC'u^bl'ua`m(DUd](Gv4-(%iSV(%lQW(I`UG(M,$l(*tD@(*wBA(NkF1(R6jV(0*5*(0-3+(Sv6p(WA[@(55%i(6t/%(Zh>o(^3c?(<'-h(<*+i(_s/Y(c>T)(A1sR(A4qS(e(uC(hIDh(FVl(r_&<(PREe(PUCf(tIGV(wil&(U]6O(U`4P)$T8@)'t\e(\O>M(\R26w(q%VK(q(TL)?qX<)C='a(v0G5(v3E6)E'I&)HGmK)&;7t)&>5u)J29e)O9uJ)--?s)-0=t)Q$Ad)TDf4)280])2;.^)V/2N)YOVs)7BvG)7EtH)[9x8)^ZG])Xp@)s3R()s6P**B*So*EJx?)x>Bh)xA@i*G5DY*JUi)*(I3R*(L1S*L@5C*O`Yh*-T$<*-Vw=*QK&-*TkJR*2^j&*2ah'*VUkl*Yv;<*7iZe*7lXf*[`\V*_,,&*[8*S2%a*S4xb*w)'R+%IKw*X^&+/_-K*bRLt*d1+.%]Z+.([[+Qq_K+U=.p+4leX+4ocZ+XcgJ+\/6o+9wVC+:%TD+]nX4+a:'Y+?-G-+?0E.+c$Hs+fDmC+D87l+D;5m+h/9]+kO^-+IC(V+IF&W+m:*G+pZNl+NMn@+NPlA+rDp1+ue?V+SX_*+S[]++wO`p,%:P.,&vgC,(^)X,*E@m,,,X-,-hoB,/P1W,17Hl,2s`,,4ZwA,6B9V,8)Pk,9eh+,;M*@,=4AU,>pXj,@Wp*,B?2?,D&IT,Eb`i,H'r1,Id4F,KKK[,M2bp,No%0,PVaQ7[Aa/f5)7xuYSaQ7[Aa794h7l?EtaQ7[Aa9['fzaQ7[Aa:L<8`x/vJaQ7[Aa9['ea/f5'aQ7[Aa794fa794faQ7[Aa/f5&a9['caQ7[A`x/vGa:L<5aQ7[Aza9['caQ7[A7l?Eqa794eaQ7[A7xuYOa/f5%aQ7[A8+HY:`x/vGaQ7[A8-jL7]8wuQaQ7[A8.[`^7l?EmaQ7[A8-jL67xuYLaQ7[A8+HY98+HY8aQ7[A7xuYM8-jL6aQ7[A7l?En8.[`]aQ7[Az85BheaOV5ba+:2Y81k?taOV5ba82J)8,AnSaOV5ba=[pI7tIW-aOV5baA3D9zaOV5baBETaa+:2XaOV5baA3D8a82J'aOV5ba=[pFa=[pEaOV5ba82J&aA3D6aOV5ba+:2UaBET^aOV5bzaA3D6aOV5b7tIW*a=[pDaOV5b8,AnOa82J%aOV5b81k?na+:2UaOV5b85Bh^]@q8xaOV5b86U$17tIW(aOV5b85Bh]8,AnMaOV5b81k?m81k?laOV5b8,AnN85Bh\aOV5b7tIW)86U$/aOV5bz8:_aQaMAiaa/f5)87d&JaMAiaa,;a/f5(aMAiaaFP=%a,8aMAiazaFPcW<8'x-gaJT2f8=h8A84LjgaJT2f8;)%18;)%1aJT2f84Lji8=h8@aJT2f8'x-i8>cW;aJT2fz8@J=naG>,6a794h8=>KTaG>,6aCTVt87d&IaG>,6aI/')8+HY,6aL:nBzaG>,6aMAiga794gaG>,6aL:nAaCTVqaG>,6aI/''aI/'&aG>,6aCTVoaL:n?aG>,6a794eaMAidaG>,6zaL:n?aG>,68+HY:aI/'%aG>,687d&CaCTVnaG>,68=>KNa794eaG>,68@J=g]KmN*aG>,68AQ988+HY7aG>,68@J=g87d&@aG>,68=>KM8=>KMaG>,687d&A8@J=faG>,68+HY88AQ96aG>,6z8BUCkaBETZa8YmK8?.MqaBETZaES@889bdbaBETZaJt)F8,iza-&.3aR7`ga::XDa-&.3aPqK=aG-,<8;MPfzaMAii8.[`bzaQ7[IzzaRT=ha:L<8zaQ7[HaG>,:zaMAifaMAiezaG>,9aQ7[Eza:L<5aRT=fzzaQ7[Ez8.[`_aMAidz8;MPbaG>,8z8AQ98a:L<5z8EG*m]Q*w-z8Fcb:8.[`\z8EG*l8;MP`z8AQ978AQ96z8;MPa8EG*kz8.[`]yzz8E+oj7v5R]a::XE8A:.B7v5R]aG-z7v5R]aR7`ga::XD7v5R]aPqK=aG-KT8;MP`aCTVt87d&I8;MP`aI/')8+HY<8;MP`aL:nBz8;MP`aMAiga794g8;MP`aL:nAaCTVq8;MP`aI/''aI/'&8;MP`aCTVoaL:n?8;MP`a794eaMAid8;MP`zaL:n?8;MP`8+HY:aI/'%8;MP`87d&CaCTVn8;MP`8=>KNa794e8;MP`8@J=g]KmN*8;MP`8AQ988+HY78;MP`8@J=g87d&@8;MP`8=>KM8=>KM8;MP`87d&A8@J=f8;MP`8+HY88AQ968;MP`z8=h8G8>cW;a3h^G8;)%78>cW;a@=FF84Ljp8>cW;aFnUa8'x-p8>cW;aIXhqz8>cW;aJT2la3h^F8>cW;aIXhpa@=FC8>cW;aFnU_aFnU^8>cW;a@=FBaIXhn8>cW;a3h^AaJT2i8>cW;zaIXhn8>cW;8'x-kaFnU^8>cW;84Ljja@=F@8>cW;8;)%2a3h^A8>cW;8=h8A]I*l/8>cW;8>cW<8'x-g8>cW;8=h8A84Ljg8>cW;8;)%18;)%18>cW;84Lji8=h8@8>cW;8'x-i8>cW;8>cW;z8:_aQ8AQ96a/f5)87d&J8AQ96a,;a/f5(8AQ96aFP=%a,88AQ96zaFP8EG*ka/f5)7xuYS8EG*ka794h7l?Et8EG*ka9['fz8EG*ka:L<8`x/vJ8EG*ka9['ea/f5'8EG*ka794fa794f8EG*ka/f5&a9['c8EG*k`x/vGa:L<58EG*kza9['c8EG*k7l?Eqa794e8EG*k7xuYOa/f5%8EG*k8+HY:`x/vG8EG*k8-jL7]8wuQ8EG*k8.[`^7l?Em8EG*k8-jL67xuYL8EG*k8+HY98+HY88EG*k7xuYM8-jL68EG*k7l?En8.[`]8EG*kz7uCHt8FG04`jc&P7rt'w8FG04`wC3.7kRWX8FG04a)dXM7^rJx8FG04a,4$Iz8FG04a-&.?`jc&N8FG04a,4$H`wC3,8FG04a)dXKa)dXJ8FG04`wC3*a,4$F8FG04`jc&Ka-&.=8FG04za,4$F8FG047^rJua)dXJ8FG047kRWS`wC3)8FG047rt's`jc&K8FG047uCHo]+QgX8FG047v5Re7^rJq8FG047uCHn7kRWQ8FG047rt'r7rt'r8FG047kRWR7uCHn8FG047^rJr7v5Rd8FG04zzaRT=dzzyz + nlist 382 1 b85VECTOR +8$sL?aR%6>`p]C(7vj/8aR%6>a($j&8,Oq4aQ$=Ea1Ba1j/2]ZEXpaQ$=Ea;iAh`p]BBaR%6?a0d'ta$guxaQ$=Da:rPna($inaR%6>a-Z`,a1B7dlgqa:rPoaQ$=C7mwEMa-Z_iaR%6?7q49%a8@LcaQ$=C8%Qa:a($iiaR%6@7vj/6a1B7dlgx8/,uEaQ$=A7mwE_8&$SXaR%6@5(Kln8/xfEaQ$=D4n,BY82U=faOAqMa8`53867kIaOAqLa+j;W8,oYWaOAqMa>En;7u$`;aOAqNaB(Fp]^u6:aOAqMaC>G8a+j;saOAqNaB(Fta8`55aOAqLa>En?a>En@aOAqMa8`51aB(FxaOAqMa+j;haC>G@aOAqK4Y^O1aB(G%aOAqK7u$`Fa>EnAaOAqK8,oY]a8`50aOAqL82U=ma+j;kaOAqJ867kP4J,])aOAqJ87Mkl7u$`FaOAqK867kM8,oY\aOAqK82U=k82U=jaOAqJ8,oYb867kOaOAqL7u$`@87MkgaOAqM4i*v)88;[taM-K^a%E_aJ@lva4+;Q84c;FaJ@luaG)&O8(:`VaJ@lsaIjv2]_U%E^]2IK3aJ@lr8>v_'8(:`caJ@lt8>%E]84c;QaJ@lq8;8K%8;8K$aJ@lq84c;K8>%E\aJ@lq8(:`W8>v_'aJ@lq5/=Vk8=HJ&aG,t^aCc,n8@V'DaG,t\a7@i]87rQ>aG,t]aI9%T8+P9HaG,t[aLFWk]hcZA7aG,tY8A]V-8+P9PaG,tY8@V'>87rQFaG,tY8=HJ'8=HJ)aG,tY87rQC8@V'@aG,tY8+P9K8A]V.aG,tY50&a>8?43^aB)a>aEWKc8B\)XaB)a?a8^5`89fp4aB)a@aK$d78,mZJaB)aDaNLZ)]Yd;iaB)aDaO]8ja8^6,aB)aDaNLZ'aEWKeaB)aCaK$d1aK$d5aB)aAaEWK_aNLZ(aB)aBa8^6$aO]8jaB)aG]SCosaNLZ'aB)aF8,mZOaK$d3aB)aD89fp8aEWKaaB)a@8?43_a8^6&aB)a>8B\)S4]4BYaB)a;8Cl]?8,mZTaB)a<8B\)S89fp6aB)a;8?43^8?43`aB)a<89fp78B\)TaB)a>8,mZP8Cl]AaB)a<52v)T8@LmMa:8ZwaFR128D3$9a:8Zwa9\x^8:aUXa:8[$aL=I&8-lHLa:8[&aOxT_]2EE>a:8[$aQ:iJa9]$-a:8ZxaOxT^aFR14a:8[%aL=HvaL=I&a:8[$aFR1/aOxT_a:8Zwa9]$&aQ:iJa:8[']Db/faOxT]a:8[&8-lHRaL=I$a:8Zp8:aU\aFR10a:8Zq8@LmPa9]$$a:8Zu8D3$44e9woa:8Zv8EJ8t8-lHUa:8Zx8D3$38:aU[a:8Zw8@LmN8@LmOa:8Zv8:aU[8D3$4a:8Zt8-lHP8EJ8wa:8Zq53XsU8A:e0a,fiLaG-dd8E,[,68EG*p\jrsaa:L;i8;MP]]I`mKaMAib8.[`S]I`mMaQ7[BzzaRT=da:L<;]I`mPaQ7[@aG>,:]H,4aQ7[A3_-C8a:L<2aRT=c\jrsa3leGaaQ7[?\xUx78.[`_aMAi_z8;MPbaG>,5]FmUA8AQ98a:L<.]LT0e8EG*kzz8Fcb88.[`^\jrsc8EG*k8;MPa\xUx<8AQ978AQ96\jrsc8;MP`8EG*kz8.[`_y3_-C453fkZ8A:e07uv8uaG-dd8E,[<7uv9&a:;,o8;=457uv9(aM+@]8.JQ\7uv9(aPr6cz7uv9$aR8OQa:;-?7uv9%aPr6`aG-dg7uv8waM+@WaM+@\7uv8taG-d`aPr6d7uv8ma:;-6aR8OR7uv8b4%`)+aPr6b7uv8a8.JQcaM+@Z7uv8j8;=49aG-db7uv8t8A:e0a:;-47uv8x8E,[74W=-`7uv9$8FGt&8.JQe7uv9$8E,[68;=487uv8v8A:e/8A:e07uv8w8;=488E,[97uv8t8.JQc8FGt&7uv8x53Dx68@LmM8.H*NaFR138D3$98.H*Na9\x^8:aUX8.H*OaL=I'8-lHL8.H*PaOxT_]2EE>8.H*OaQ:iJa9]$,8.H*NaOxT\aFR138.H*MaL=HvaL=I'8.H*MaFR1/aOxT_8.H*La9]$&aQ:iJ8.H*N]:)QhaOxT_8.H*L8-lHRaL=I$8.H*G8:aU\aFR108.H*F8@LmQa9]$$8.H*J8D3$44eYgJ8.H*K8EJ8t8-lHS8.H*M8D3$28:aU[8.H*M8@LmO8@LmO8.H*K8:aU[8D3$48.H*H8-lHP8EJ8w8.H*I52v;@8?43]8690laEWKc8B\)Y8690ka8^5`89fp48690laK$d68,mZL8690naNLZ*]Yd;i8690naO]8ja8^6+8690oaNLZ'aEWKe8690kaK$d1aK$d68690kaEWK_aNLZ*8690ma8^6&aO]8j8690m]OP%E^8>PPPPPPPPPPPPP%E^]2IK38>Pv_'8(:`c8>P%E]84c;N8>PP%E\8>Pv_(8>PEnF7u$`98CQ@vaB(Fs]`=mC8CQ@xaC>G6a+j;s8CQ@xaB(Foa8`548CQ@wa>En:a>En@8CQ@va8`5-aB(G$8CQ@wa+j;naC>G@8CQ@u4Y^O1aB(Fx8CQ@u7u$`Ua>En@8CQ@v8,oY]a8`518CQ@w82U=ia+j;l8CQ@t867kQ4I`qe8CQ@t87Mkp7u$`H8CQ@u867kP8,oY]8CQ@v82U=k82U=l8CQ@u8,oY`867kL8CQ@t7u$`F87Mkg8CQ@w4piDe8,Oq38E3ama1B=/8/,uC8E3ana$guO8%QaB8E3ala8@Lj7mwE<8E3aoa:rPi]ZEXp8E3aoa;iAaa$guw8E3aoa:rPfa1B0s7_[,H7uNfZ7_[,H8%v5I7_[,H8+HY87_[,H8.1k07_[,H80p((7_[,H83Y9u7_[,H86BKm7_[,H89+]d7_[,H8:Jf`7_[,H8;io\7_[,H8=3xX7_[,H8>S,T7_[,H8?r5P7_[,H8A<>L7_[,H8B[GH7_[,H8D%PD7_[,H8EDY@7_[,H8Fcb:7_[,Hz7m>0s7_[,H!7m>0s$$$$'7uNfZ7m>0s8%v5I7m>0s8+HY87m>0s8.1k07m>0s80p((7m>0s83Y9u7m>0s86BKm7m>0s89+]d7m>0s8:Jf`7m>0s8;io\7m>0s8=3xX7m>0s8>S,T7m>0s8?r5P7m>0s8A<>L7m>0s8B[GH7m>0s8D%PD7m>0s8EDY@7m>0s8Fcb:7m>0sz7uNfZ7_[,H7uNfZ7m>0s!7uNfZ$$$$'8%v5I7uNfZ8+HY87uNfZ8.1k07uNfZ80p((7uNfZ83Y9u7uNfZ86BKm7uNfZ89+]d7uNfZ8:Jf`7uNfZ8;io\7uNfZ8=3xX7uNfZ8>S,T7uNfZ8?r5P7uNfZ8A<>L7uNfZ8B[GH7uNfZ8D%PD7uNfZ8EDY@7uNfZ8Fcb:7uNfZz8%v5I7_[,H8%v5I7m>0s8%v5I7uNfZ!8%v5I$$$$'8+HY88%v5I8.1k08%v5I80p((8%v5I83Y9u8%v5I86BKm8%v5I89+]d8%v5I8:Jf`8%v5I8;io\8%v5I8=3xX8%v5I8>S,T8%v5I8?r5P8%v5I8A<>L8%v5I8B[GH8%v5I8D%PD8%v5I8EDY@8%v5I8Fcb:8%v5Iz8+HY87_[,H8+HY87m>0s8+HY87uNfZ8+HY88%v5I!8+HY8$$$$'8.1k08+HY880p((8+HY883Y9u8+HY886BKm8+HY889+]d8+HY88:Jf`8+HY88;io\8+HY88=3xX8+HY88>S,T8+HY88?r5P8+HY88A<>L8+HY88B[GH8+HY88D%PD8+HY88EDY@8+HY88Fcb:8+HY8z8.1k07_[,H8.1k07m>0s8.1k07uNfZ8.1k08%v5I8.1k08+HY8!8.1k0$$$$'80p((8.1k083Y9u8.1k086BKm8.1k089+]d8.1k08:Jf`8.1k08;io\8.1k08=3xX8.1k08>S,T8.1k08?r5P8.1k08A<>L8.1k08B[GH8.1k08D%PD8.1k08EDY@8.1k08Fcb:8.1k0z80p((7_[,H80p((7m>0s80p((7uNfZ80p((8%v5I80p((8+HY880p((8.1k0!80p(($$$$'83Y9u80p((86BKm80p((89+]d80p((8:Jf`80p((8;io\80p((8=3xX80p((8>S,T80p((8?r5P80p((8A<>L80p((8B[GH80p((8D%PD80p((8EDY@80p((8Fcb:80p((z83Y9u7_[,H83Y9u7m>0s83Y9u7uNfZ83Y9u8%v5I83Y9u8+HY883Y9u8.1k083Y9u80p((83Y9u83Y9u83Y9u86BKm83Y9u89+]d83Y9u8:Jf`83Y9u8;io\83Y9u8=3xX83Y9u8>S,T83Y9u8?r5P83Y9u8A<>L83Y9u8B[GH83Y9u8D%PD83Y9u8EDY@83Y9u8Fcb:83Y9uz86BKm7_[,H86BKm7m>0s86BKm7uNfZ86BKm8%v5I86BKm8+HY886BKm8.1k086BKm80p((86BKm83Y9u!86BKm$$$$'89+]d86BKm8:Jf`86BKm8;io\86BKm8=3xX86BKm8>S,T86BKm8?r5P86BKm8A<>L86BKm8B[GH86BKm8D%PD86BKm8EDY@86BKm8Fcb:86BKmz89+]d7_[,H89+]d7m>0s89+]d7uNfZ89+]d8%v5I89+]d8+HY889+]d8.1k089+]d80p((89+]d83Y9u89+]d86BKm!89+]d$$$$'8:Jf`89+]d8;io\89+]d8=3xX89+]d8>S,T89+]d8?r5P89+]d8A<>L89+]d8B[GH89+]d8D%PD89+]d8EDY@89+]d8Fcb:89+]dz8:Jf`7_[,H8:Jf`7m>0s8:Jf`7uNfZ8:Jf`8%v5I8:Jf`8+HY88:Jf`8.1k08:Jf`80p((8:Jf`83Y9u8:Jf`86BKm8:Jf`89+]d!8:Jf`$$$$'8;io\8:Jf`8=3xX8:Jf`8>S,T8:Jf`8?r5P8:Jf`8A<>L8:Jf`8B[GH8:Jf`8D%PD8:Jf`8EDY@8:Jf`8Fcb:8:Jf`z8;io\7_[,H8;io\7m>0s8;io\7uNfZ8;io\8%v5I8;io\8+HY88;io\8.1k08;io\80p((8;io\83Y9u8;io\86BKm8;io\89+]d8;io\8:Jf`!8;io\$$$$'8=3xX8;io\8>S,T8;io\8?r5P8;io\8A<>L8;io\8B[GH8;io\8D%PD8;io\8EDY@8;io\8Fcb:8;io\z8=3xX7_[,H8=3xX7m>0s8=3xX7uNfZ8=3xX8%v5I8=3xX8+HY88=3xX8.1k08=3xX80p((8=3xX83Y9u8=3xX86BKm8=3xX89+]d8=3xX8:Jf`8=3xX8;io\!8=3xX$$$$'8>S,T8=3xX8?r5P8=3xX8A<>L8=3xX8B[GH8=3xX8D%PD8=3xX8EDY@8=3xX8Fcb:8=3xXz8>S,T7_[,H8>S,T7m>0s8>S,T7uNfZ8>S,T8%v5I8>S,T8+HY88>S,T8.1k08>S,T80p((8>S,T83Y9u8>S,T86BKm8>S,T89+]d8>S,T8:Jf`8>S,T8;io\8>S,T8=3xX!8>S,T$$$$'8?r5P8>S,T8A<>L8>S,T8B[GH8>S,T8D%PD8>S,T8EDY@8>S,T8Fcb:8>S,Tz8?r5P7_[,H8?r5P7m>0s8?r5P7uNfZ8?r5P8%v5I8?r5P8+HY88?r5P8.1k08?r5P80p((8?r5P83Y9u8?r5P86BKm8?r5P89+]d8?r5P8:Jf`8?r5P8;io\8?r5P8=3xX8?r5P8>S,T!8?r5P$$$$'8A<>L8?r5P8B[GH8?r5P8D%PD8?r5P8EDY@8?r5P8Fcb:8?r5Pz8A<>L7_[,H8A<>L7m>0s8A<>L7uNfZ8A<>L8%v5I8A<>L8+HY88A<>L8.1k08A<>L80p((8A<>L83Y9u8A<>L86BKm8A<>L89+]d8A<>L8:Jf`8A<>L8;io\8A<>L8=3xX8A<>L8>S,T8A<>L8?r5P!8A<>L$$$$'8B[GH8A<>L8D%PD8A<>L8EDY@8A<>L8Fcb:8A<>Lz8B[GH7_[,H8B[GH7m>0s8B[GH7uNfZ8B[GH8%v5I8B[GH8+HY88B[GH8.1k08B[GH80p((8B[GH83Y9u8B[GH86BKm8B[GH89+]d8B[GH8:Jf`8B[GH8;io\8B[GH8=3xX8B[GH8>S,T8B[GH8?r5P8B[GH8A<>L!8B[GH$$$$'8D%PD8B[GH8EDY@8B[GH8Fcb:8B[GHz8D%PD7_[,H8D%PD7m>0s8D%PD7uNfZ8D%PD8%v5I8D%PD8+HY88D%PD8.1k08D%PD80p((8D%PD83Y9u8D%PD86BKm8D%PD89+]d8D%PD8:Jf`8D%PD8;io\8D%PD8=3xX8D%PD8>S,T8D%PD8?r5P8D%PD8A<>L8D%PD8B[GH!8D%PD$$$$'8EDY@8D%PD8Fcb:8D%PDz8EDY@7_[,H8EDY@7m>0s8EDY@7uNfZ8EDY@8%v5I8EDY@8+HY88EDY@8.1k08EDY@80p((8EDY@83Y9u8EDY@86BKm8EDY@89+]d8EDY@8:Jf`8EDY@8;io\8EDY@8=3xX8EDY@8>S,T8EDY@8?r5P8EDY@8A<>L8EDY@8B[GH8EDY@8D%PD!8EDY@$$$$'8Fcb:8EDY@7Qx'rz7gkb/z7reTbz7x7xRz8(_GAz8,gb4z8/Pt,z82:0xz84xBpz87aThz89eb6z8;/k2z8 Date: Fri, 16 Jun 2023 14:17:08 +0200 Subject: [PATCH 163/207] ImageIO: Minor fixes (#5147) * define variable 'resolved_path' in right scope * fixed missing 'input' variable * make checks for keys more explicit and safe proof * fixed caching of remapped colorspaces * trying to fix indentation issue * use safe keys pop --- openpype/hosts/nuke/api/lib.py | 8 +-- openpype/pipeline/colorspace.py | 107 ++++++++++++++++---------------- 2 files changed, 56 insertions(+), 59 deletions(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 777f4454dc..c05182ce97 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2020,11 +2020,11 @@ class WorkfileSettings(object): # TODO: backward compatibility for old projects - remove later # perhaps old project overrides is having it set to older version # with use of `customOCIOConfigPath` + resolved_path = None if workfile_settings.get("customOCIOConfigPath"): unresolved_path = workfile_settings["customOCIOConfigPath"] ocio_paths = unresolved_path[platform.system().lower()] - resolved_path = None for ocio_p in ocio_paths: resolved_path = str(ocio_p).format(**os.environ) if not os.path.exists(resolved_path): @@ -2054,9 +2054,9 @@ class WorkfileSettings(object): self._root_node["colorManagement"].setValue("OCIO") # we dont need the key anymore - workfile_settings.pop("customOCIOConfigPath") - workfile_settings.pop("colorManagement") - workfile_settings.pop("OCIO_config") + workfile_settings.pop("customOCIOConfigPath", None) + workfile_settings.pop("colorManagement", None) + workfile_settings.pop("OCIO_config", None) # then set the rest for knob, value_ in workfile_settings.items(): diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 899b14148b..1999ad3bed 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -312,7 +312,8 @@ def get_views_data_subprocess(config_path): def get_imageio_config( - project_name, host_name, + project_name, + host_name, project_settings=None, anatomy_data=None, anatomy=None @@ -325,12 +326,9 @@ def get_imageio_config( Args: project_name (str): project name host_name (str): host name - project_settings (dict, optional): project settings. - Defaults to None. - anatomy_data (dict, optional): anatomy formatting data. - Defaults to None. - anatomy (lib.Anatomy, optional): Anatomy object. - Defaults to None. + project_settings (Optional[dict]): Project settings. + anatomy_data (Optional[dict]): anatomy formatting data. + anatomy (Optional[Anatomy]): Anatomy object. Returns: dict: config path data or empty dict @@ -345,37 +343,36 @@ def get_imageio_config( formatting_data = deepcopy(anatomy_data) - # add project roots to anatomy data + # Add project roots to anatomy data formatting_data["root"] = anatomy.roots formatting_data["platform"] = platform.system().lower() - # get colorspace settings - # check if global settings group is having activate_global_color_management - # key at all. If it does't then default it to False - # this is for backward compatibility only - # TODO: in future rewrite this to be more explicit + # Get colorspace settings imageio_global, imageio_host = _get_imageio_settings( project_settings, host_name) - activate_color_management = ( - imageio_global.get("activate_global_color_management", False) - # for already saved overrides from previous version - # TODO: remove this in future - backward compatibility - or imageio_host.get("ocio_config").get("enabled") - ) + # Host 'ocio_config' is optional + host_ocio_config = imageio_host.get("ocio_config") or {} + + # Global color management must be enabled to be able to use host settings + activate_color_management = imageio_global.get( + "activate_global_color_management") + # TODO: remove this in future - backward compatibility + # For already saved overrides from previous version look for 'enabled' + # on host settings. + if activate_color_management is None: + activate_color_management = host_ocio_config.get("enabled", False) if not activate_color_management: # if global settings are disabled return empty dict because # it is expected that no colorspace management is needed - log.info( - "Colorspace management is disabled globally." - ) + log.info("Colorspace management is disabled globally.") return {} - # check if host settings group is having activate_host_color_management - # if it does not have activation key then default it to True so it uses - # global settings - # this is for backward compatibility + # Check if host settings group is having 'activate_host_color_management' + # - if it does not have activation key then default it to True so it uses + # global settings + # This is for backward compatibility. # TODO: in future rewrite this to be more explicit activate_host_color_management = imageio_host.get( "activate_host_color_management", True) @@ -389,21 +386,18 @@ def get_imageio_config( ) return {} - config_host = imageio_host.get("ocio_config", {}) - - # get config path from either global or host_name + # get config path from either global or host settings # depending on override flag # TODO: in future rewrite this to be more explicit - config_data = None - override_global_config = ( - config_host.get("override_global_config") + override_global_config = host_ocio_config.get("override_global_config") + if override_global_config is None: # for already saved overrides from previous version # TODO: remove this in future - backward compatibility - or config_host.get("enabled") - ) + override_global_config = host_ocio_config.get("enabled") + if override_global_config: config_data = _get_config_data( - config_host["filepath"], formatting_data + host_ocio_config["filepath"], formatting_data ) else: # get config path from global @@ -507,34 +501,35 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): frules_host = imageio_host.get("file_rules", {}) # compile file rules dictionary - activate_host_rules = ( - frules_host.get("activate_host_rules") + activate_host_rules = frules_host.get("activate_host_rules") + if activate_host_rules is None: # TODO: remove this in future - backward compatibility - or frules_host.get("enabled") - ) + activate_host_rules = frules_host.get("enabled", False) # return host rules if activated or global rules return frules_host["rules"] if activate_host_rules else global_rules def get_remapped_colorspace_to_native( - ocio_colorspace_name, host_name, imageio_host_settings): + ocio_colorspace_name, host_name, imageio_host_settings +): """Return native colorspace name. Args: ocio_colorspace_name (str | None): ocio colorspace name + host_name (str): Host name. + imageio_host_settings (dict[str, Any]): ImageIO host settings. Returns: - str: native colorspace name defined in remapping or None + Union[str, None]: native colorspace name defined in remapping or None """ - if not CashedData.remapping.get(host_name, {}).get("to_native"): + CashedData.remapping.setdefault(host_name, {}) + if CashedData.remapping[host_name].get("to_native") is None: remapping_rules = imageio_host_settings["remapping"]["rules"] - CashedData.remapping[host_name] = { - "to_native": { - rule["ocio_name"]: input["host_native_name"] - for rule in remapping_rules - } + CashedData.remapping[host_name]["to_native"] = { + rule["ocio_name"]: rule["host_native_name"] + for rule in remapping_rules } return CashedData.remapping[host_name]["to_native"].get( @@ -542,23 +537,25 @@ def get_remapped_colorspace_to_native( def get_remapped_colorspace_from_native( - host_native_colorspace_name, host_name, imageio_host_settings): + host_native_colorspace_name, host_name, imageio_host_settings +): """Return ocio colorspace name remapped from host native used name. Args: host_native_colorspace_name (str): host native colorspace name + host_name (str): Host name. + imageio_host_settings (dict[str, Any]): ImageIO host settings. Returns: - str: ocio colorspace name defined in remapping or None + Union[str, None]: Ocio colorspace name defined in remapping or None. """ - if not CashedData.remapping.get(host_name, {}).get("from_native"): + CashedData.remapping.setdefault(host_name, {}) + if CashedData.remapping[host_name].get("from_native") is None: remapping_rules = imageio_host_settings["remapping"]["rules"] - CashedData.remapping[host_name] = { - "from_native": { - input["host_native_name"]: rule["ocio_name"] - for rule in remapping_rules - } + CashedData.remapping[host_name]["from_native"] = { + rule["host_native_name"]: rule["ocio_name"] + for rule in remapping_rules } return CashedData.remapping[host_name]["from_native"].get( From c388ee94636e7eac952d7cff5c067fc03173ecb4 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 16 Jun 2023 22:08:21 +0800 Subject: [PATCH 164/207] add collector to tray publisher for getting frame range data --- .../publish/collect_anatomy_frame_range.py | 33 +++++++++++++++++++ .../project_settings/traypublisher.json | 4 +++ .../schema_project_traypublisher.json | 4 +++ 3 files changed, 41 insertions(+) create mode 100644 openpype/plugins/publish/collect_anatomy_frame_range.py diff --git a/openpype/plugins/publish/collect_anatomy_frame_range.py b/openpype/plugins/publish/collect_anatomy_frame_range.py new file mode 100644 index 0000000000..71a5dcfeb0 --- /dev/null +++ b/openpype/plugins/publish/collect_anatomy_frame_range.py @@ -0,0 +1,33 @@ +import pyblish.api + + +class CollectAnatomyFrameRange(pyblish.api.InstancePlugin): + """Collect Frame Range specific Anatomy data. + + Plugin is running for all instances on context even not active instances. + """ + + order = pyblish.api.CollectorOrder + 0.491 + label = "Collect Anatomy Frame Range" + hosts = ["traypublisher"] + + def process(self, instance): + self.log.info("Collecting Anatomy frame range.") + asset_doc = instance.data.get("assetEntity") + if not asset_doc: + self.log.info("Missing required data..") + return + + asset_data = asset_doc["data"] + for key in ( + "fps", + "frameStart", + "frameEnd", + "handleStart", + "handleEnd" + ): + if key not in instance.data and key in asset_data: + value = asset_data[key] + instance.data[key] = value + + self.log.info("Anatomy frame range collection finished.") diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 3a42c93515..6b8bdcfcc5 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -318,6 +318,10 @@ } }, "publish": { + "CollectAnatomyFrameRange": { + "enabled": true, + "active": true + }, "ValidateFrameRange": { "enabled": true, "optional": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 3703d82856..44442a07d4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -343,6 +343,10 @@ "type": "schema_template", "name": "template_validate_plugin", "template_data": [ + { + "key": "CollectAnatomyFrameRange", + "label": "Collect Anatomy frame range" + }, { "key": "ValidateFrameRange", "label": "Validate frame range" From ec8c70db272ae51bb7118d6c7f359dff953efc6d Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 16 Jun 2023 22:14:06 +0800 Subject: [PATCH 165/207] delete unrelated code --- .../publish/collect_anatomy_frame_range.py | 33 +++++++++++++++++++ .../project_settings/traypublisher.json | 4 +++ .../schema_project_traypublisher.json | 4 +++ 3 files changed, 41 insertions(+) create mode 100644 openpype/plugins/publish/collect_anatomy_frame_range.py diff --git a/openpype/plugins/publish/collect_anatomy_frame_range.py b/openpype/plugins/publish/collect_anatomy_frame_range.py new file mode 100644 index 0000000000..71a5dcfeb0 --- /dev/null +++ b/openpype/plugins/publish/collect_anatomy_frame_range.py @@ -0,0 +1,33 @@ +import pyblish.api + + +class CollectAnatomyFrameRange(pyblish.api.InstancePlugin): + """Collect Frame Range specific Anatomy data. + + Plugin is running for all instances on context even not active instances. + """ + + order = pyblish.api.CollectorOrder + 0.491 + label = "Collect Anatomy Frame Range" + hosts = ["traypublisher"] + + def process(self, instance): + self.log.info("Collecting Anatomy frame range.") + asset_doc = instance.data.get("assetEntity") + if not asset_doc: + self.log.info("Missing required data..") + return + + asset_data = asset_doc["data"] + for key in ( + "fps", + "frameStart", + "frameEnd", + "handleStart", + "handleEnd" + ): + if key not in instance.data and key in asset_data: + value = asset_data[key] + instance.data[key] = value + + self.log.info("Anatomy frame range collection finished.") diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 3a42c93515..6b8bdcfcc5 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -318,6 +318,10 @@ } }, "publish": { + "CollectAnatomyFrameRange": { + "enabled": true, + "active": true + }, "ValidateFrameRange": { "enabled": true, "optional": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 3703d82856..44442a07d4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -343,6 +343,10 @@ "type": "schema_template", "name": "template_validate_plugin", "template_data": [ + { + "key": "CollectAnatomyFrameRange", + "label": "Collect Anatomy frame range" + }, { "key": "ValidateFrameRange", "label": "Validate frame range" From 00eab724a4dec7df938013349cdd5ecaa9fc5645 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 16 Jun 2023 22:15:58 +0800 Subject: [PATCH 166/207] delete unrelated code --- .../publish/collect_anatomy_frame_range.py | 33 ------------------- .../project_settings/traypublisher.json | 4 --- .../schema_project_traypublisher.json | 4 --- 3 files changed, 41 deletions(-) delete mode 100644 openpype/plugins/publish/collect_anatomy_frame_range.py diff --git a/openpype/plugins/publish/collect_anatomy_frame_range.py b/openpype/plugins/publish/collect_anatomy_frame_range.py deleted file mode 100644 index 71a5dcfeb0..0000000000 --- a/openpype/plugins/publish/collect_anatomy_frame_range.py +++ /dev/null @@ -1,33 +0,0 @@ -import pyblish.api - - -class CollectAnatomyFrameRange(pyblish.api.InstancePlugin): - """Collect Frame Range specific Anatomy data. - - Plugin is running for all instances on context even not active instances. - """ - - order = pyblish.api.CollectorOrder + 0.491 - label = "Collect Anatomy Frame Range" - hosts = ["traypublisher"] - - def process(self, instance): - self.log.info("Collecting Anatomy frame range.") - asset_doc = instance.data.get("assetEntity") - if not asset_doc: - self.log.info("Missing required data..") - return - - asset_data = asset_doc["data"] - for key in ( - "fps", - "frameStart", - "frameEnd", - "handleStart", - "handleEnd" - ): - if key not in instance.data and key in asset_data: - value = asset_data[key] - instance.data[key] = value - - self.log.info("Anatomy frame range collection finished.") diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 6b8bdcfcc5..3a42c93515 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -318,10 +318,6 @@ } }, "publish": { - "CollectAnatomyFrameRange": { - "enabled": true, - "active": true - }, "ValidateFrameRange": { "enabled": true, "optional": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 44442a07d4..3703d82856 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -343,10 +343,6 @@ "type": "schema_template", "name": "template_validate_plugin", "template_data": [ - { - "key": "CollectAnatomyFrameRange", - "label": "Collect Anatomy frame range" - }, { "key": "ValidateFrameRange", "label": "Validate frame range" From 3d41ee6591f554b1b2ad25a208ad1ae8525868a2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 16 Jun 2023 16:26:04 +0200 Subject: [PATCH 167/207] TrayPublisher & StandalonePublisher: Specify version (#5142) * modified simple creator plugin to be able handle version control * added 'allow_version_control' to simple creators * don't remove 'create_context' from pyblish context during publishing * implemented validator for existing version override * actually fill version on collected instances * version can be again changed from standalone publisher * added comment to collector * make sure the version is set always to int * removed unused import * disable validator if is disabled * fix filtered instances loop --- .../plugins/publish/collect_context.py | 9 +- openpype/hosts/traypublisher/api/plugin.py | 182 +++++++++++++++++- .../publish/collect_simple_instances.py | 24 +++ .../help/validate_existing_version.xml | 16 ++ .../publish/validate_existing_version.py | 57 ++++++ openpype/pipeline/create/context.py | 13 ++ .../publish/collect_from_create_context.py | 2 +- .../project_settings/traypublisher.json | 16 ++ .../schema_project_traypublisher.json | 10 + .../widgets/widget_family.py | 3 +- 10 files changed, 323 insertions(+), 9 deletions(-) create mode 100644 openpype/hosts/traypublisher/plugins/publish/help/validate_existing_version.xml create mode 100644 openpype/hosts/traypublisher/plugins/publish/validate_existing_version.py diff --git a/openpype/hosts/standalonepublisher/plugins/publish/collect_context.py b/openpype/hosts/standalonepublisher/plugins/publish/collect_context.py index 96aaae23dc..8fa53f5f48 100644 --- a/openpype/hosts/standalonepublisher/plugins/publish/collect_context.py +++ b/openpype/hosts/standalonepublisher/plugins/publish/collect_context.py @@ -222,7 +222,6 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin): "label": subset, "name": subset, "family": in_data["family"], - # "version": in_data.get("version", 1), "frameStart": in_data.get("representations", [None])[0].get( "frameStart", None ), @@ -232,6 +231,14 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin): "families": instance_families } ) + # Fill version only if 'use_next_available_version' is disabled + # and version is filled in instance data + version = in_data.get("version") + use_next_available_version = in_data.get( + "use_next_available_version", True) + if not use_next_available_version and version is not None: + instance.data["version"] = version + self.log.info("collected instance: {}".format(pformat(instance.data))) self.log.info("parsing data: {}".format(pformat(in_data))) diff --git a/openpype/hosts/traypublisher/api/plugin.py b/openpype/hosts/traypublisher/api/plugin.py index 75930f0f31..36e041a32c 100644 --- a/openpype/hosts/traypublisher/api/plugin.py +++ b/openpype/hosts/traypublisher/api/plugin.py @@ -1,4 +1,14 @@ -from openpype.lib.attribute_definitions import FileDef +from openpype.client import ( + get_assets, + get_subsets, + get_last_versions, +) +from openpype.lib.attribute_definitions import ( + FileDef, + BoolDef, + NumberDef, + UISeparatorDef, +) from openpype.lib.transcoding import IMAGE_EXTENSIONS, VIDEO_EXTENSIONS from openpype.pipeline.create import ( Creator, @@ -94,6 +104,7 @@ class TrayPublishCreator(Creator): class SettingsCreator(TrayPublishCreator): create_allow_context_change = True create_allow_thumbnail = True + allow_version_control = False extensions = [] @@ -101,8 +112,18 @@ class SettingsCreator(TrayPublishCreator): # Pass precreate data to creator attributes thumbnail_path = pre_create_data.pop(PRE_CREATE_THUMBNAIL_KEY, None) + # Fill 'version_to_use' if version control is enabled + if self.allow_version_control: + asset_name = data["asset"] + subset_docs_by_asset_id = self._prepare_next_versions( + [asset_name], [subset_name]) + version = subset_docs_by_asset_id[asset_name].get(subset_name) + pre_create_data["version_to_use"] = version + data["_previous_last_version"] = version + data["creator_attributes"] = pre_create_data data["settings_creator"] = True + # Create new instance new_instance = CreatedInstance(self.family, subset_name, data, self) @@ -111,7 +132,158 @@ class SettingsCreator(TrayPublishCreator): if thumbnail_path: self.set_instance_thumbnail_path(new_instance.id, thumbnail_path) + def _prepare_next_versions(self, asset_names, subset_names): + """Prepare next versions for given asset and subset names. + + Todos: + Expect combination of subset names by asset name to avoid + unnecessary server calls for unused subsets. + + Args: + asset_names (Iterable[str]): Asset names. + subset_names (Iterable[str]): Subset names. + + Returns: + dict[str, dict[str, int]]: Last versions by asset + and subset names. + """ + + # Prepare all versions for all combinations to '1' + subset_docs_by_asset_id = { + asset_name: { + subset_name: 1 + for subset_name in subset_names + } + for asset_name in asset_names + } + if not asset_names or not subset_names: + return subset_docs_by_asset_id + + asset_docs = get_assets( + self.project_name, + asset_names=asset_names, + fields=["_id", "name"] + ) + asset_names_by_id = { + asset_doc["_id"]: asset_doc["name"] + for asset_doc in asset_docs + } + subset_docs = list(get_subsets( + self.project_name, + asset_ids=asset_names_by_id.keys(), + subset_names=subset_names, + fields=["_id", "name", "parent"] + )) + + subset_ids = {subset_doc["_id"] for subset_doc in subset_docs} + last_versions = get_last_versions( + self.project_name, + subset_ids, + fields=["name", "parent"]) + + for subset_doc in subset_docs: + asset_id = subset_doc["parent"] + asset_name = asset_names_by_id[asset_id] + subset_name = subset_doc["name"] + subset_id = subset_doc["_id"] + last_version = last_versions.get(subset_id) + version = 0 + if last_version is not None: + version = last_version["name"] + subset_docs_by_asset_id[asset_name][subset_name] += version + return subset_docs_by_asset_id + + def _fill_next_versions(self, instances_data): + """Fill next version for instances. + + Instances have also stored previous next version to be able to + recognize if user did enter different version. If version was + not changed by user, or user set it to '0' the next version will be + updated by current database state. + """ + + filtered_instance_data = [] + for instance in instances_data: + previous_last_version = instance.get("_previous_last_version") + creator_attributes = instance["creator_attributes"] + use_next_version = creator_attributes.get( + "use_next_version", True) + version = creator_attributes.get("version_to_use", 0) + if ( + use_next_version + or version == 0 + or version == previous_last_version + ): + filtered_instance_data.append(instance) + + asset_names = { + instance["asset"] + for instance in filtered_instance_data} + subset_names = { + instance["subset"] + for instance in filtered_instance_data} + subset_docs_by_asset_id = self._prepare_next_versions( + asset_names, subset_names + ) + for instance in filtered_instance_data: + asset_name = instance["asset"] + subset_name = instance["subset"] + version = subset_docs_by_asset_id[asset_name][subset_name] + instance["creator_attributes"]["version_to_use"] = version + instance["_previous_last_version"] = version + + def collect_instances(self): + """Collect instances from host. + + Overriden to be able to manage version control attributes. If version + control is disabled, the attributes will be removed from instances, + and next versions are filled if is version control enabled. + """ + + instances_by_identifier = cache_and_get_instances( + self, SHARED_DATA_KEY, list_instances + ) + instances = instances_by_identifier[self.identifier] + if not instances: + return + + if self.allow_version_control: + self._fill_next_versions(instances) + + for instance_data in instances: + # Make sure that there are not data related to version control + # if plugin does not support it + if not self.allow_version_control: + instance_data.pop("_previous_last_version", None) + creator_attributes = instance_data["creator_attributes"] + creator_attributes.pop("version_to_use", None) + creator_attributes.pop("use_next_version", None) + + instance = CreatedInstance.from_existing(instance_data, self) + self._add_instance_to_context(instance) + def get_instance_attr_defs(self): + defs = self.get_pre_create_attr_defs() + if self.allow_version_control: + defs += [ + UISeparatorDef(), + BoolDef( + "use_next_version", + default=True, + label="Use next version", + ), + NumberDef( + "version_to_use", + default=1, + minimum=0, + maximum=999, + label="Version to use", + ) + ] + return defs + + def get_pre_create_attr_defs(self): + # Use same attributes as for instance attributes return [ FileDef( "representation_files", @@ -132,10 +304,6 @@ class SettingsCreator(TrayPublishCreator): ) ] - def get_pre_create_attr_defs(self): - # Use same attributes as for instance attrobites - return self.get_instance_attr_defs() - @classmethod def from_settings(cls, item_data): identifier = item_data["identifier"] @@ -155,6 +323,8 @@ class SettingsCreator(TrayPublishCreator): "extensions": item_data["extensions"], "allow_sequences": item_data["allow_sequences"], "allow_multiple_items": item_data["allow_multiple_items"], - "default_variants": item_data["default_variants"] + "allow_version_control": item_data.get( + "allow_version_control", False), + "default_variants": item_data["default_variants"], } ) diff --git a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py index c081216481..3fa3c3b8c8 100644 --- a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py +++ b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py @@ -47,6 +47,8 @@ class CollectSettingsSimpleInstances(pyblish.api.InstancePlugin): "Created temp staging directory for instance {}. {}" ).format(instance_label, tmp_folder)) + self._fill_version(instance, instance_label) + # Store filepaths for validation of their existence source_filepaths = [] # Make sure there are no representations with same name @@ -93,6 +95,28 @@ class CollectSettingsSimpleInstances(pyblish.api.InstancePlugin): ) ) + def _fill_version(self, instance, instance_label): + """Fill instance version under which will be instance integrated. + + Instance must have set 'use_next_version' to 'False' + and 'version_to_use' to version to use. + + Args: + instance (pyblish.api.Instance): Instance to fill version for. + instance_label (str): Label of instance to fill version for. + """ + + creator_attributes = instance.data["creator_attributes"] + use_next_version = creator_attributes.get("use_next_version", True) + # If 'version_to_use' is '0' it means that next version should be used + version_to_use = creator_attributes.get("version_to_use", 0) + if use_next_version or not version_to_use: + return + instance.data["version"] = version_to_use + self.log.debug( + "Version for instance \"{}\" was set to \"{}\"".format( + instance_label, version_to_use)) + def _create_main_representations( self, instance, diff --git a/openpype/hosts/traypublisher/plugins/publish/help/validate_existing_version.xml b/openpype/hosts/traypublisher/plugins/publish/help/validate_existing_version.xml new file mode 100644 index 0000000000..8a3b8f4d7d --- /dev/null +++ b/openpype/hosts/traypublisher/plugins/publish/help/validate_existing_version.xml @@ -0,0 +1,16 @@ + + + +Version already exists + +## Version already exists + +Version {version} you have set on instance '{subset_name}' under '{asset_name}' already exists. This validation is enabled by default to prevent accidental override of existing versions. + +### How to repair? +- Click on 'Repair' action -> this will change version to next available. +- Disable validation on the instance if you are sure you want to override the version. +- Reset publishing and manually change the version number. + + + diff --git a/openpype/hosts/traypublisher/plugins/publish/validate_existing_version.py b/openpype/hosts/traypublisher/plugins/publish/validate_existing_version.py new file mode 100644 index 0000000000..1fb27acdeb --- /dev/null +++ b/openpype/hosts/traypublisher/plugins/publish/validate_existing_version.py @@ -0,0 +1,57 @@ +import pyblish.api + +from openpype.pipeline.publish import ( + ValidateContentsOrder, + PublishXmlValidationError, + OptionalPyblishPluginMixin, + RepairAction, +) + + +class ValidateExistingVersion( + OptionalPyblishPluginMixin, + pyblish.api.InstancePlugin +): + label = "Validate Existing Version" + order = ValidateContentsOrder + + hosts = ["traypublisher"] + + actions = [RepairAction] + + settings_category = "traypublisher" + optional = True + + def process(self, instance): + if not self.is_active(instance.data): + return + + version = instance.data.get("version") + if version is None: + return + + last_version = instance.data.get("latestVersion") + if last_version is None or last_version < version: + return + + subset_name = instance.data["subset"] + msg = "Version {} already exists for subset {}.".format( + version, subset_name) + + formatting_data = { + "subset_name": subset_name, + "asset_name": instance.data["asset"], + "version": version + } + raise PublishXmlValidationError( + self, msg, formatting_data=formatting_data) + + @classmethod + def repair(cls, instance): + create_context = instance.context.data["create_context"] + created_instance = create_context.get_instance_by_id( + instance.data["instance_id"]) + creator_attributes = created_instance["creator_attributes"] + # Disable version override + creator_attributes["use_next_version"] = True + create_context.save_changes() diff --git a/openpype/pipeline/create/context.py b/openpype/pipeline/create/context.py index 2fc0669732..332e271b0d 100644 --- a/openpype/pipeline/create/context.py +++ b/openpype/pipeline/create/context.py @@ -1441,6 +1441,19 @@ class CreateContext: """Access to global publish attributes.""" return self._publish_attributes + def get_instance_by_id(self, instance_id): + """Receive instance by id. + + Args: + instance_id (str): Instance id. + + Returns: + Union[CreatedInstance, None]: Instance or None if instance with + given id is not available. + """ + + return self._instances_by_id.get(instance_id) + def get_sorted_creators(self, identifiers=None): """Sorted creators by 'order' attribute. diff --git a/openpype/plugins/publish/collect_from_create_context.py b/openpype/plugins/publish/collect_from_create_context.py index 4888476fff..8806a13ca0 100644 --- a/openpype/plugins/publish/collect_from_create_context.py +++ b/openpype/plugins/publish/collect_from_create_context.py @@ -16,7 +16,7 @@ class CollectFromCreateContext(pyblish.api.ContextPlugin): order = pyblish.api.CollectorOrder - 0.5 def process(self, context): - create_context = context.data.pop("create_context", None) + create_context = context.data.get("create_context") if not create_context: host = registered_host() if isinstance(host, IPublishHost): diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 3a42c93515..4c2c2f1391 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -23,6 +23,7 @@ "detailed_description": "Workfiles are full scenes from any application that are directly edited by artists. They represent a state of work on a task at a given point and are usually not directly referenced into other scenes.", "allow_sequences": false, "allow_multiple_items": false, + "allow_version_control": false, "extensions": [ ".ma", ".mb", @@ -57,6 +58,7 @@ "detailed_description": "Models should only contain geometry data, without any extras like cameras, locators or bones.\n\nKeep in mind that models published from tray publisher are not validated for correctness. ", "allow_sequences": false, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".ma", ".mb", @@ -82,6 +84,7 @@ "detailed_description": "Alembic or bgeo cache of animated data", "allow_sequences": true, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".abc", ".bgeo", @@ -105,6 +108,7 @@ "detailed_description": "Any type of image seqeuence coming from outside of the studio. Usually camera footage, but could also be animatics used for reference.", "allow_sequences": true, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".exr", ".png", @@ -127,6 +131,7 @@ "detailed_description": "Sequence or single file renders", "allow_sequences": true, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".exr", ".png", @@ -150,6 +155,7 @@ "detailed_description": "Ideally this should be only camera itself with baked animation, however, it can technically also include helper geometry.", "allow_sequences": false, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".abc", ".ma", @@ -174,6 +180,7 @@ "detailed_description": "Any image data can be published as image family. References, textures, concept art, matte paints. This is a fallback 2d family for everything that doesn't fit more specific family.", "allow_sequences": false, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".exr", ".jpg", @@ -197,6 +204,7 @@ "detailed_description": "Hierarchical data structure for the efficient storage and manipulation of sparse volumetric data discretized on three-dimensional grids", "allow_sequences": true, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [ ".vdb" ] @@ -215,6 +223,7 @@ "detailed_description": "Script exported from matchmoving application to be later processed into a tracked camera with additional data", "allow_sequences": false, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [] }, { @@ -227,6 +236,7 @@ "detailed_description": "CG rigged character or prop. Rig should be clean of any extra data and directly loadable into it's respective application\t", "allow_sequences": false, "allow_multiple_items": false, + "allow_version_control": false, "extensions": [ ".ma", ".blend", @@ -244,6 +254,7 @@ "detailed_description": "Texture files with Unreal Engine naming conventions", "allow_sequences": false, "allow_multiple_items": true, + "allow_version_control": false, "extensions": [] } ], @@ -322,6 +333,11 @@ "enabled": true, "optional": true, "active": true + }, + "ValidateExistingVersion": { + "enabled": true, + "optional": true, + "active": true } } } diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json index 3703d82856..e75e2887db 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_traypublisher.json @@ -85,6 +85,12 @@ "label": "Allow multiple items", "type": "boolean" }, + { + "type": "boolean", + "key": "allow_version_control", + "label": "Allow version control", + "default": false + }, { "type": "list", "key": "extensions", @@ -346,6 +352,10 @@ { "key": "ValidateFrameRange", "label": "Validate frame range" + }, + { + "key": "ValidateExistingVersion", + "label": "Validate Existing Version" } ] } diff --git a/openpype/tools/standalonepublish/widgets/widget_family.py b/openpype/tools/standalonepublish/widgets/widget_family.py index 11c5ec33b7..8c18a93a00 100644 --- a/openpype/tools/standalonepublish/widgets/widget_family.py +++ b/openpype/tools/standalonepublish/widgets/widget_family.py @@ -128,7 +128,8 @@ class FamilyWidget(QtWidgets.QWidget): 'family_preset_key': key, 'family': family, 'subset': self.input_result.text(), - 'version': self.version_spinbox.value() + 'version': self.version_spinbox.value(), + 'use_next_available_version': self.version_checkbox.isChecked(), } return data From 7b19762d5dda46513b38724e8e19cad1c5f70ca0 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Sat, 17 Jun 2023 03:25:31 +0000 Subject: [PATCH 168/207] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index c44b1d29fb..9c5a60964b 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.15.11-nightly.2" +__version__ = "3.15.11-nightly.3" From e3e09e7df9e0c066e5cc77fa4be9631bd910109f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Jun 2023 03:26:12 +0000 Subject: [PATCH 169/207] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2339ec878f..2fd2780e55 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.15.11-nightly.3 - 3.15.11-nightly.2 - 3.15.11-nightly.1 - 3.15.10 @@ -134,7 +135,6 @@ body: - 3.14.3-nightly.7 - 3.14.3-nightly.6 - 3.14.3-nightly.5 - - 3.14.3-nightly.4 validations: required: true - type: dropdown From a2525bf9bb3040d3efc5bb222aab6cc2d9794547 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 19 Jun 2023 15:40:44 +0800 Subject: [PATCH 170/207] use getLastMergedNodes() in max_scene loader --- openpype/hosts/max/plugins/load/load_max_scene.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/max/plugins/load/load_max_scene.py b/openpype/hosts/max/plugins/load/load_max_scene.py index 4d9367b16f..e3fb34f5bc 100644 --- a/openpype/hosts/max/plugins/load/load_max_scene.py +++ b/openpype/hosts/max/plugins/load/load_max_scene.py @@ -22,12 +22,8 @@ class MaxSceneLoader(load.LoaderPlugin): path = os.path.normpath(self.fname) # import the max scene by using "merge file" path = path.replace('\\', '/') - - merge_before = set(rt.RootNode.Children) rt.MergeMaxFile(path) - - merge_after = set(rt.RootNode.Children) - max_objects = merge_after.difference(merge_before) + max_objects = rt.getLastMergedNodes() max_container = rt.Container(name=f"{name}") for max_object in max_objects: max_object.Parent = max_container @@ -40,15 +36,14 @@ class MaxSceneLoader(load.LoaderPlugin): path = get_representation_path(representation) node_name = container["instance_node"] - instance_name, _ = node_name.split("_") - merge_before = set(rt.RootNode.Children) + rt.MergeMaxFile(path, rt.Name("noRedraw"), rt.Name("deleteOldDups"), rt.Name("useSceneMtlDups")) - merge_after = set(rt.EootNode.Children) - max_objects = merge_after.difference(merge_before) - container_node = rt.GetNodeByName(instance_name) + + max_objects = rt.getLastMergedNodes() + container_node = rt.GetNodeByName(node_name) for max_object in max_objects: max_object.Parent = container_node From 3631cc5f4048edc710f51122d6c91a79e33231db Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 19 Jun 2023 11:18:55 +0200 Subject: [PATCH 171/207] fix single root packing (#5154) --- openpype/lib/project_backpack.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/lib/project_backpack.py b/openpype/lib/project_backpack.py index 55a96664d8..91a5b76e35 100644 --- a/openpype/lib/project_backpack.py +++ b/openpype/lib/project_backpack.py @@ -125,6 +125,7 @@ def pack_project( if not only_documents: roots = project_doc["config"]["roots"] # Determine root directory of project + source_root = None source_root_name = None for root_name, root_value in roots.items(): if source_root is not None: From a4c63c12cf0bfb61a4e6005304d40609290132ca Mon Sep 17 00:00:00 2001 From: Alexey Bogomolov <11698866+movalex@users.noreply.github.com> Date: Mon, 19 Jun 2023 14:15:34 +0300 Subject: [PATCH 172/207] Add height, width and fps setup to project manager (#5075) * add width, height and fps setup * add corresponding ui tweaks * update docstring * remove unnecessary fallbacks * remove print * hound * remove whitespace * revert operations change * wip commit project update with new data * formatting * update the project data correctly * Update openpype/tools/project_manager/project_manager/widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * show default settings, use spinbox to validate values add pixel aspec, frame start, frame end * formatting * get default anatomy settings properly * check if singlestep is set Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * not used Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * mindless code copying is evil, removed unnecesary parts Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * Update openpype/tools/project_manager/project_manager/widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * Update openpype/tools/project_manager/project_manager/widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * remove unused import * use integer or float instead of text Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * import PixmapLabel from 'utils' * fix spinbox field length for macos * set aspect decimals to 2 * remove set size policy * set field growth policy for macos * add newline --------- Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/client/operations.py | 9 +- .../project_manager/widgets.py | 161 ++++++++++++------ 2 files changed, 117 insertions(+), 53 deletions(-) diff --git a/openpype/client/operations.py b/openpype/client/operations.py index ef48f2a1c4..e8c9d28636 100644 --- a/openpype/client/operations.py +++ b/openpype/client/operations.py @@ -220,7 +220,6 @@ def new_representation_doc( "parent": version_id, "name": name, "data": data, - # Imprint shortcut to context for performance reasons. "context": context } @@ -708,7 +707,11 @@ class OperationsSession(object): return operation -def create_project(project_name, project_code, library_project=False): +def create_project( + project_name, + project_code, + library_project=False, +): """Create project using OpenPype settings. This project creation function is not validating project document on @@ -752,7 +755,7 @@ def create_project(project_name, project_code, library_project=False): "name": project_name, "data": { "code": project_code, - "library_project": library_project + "library_project": library_project, }, "schema": CURRENT_PROJECT_SCHEMA } diff --git a/openpype/tools/project_manager/project_manager/widgets.py b/openpype/tools/project_manager/project_manager/widgets.py index 06ae06e4d2..3154f777df 100644 --- a/openpype/tools/project_manager/project_manager/widgets.py +++ b/openpype/tools/project_manager/project_manager/widgets.py @@ -1,4 +1,5 @@ import re +import platform from openpype.client import get_projects, create_project from .constants import ( @@ -8,13 +9,16 @@ from .constants import ( from openpype.client.operations import ( PROJECT_NAME_ALLOWED_SYMBOLS, PROJECT_NAME_REGEX, + OperationsSession, ) from openpype.style import load_stylesheet from openpype.pipeline import AvalonMongoDB from openpype.tools.utils import ( PlaceholderLineEdit, - get_warning_pixmap + get_warning_pixmap, + PixmapLabel, ) +from openpype.settings.lib import get_default_anatomy_settings from qtpy import QtWidgets, QtCore, QtGui @@ -35,7 +39,7 @@ class NameTextEdit(QtWidgets.QLineEdit): sub_regex = "[^{}]+".format(NAME_ALLOWED_SYMBOLS) new_before_text = re.sub(sub_regex, "", before_text) new_after_text = re.sub(sub_regex, "", after_text) - idx -= (len(before_text) - len(new_before_text)) + idx -= len(before_text) - len(new_before_text) self.setText(new_before_text + new_after_text) self.setCursorPosition(idx) @@ -141,13 +145,40 @@ class CreateProjectDialog(QtWidgets.QDialog): inputs_widget = QtWidgets.QWidget(self) project_name_input = QtWidgets.QLineEdit(inputs_widget) project_code_input = QtWidgets.QLineEdit(inputs_widget) + project_width_input = NumScrollWidget(0, 9999999) + project_height_input = NumScrollWidget(0, 9999999) + project_fps_input = FloatScrollWidget(1, 9999999, decimals=3, step=1) + project_aspect_input = FloatScrollWidget( + 0, 9999999, decimals=2, step=0.1 + ) + project_frame_start_input = NumScrollWidget(-9999999, 9999999) + project_frame_end_input = NumScrollWidget(-9999999, 9999999) + + default_project_data = self.get_default_attributes() + project_width_input.setValue(default_project_data["resolutionWidth"]) + project_height_input.setValue(default_project_data["resolutionHeight"]) + project_fps_input.setValue(default_project_data["fps"]) + project_aspect_input.setValue(default_project_data["pixelAspect"]) + project_frame_start_input.setValue(default_project_data["frameStart"]) + project_frame_end_input.setValue(default_project_data["frameEnd"]) + library_project_input = QtWidgets.QCheckBox(inputs_widget) inputs_layout = QtWidgets.QFormLayout(inputs_widget) + if platform.system() == "Darwin": + inputs_layout.setFieldGrowthPolicy( + QtWidgets.QFormLayout.AllNonFixedFieldsGrow + ) inputs_layout.setContentsMargins(0, 0, 0, 0) inputs_layout.addRow("Project name:", project_name_input) inputs_layout.addRow("Project code:", project_code_input) inputs_layout.addRow("Library project:", library_project_input) + inputs_layout.addRow("Width:", project_width_input) + inputs_layout.addRow("Height:", project_height_input) + inputs_layout.addRow("FPS:", project_fps_input) + inputs_layout.addRow("Aspect:", project_aspect_input) + inputs_layout.addRow("Frame Start:", project_frame_start_input) + inputs_layout.addRow("Frame End:", project_frame_end_input) project_name_label = QtWidgets.QLabel(self) project_code_label = QtWidgets.QLabel(self) @@ -183,6 +214,12 @@ class CreateProjectDialog(QtWidgets.QDialog): self.project_name_input = project_name_input self.project_code_input = project_code_input self.library_project_input = library_project_input + self.project_width_input = project_width_input + self.project_height_input = project_height_input + self.project_fps_input = project_fps_input + self.project_aspect_input = project_aspect_input + self.project_frame_start_input = project_frame_start_input + self.project_frame_end_input = project_frame_end_input self.ok_btn = ok_btn @@ -190,6 +227,10 @@ class CreateProjectDialog(QtWidgets.QDialog): def project_name(self): return self.project_name_input.text() + def get_default_attributes(self): + settings = get_default_anatomy_settings() + return settings["attributes"] + def _on_project_name_change(self, value): if self._project_code_value is None: self._ignore_code_change = True @@ -215,12 +256,12 @@ class CreateProjectDialog(QtWidgets.QDialog): is_valid = False elif value in self.invalid_project_names: - message = "Project name \"{}\" already exist".format(value) + message = 'Project name "{}" already exist'.format(value) is_valid = False elif not PROJECT_NAME_REGEX.match(value): message = ( - "Project name \"{}\" contain not supported symbols" + 'Project name "{}" contain not supported symbols' ).format(value) is_valid = False @@ -237,12 +278,12 @@ class CreateProjectDialog(QtWidgets.QDialog): is_valid = False elif value in self.invalid_project_names: - message = "Project code \"{}\" already exist".format(value) + message = 'Project code "{}" already exist'.format(value) is_valid = False elif not PROJECT_NAME_REGEX.match(value): message = ( - "Project code \"{}\" contain not supported symbols" + 'Project code "{}" contain not supported symbols' ).format(value) is_valid = False @@ -264,9 +305,35 @@ class CreateProjectDialog(QtWidgets.QDialog): project_name = self.project_name_input.text() project_code = self.project_code_input.text() - library_project = self.library_project_input.isChecked() - create_project(project_name, project_code, library_project) + project_width = self.project_width_input.value() + project_height = self.project_height_input.value() + project_fps = self.project_fps_input.value() + project_aspect = self.project_aspect_input.value() + project_frame_start = self.project_frame_start_input.value() + project_frame_end = self.project_frame_end_input.value() + library_project = self.library_project_input.isChecked() + project_doc = create_project( + project_name, + project_code, + library_project, + ) + update_data = { + "data.resolutionWidth": project_width, + "data.resolutionHeight": project_height, + "data.fps": project_fps, + "data.pixelAspect": project_aspect, + "data.frameStart": project_frame_start, + "data.frameEnd": project_frame_end, + } + session = OperationsSession() + session.update_entity( + project_name, + project_doc["type"], + project_doc["_id"], + update_data, + ) + session.commit() self.done(1) def _get_existing_projects(self): @@ -288,45 +355,15 @@ class CreateProjectDialog(QtWidgets.QDialog): return project_names, project_codes -# TODO PixmapLabel should be moved to 'utils' in other future PR so should be -# imported from there -class PixmapLabel(QtWidgets.QLabel): - """Label resizing image to height of font.""" - def __init__(self, pixmap, parent): - super(PixmapLabel, self).__init__(parent) - self._empty_pixmap = QtGui.QPixmap(0, 0) - self._source_pixmap = pixmap - - def set_source_pixmap(self, pixmap): - """Change source image.""" - self._source_pixmap = pixmap - self._set_resized_pix() - +class ProjectManagerPixmapLabel(PixmapLabel): def _get_pix_size(self): size = self.fontMetrics().height() * 4 return size, size - def _set_resized_pix(self): - if self._source_pixmap is None: - self.setPixmap(self._empty_pixmap) - return - width, height = self._get_pix_size() - self.setPixmap( - self._source_pixmap.scaled( - width, - height, - QtCore.Qt.KeepAspectRatio, - QtCore.Qt.SmoothTransformation - ) - ) - - def resizeEvent(self, event): - self._set_resized_pix() - super(PixmapLabel, self).resizeEvent(event) - class ConfirmProjectDeletion(QtWidgets.QDialog): """Dialog which confirms deletion of a project.""" + def __init__(self, project_name, parent): super(ConfirmProjectDeletion, self).__init__(parent) @@ -335,23 +372,26 @@ class ConfirmProjectDeletion(QtWidgets.QDialog): top_widget = QtWidgets.QWidget(self) warning_pixmap = get_warning_pixmap() - warning_icon_label = PixmapLabel(warning_pixmap, top_widget) + warning_icon_label = ProjectManagerPixmapLabel( + warning_pixmap, top_widget + ) message_label = QtWidgets.QLabel(top_widget) message_label.setWordWrap(True) message_label.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction) - message_label.setText(( - "WARNING: This cannot be undone.

" - "Project \"{}\" with all related data will be" - " permanently removed from the database. (This action won't remove" - " any files on disk.)" - ).format(project_name)) + message_label.setText( + ( + "WARNING: This cannot be undone.

" + 'Project "{}" with all related data will be' + " permanently removed from the database." + " (This action won't remove any files on disk.)" + ).format(project_name) + ) top_layout = QtWidgets.QHBoxLayout(top_widget) top_layout.setContentsMargins(0, 0, 0, 0) top_layout.addWidget( - warning_icon_label, 0, - QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter + warning_icon_label, 0, QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter ) top_layout.addWidget(message_label, 1) @@ -359,7 +399,7 @@ class ConfirmProjectDeletion(QtWidgets.QDialog): confirm_input = PlaceholderLineEdit(self) confirm_input.setPlaceholderText( - "Type \"{}\" to confirm...".format(project_name) + 'Type "{}" to confirm...'.format(project_name) ) cancel_btn = QtWidgets.QPushButton("Cancel", self) @@ -429,6 +469,7 @@ class ConfirmProjectDeletion(QtWidgets.QDialog): class SpinBoxScrollFixed(QtWidgets.QSpinBox): """QSpinBox which only allow edits change with scroll wheel when active""" + def __init__(self, *args, **kwargs): super(SpinBoxScrollFixed, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) @@ -442,6 +483,7 @@ class SpinBoxScrollFixed(QtWidgets.QSpinBox): class DoubleSpinBoxScrollFixed(QtWidgets.QDoubleSpinBox): """QDoubleSpinBox which only allow edits with scroll wheel when active""" + def __init__(self, *args, **kwargs): super(DoubleSpinBoxScrollFixed, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) @@ -451,3 +493,22 @@ class DoubleSpinBoxScrollFixed(QtWidgets.QDoubleSpinBox): event.ignore() else: super(DoubleSpinBoxScrollFixed, self).wheelEvent(event) + + +class NumScrollWidget(SpinBoxScrollFixed): + def __init__(self, minimum, maximum): + super(NumScrollWidget, self).__init__() + self.setMaximum(maximum) + self.setMinimum(minimum) + self.setButtonSymbols(QtWidgets.QSpinBox.NoButtons) + + +class FloatScrollWidget(DoubleSpinBoxScrollFixed): + def __init__(self, minimum, maximum, decimals, step=None): + super(FloatScrollWidget, self).__init__() + self.setMaximum(maximum) + self.setMinimum(minimum) + self.setDecimals(decimals) + if step is not None: + self.setSingleStep(step) + self.setButtonSymbols(QtWidgets.QSpinBox.NoButtons) From 3314c5f282539f6688ee24ee583e53e95c6c8e04 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 19 Jun 2023 21:57:30 +0800 Subject: [PATCH 173/207] use createOptions() for defaultArnoldRenderOptions --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index 1a582647cc..d71b40e877 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -42,8 +42,10 @@ class ArnoldStandinLoader(load.LoaderPlugin): # does not exist yet and some connections to the standin # can't be correctly generated on create resulting in an error cmds.loadPlugin("mtoa") - cmds.refresh(force=True) - maya.utils.processIdleEvents() + # create defaultArnoldRenderOptions for + # `defaultArnoldRenderOptions.operator`` + from mtoa.core import createOptions + createOptions() import mtoa.ui.arnoldmenu From 92c6cee333d08bb685574f896d33abc253a6d220 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 19 Jun 2023 21:58:31 +0800 Subject: [PATCH 174/207] hound fix --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index d71b40e877..a12ecf8f9f 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -2,7 +2,6 @@ import os import clique import maya.cmds as cmds -import maya.utils from openpype.settings import get_project_settings from openpype.pipeline import ( From 3020ccd90abdf8528052c07eb437e4bd065721f1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 19 Jun 2023 23:00:44 +0800 Subject: [PATCH 175/207] update docstring --- .../hosts/maya/plugins/load/load_arnold_standin.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index a12ecf8f9f..a085f8d575 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -36,13 +36,11 @@ class ArnoldStandinLoader(load.LoaderPlugin): def load(self, context, name, namespace, options): if not cmds.pluginInfo("mtoa", query=True, loaded=True): - # Allow mtoa plugin load to process all its events - # because otherwise `defaultArnoldRenderOptions.operator` - # does not exist yet and some connections to the standin - # can't be correctly generated on create resulting in an error cmds.loadPlugin("mtoa") - # create defaultArnoldRenderOptions for - # `defaultArnoldRenderOptions.operator`` + # create defaultArnoldRenderOptions before creating aiStandin + # which tried to connect it. Since we load the plugin and directly + # create aiStandin without the defaultArnoldRenderOptions, + # here needs to create the render options for aiStandin creation. from mtoa.core import createOptions createOptions() From 83a37eaa76292936e16fddea238ad4ca3045d3de Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 19 Jun 2023 16:11:43 +0100 Subject: [PATCH 176/207] Account for multiple descriptions on single geometry. --- openpype/hosts/maya/plugins/publish/collect_xgen.py | 11 ++++++----- openpype/hosts/maya/plugins/publish/extract_xgen.py | 6 ++---- openpype/hosts/maya/plugins/publish/validate_xgen.py | 4 +--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_xgen.py b/openpype/hosts/maya/plugins/publish/collect_xgen.py index da0549b2d8..a065b6498a 100644 --- a/openpype/hosts/maya/plugins/publish/collect_xgen.py +++ b/openpype/hosts/maya/plugins/publish/collect_xgen.py @@ -30,12 +30,13 @@ class CollectXgen(pyblish.api.InstancePlugin): if data["xgmPalettes"]: data["xgmPalette"] = data["xgmPalettes"][0] - data["xgenConnections"] = {} + data["xgenConnections"] = [] for node in data["xgmSubdPatches"]: - data["xgenConnections"][node] = {} - for attr in ["transform", "geometry"]: - input = get_attribute_input("{}.{}".format(node, attr)) - data["xgenConnections"][node][attr] = input + connected_transform = get_attribute_input( + node + ".transform" + ).split(".")[0] + if connected_transform not in data["xgenConnections"]: + data["xgenConnections"].append(connected_transform) # Collect all files under palette root as resources. import xgenm diff --git a/openpype/hosts/maya/plugins/publish/extract_xgen.py b/openpype/hosts/maya/plugins/publish/extract_xgen.py index fb097ca84a..9b4e5e403d 100644 --- a/openpype/hosts/maya/plugins/publish/extract_xgen.py +++ b/openpype/hosts/maya/plugins/publish/extract_xgen.py @@ -51,11 +51,9 @@ class ExtractXgen(publish.Extractor): with delete_after() as delete_bin: duplicate_nodes = [] # Collect nodes to export. - for _, connections in instance.data["xgenConnections"].items(): - transform_name = connections["transform"].split(".")[0] - + for node in instance.data["xgenConnections"]: # Duplicate_transform subd patch geometry. - duplicate_transform = cmds.duplicate(transform_name)[0] + duplicate_transform = cmds.duplicate(node)[0] delete_bin.append(duplicate_transform) # Discard the children. diff --git a/openpype/hosts/maya/plugins/publish/validate_xgen.py b/openpype/hosts/maya/plugins/publish/validate_xgen.py index 47b24e218c..a44fa56308 100644 --- a/openpype/hosts/maya/plugins/publish/validate_xgen.py +++ b/openpype/hosts/maya/plugins/publish/validate_xgen.py @@ -61,9 +61,7 @@ class ValidateXgen(pyblish.api.InstancePlugin): # We need a namespace else there will be a naming conflict when # extracting because of stripping namespaces and parenting to world. node_names = [instance.data["xgmPalette"]] - for _, connections in instance.data["xgenConnections"].items(): - node_names.append(connections["transform"].split(".")[0]) - + node_names.extend(instance.data["xgenConnections"]) non_namespaced_nodes = [n for n in node_names if ":" not in n] if non_namespaced_nodes: raise PublishValidationError( From 4ffab0bb678855d2b963d63cb982c614099cf447 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 19 Jun 2023 23:20:08 +0800 Subject: [PATCH 177/207] update docstring --- openpype/hosts/maya/plugins/load/load_arnold_standin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_arnold_standin.py b/openpype/hosts/maya/plugins/load/load_arnold_standin.py index a085f8d575..38a7adfd7d 100644 --- a/openpype/hosts/maya/plugins/load/load_arnold_standin.py +++ b/openpype/hosts/maya/plugins/load/load_arnold_standin.py @@ -37,10 +37,10 @@ class ArnoldStandinLoader(load.LoaderPlugin): def load(self, context, name, namespace, options): if not cmds.pluginInfo("mtoa", query=True, loaded=True): cmds.loadPlugin("mtoa") - # create defaultArnoldRenderOptions before creating aiStandin - # which tried to connect it. Since we load the plugin and directly + # Create defaultArnoldRenderOptions before creating aiStandin + # which tries to connect it. Since we load the plugin and directly # create aiStandin without the defaultArnoldRenderOptions, - # here needs to create the render options for aiStandin creation. + # we need to create the render options for aiStandin creation. from mtoa.core import createOptions createOptions() From 82ae12695b52ae9f6a3de4ed4b7f99f140170238 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Mon, 19 Jun 2023 16:26:57 +0100 Subject: [PATCH 178/207] Update openpype/hosts/maya/plugins/publish/collect_xgen.py Co-authored-by: Roy Nieterau --- openpype/hosts/maya/plugins/publish/collect_xgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_xgen.py b/openpype/hosts/maya/plugins/publish/collect_xgen.py index a065b6498a..d41b87e25b 100644 --- a/openpype/hosts/maya/plugins/publish/collect_xgen.py +++ b/openpype/hosts/maya/plugins/publish/collect_xgen.py @@ -30,7 +30,7 @@ class CollectXgen(pyblish.api.InstancePlugin): if data["xgmPalettes"]: data["xgmPalette"] = data["xgmPalettes"][0] - data["xgenConnections"] = [] + data["xgenConnections"] = set() for node in data["xgmSubdPatches"]: connected_transform = get_attribute_input( node + ".transform" From d2de6f1c7221f74774f1af0e406e4af1d4ca9f17 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Mon, 19 Jun 2023 16:27:04 +0100 Subject: [PATCH 179/207] Update openpype/hosts/maya/plugins/publish/collect_xgen.py Co-authored-by: Roy Nieterau --- openpype/hosts/maya/plugins/publish/collect_xgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_xgen.py b/openpype/hosts/maya/plugins/publish/collect_xgen.py index d41b87e25b..e7c730cbf4 100644 --- a/openpype/hosts/maya/plugins/publish/collect_xgen.py +++ b/openpype/hosts/maya/plugins/publish/collect_xgen.py @@ -36,7 +36,7 @@ class CollectXgen(pyblish.api.InstancePlugin): node + ".transform" ).split(".")[0] if connected_transform not in data["xgenConnections"]: - data["xgenConnections"].append(connected_transform) + data["xgenConnections"].add(connected_transform) # Collect all files under palette root as resources. import xgenm From b365fc7534f14dc90ba183eca1e38b650eb7a836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Mon, 19 Jun 2023 18:37:33 +0200 Subject: [PATCH 180/207] Update openpype/hosts/max/api/plugin.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/hosts/max/api/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 4fc852e2fe..4c1dbb2810 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -110,7 +110,7 @@ class MaxCreatorBase(object): @staticmethod def cache_subsets(shared_data): - if shared_data.get("max_cached_subsets"): + if shared_data.get("max_cached_subsets") is not None: return shared_data shared_data["max_cached_subsets"] = {} From bc33407f28dcd99a22d6239031f52dc375ebeb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Mon, 19 Jun 2023 18:39:54 +0200 Subject: [PATCH 181/207] Update openpype/hosts/max/plugins/publish/extract_pointcloud.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/max/plugins/publish/extract_pointcloud.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/max/plugins/publish/extract_pointcloud.py b/openpype/hosts/max/plugins/publish/extract_pointcloud.py index 618f9856fd..583bbb6dbd 100644 --- a/openpype/hosts/max/plugins/publish/extract_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/extract_pointcloud.py @@ -138,9 +138,9 @@ class ExtractPointCloud(publish.Extractor): sub_anim = rt.GetSubAnim(obj, anim_name) boolean = rt.IsProperty(sub_anim, "Export_Particles") if boolean: - event_name = sub_anim.Name - opt = f"${member.Name}.{event_name}.export_particles" - opt_list.append(opt) + event_name = sub_anim.Name + opt = f"${member.Name}.{event_name}.export_particles" + opt_list.append(opt) return opt_list From 203e29c45117668a4ed0281dc42e3893ae897d3f Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Mon, 19 Jun 2023 19:03:21 +0200 Subject: [PATCH 182/207] :rewind: in unrelated file --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 42cacdc93c..10cca3eb3f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,4 +28,4 @@ omit = /tests directory = ./coverage [tool:pytest] -norecursedirs = repos/* openpype/modules/ftrack/* +norecursedirs = repos/* openpype/modules/ftrack/* \ No newline at end of file From 33b9e16635fcfad0285d18e6e15fe526cb64df4b Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 19 Jun 2023 21:11:47 +0100 Subject: [PATCH 183/207] Ensure workspace xgen file is overwritten and update UI. --- openpype/hosts/maya/plugins/load/load_xgen.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_xgen.py b/openpype/hosts/maya/plugins/load/load_xgen.py index 7e6cabc77c..16f2e8e842 100644 --- a/openpype/hosts/maya/plugins/load/load_xgen.py +++ b/openpype/hosts/maya/plugins/load/load_xgen.py @@ -1,4 +1,5 @@ import os +import shutil import maya.cmds as cmds import xgenm @@ -116,8 +117,8 @@ class XgenLoader(openpype.hosts.maya.api.plugin.ReferenceLoader): def update(self, container, representation): """Workflow for updating Xgen. - - Copy and potentially overwrite the workspace .xgen file. - Export changes to delta file. + - Copy and overwrite the workspace .xgen file. - Set collection attributes to not include delta files. - Update xgen maya file reference. - Apply the delta file changes. @@ -130,6 +131,10 @@ class XgenLoader(openpype.hosts.maya.api.plugin.ReferenceLoader): There is an implicit increment of the xgen and delta files, due to using the workfile basename. """ + # Storing current description to try and maintain later. + current_description = ( + xgenm.xgGlobal.DescriptionEditor.currentDescription() + ) container_node = container["objectName"] members = get_container_members(container_node) @@ -160,6 +165,7 @@ class XgenLoader(openpype.hosts.maya.api.plugin.ReferenceLoader): data_path ) data = {"xgProjectPath": project_path, "xgDataPath": data_path} + shutil.copy(new_xgen_file, xgen_file) write_xgen_file(data, xgen_file) attribute_data = { @@ -171,3 +177,11 @@ class XgenLoader(openpype.hosts.maya.api.plugin.ReferenceLoader): super().update(container, representation) xgenm.applyDelta(xgen_palette.replace("|", ""), xgd_file) + + # Restore current selected description if it exists. + if cmds.objExists(current_description): + xgenm.xgGlobal.DescriptionEditor.setCurrentDescription( + current_description + ) + # Full UI refresh. + xgenm.xgGlobal.DescriptionEditor.refresh("Full") From a72050e71c1de86f7cef5b6707858fdc7bf0c4be Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 17:53:42 +0800 Subject: [PATCH 184/207] allows both meshes and groups for assexport --- .../publish/collect_arnold_scene_source.py | 38 +++++++++++++++---- .../publish/extract_arnold_scene_source.py | 4 +- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py index 34db3faa2f..1b8ec27509 100644 --- a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py @@ -23,22 +23,44 @@ class CollectArnoldSceneSource(pyblish.api.InstancePlugin): continue if objset.endswith("content_SET"): members = cmds.ls(members, long=True) + members_list = [] + for member in members: + shape = cmds.listRelatives( + member, shapes=True, fullPath=True) + if not shape: + continue + members_list = members + shape + group_name = "|{}".format(member) + if group_name in members_list: + members_list.remove(group_name) + children = get_all_children(members) + + if members_list: + children.extend(members_list) instance.data["contentMembers"] = children - # TODO: include another instance.data for content members - instance.data["contentMembersTransform"] = members self.log.debug("content members: {}".format(children)) - self.log.debug( - "content members transform : {}".format(members)) + elif objset.endswith("proxy_SET"): proxy_members = cmds.ls(members, long=True) + proxy_list = [] + for proxy in proxy_members: + shape = cmds.listRelatives( + proxy, shapes=True, fullPath=True) + if not shape: + continue + proxy_list = proxy_members + shape + group_name = "|{}".format(proxy) + if group_name in proxy_list: + proxy_list.remove(group_name) + set_members = get_all_children(proxy_members) + if proxy_list: + set_members.extend(proxy_list) + instance.data["proxy"] = set_members - instance.data["proxyTransform"] = proxy_members - # TODO: include another instance.data for proxy self.log.debug("proxy members: {}".format(set_members)) - self.log.debug( - "proxy members transform: {}".format(proxy_members)) + # Use camera in object set if present else default to render globals # camera. diff --git a/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py index f49d8ece57..8696f5a94b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py @@ -72,7 +72,7 @@ class ExtractArnoldSceneSource(publish.Extractor): # TODO: dont use instance.data["contentMembers"] # but use the new instance.data["contentMemberTransforms"] filenames, nodes_by_id = self._extract( - instance.data["contentMembersTransform"], attribute_data, kwargs + instance.data["contentMembers"], attribute_data, kwargs ) if "representations" not in instance.data: @@ -113,7 +113,7 @@ class ExtractArnoldSceneSource(publish.Extractor): # TODO: dont use instance.data["proxy"] # but use the new instance.data["proxyTransforms"] filenames, _ = self._extract( - instance.data["proxyTransform"], attribute_data, kwargs + instance.data["proxy"], attribute_data, kwargs ) representation = { From 9b4641de65a1d20a66d4f78b30a9c1b8448a4d2e Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 17:56:16 +0800 Subject: [PATCH 185/207] rename the setting panel --- openpype/hosts/nuke/startup/custom_write_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index a221a26424..ef3923f40a 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -62,7 +62,7 @@ knobs_setting = { class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): """ Write Node's Knobs Settings Panel """ def __init__(self): - nukescripts.PythonPanel.__init__(self, "Set Knobs Value(Write Node)") + nukescripts.PythonPanel.__init__(self, "Set Presets(Write Node)") knobs_value, _ = self.get_node_knobs_setting() # create knobs From f0bf7d8c665b23dbd19ae2cda7da47ef233dd741 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 17:57:45 +0800 Subject: [PATCH 186/207] remove hardcoded frame padding --- openpype/hosts/nuke/startup/custom_write_node.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index ef3923f40a..1db235b71a 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -9,7 +9,6 @@ from openpype.hosts.nuke.api.lib import ( ) -frame_padding = 5 temp_rendering_path_template = ( "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}") @@ -62,7 +61,7 @@ knobs_setting = { class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): """ Write Node's Knobs Settings Panel """ def __init__(self): - nukescripts.PythonPanel.__init__(self, "Set Presets(Write Node)") + nukescripts.PythonPanel.__init__(self, "Set Preset(Write Node)") knobs_value, _ = self.get_node_knobs_setting() # create knobs From 1ae4cbcdad521fcbda19cf868973b0f0ab470322 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 17:59:33 +0800 Subject: [PATCH 187/207] use preset name --- openpype/hosts/nuke/startup/custom_write_node.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 1db235b71a..9628876d0a 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -61,13 +61,13 @@ knobs_setting = { class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): """ Write Node's Knobs Settings Panel """ def __init__(self): - nukescripts.PythonPanel.__init__(self, "Set Preset(Write Node)") + nukescripts.PythonPanel.__init__(self,"Set Knobs Value(Write Node)") - knobs_value, _ = self.get_node_knobs_setting() + preset_name, _ = self.get_node_knobs_setting() # create knobs self.selected_preset_name = nuke.Enumeration_Knob( - 'preset_selector', 'presets', knobs_value) + 'preset_selector', 'presets', preset_name) # add knobs to panel self.addKnob(self.selected_preset_name) @@ -79,11 +79,11 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): node_knobs = self.selected_preset_name.value() ext = None knobs = knobs_setting["knobs"] - knobs_value, node_knobs_settings = ( + preset_name, node_knobs_settings = ( self.get_node_knobs_setting(node_knobs) ) - if node_knobs and knobs_value: + if node_knobs and preset_name: if not node_knobs_settings: nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa else: @@ -118,7 +118,7 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): set_node_knobs_from_settings(write_node, knobs) def get_node_knobs_setting(self, value=None): - knobs_value = [] + preset_name = [] knobs_nodes = [] settings = [ node @@ -134,9 +134,9 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): for setting in settings: if setting["nukeNodeClass"] == "Write" and setting["subsets"]: for knob in setting["subsets"]: - knobs_value.append(knob) + preset_name.append(knob) - return knobs_value, knobs_nodes + return preset_name, knobs_nodes def main(): From 02db5c6792d7e5a89c6243f73e5b11947ee66688 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 18:00:11 +0800 Subject: [PATCH 188/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 9628876d0a..ff4a3a41eb 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -61,7 +61,7 @@ knobs_setting = { class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): """ Write Node's Knobs Settings Panel """ def __init__(self): - nukescripts.PythonPanel.__init__(self,"Set Knobs Value(Write Node)") + nukescripts.PythonPanel.__init__(self, "Set Knobs Value(Write Node)") preset_name, _ = self.get_node_knobs_setting() # create knobs From c920b0ac5accb84982e0bf61d903c9ddc06b701a Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 19:22:28 +0800 Subject: [PATCH 189/207] rename the variable and clean up the code --- .../hosts/nuke/startup/custom_write_node.py | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index ff4a3a41eb..007971fc27 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -74,24 +74,29 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): def process(self): """ Process the panel values. """ write_selected_nodes = [ - s for s in nuke.selectedNodes() if s.Class() == "Write"] + selected_nodes for selected_nodes in nuke.selectedNodes() + if selected_nodes.Class() == "Write"] - node_knobs = self.selected_preset_name.value() + selected_preset = self.selected_preset_name.value() ext = None knobs = knobs_setting["knobs"] - preset_name, node_knobs_settings = ( - self.get_node_knobs_setting(node_knobs) + preset_name, node_knobs_presets = ( + self.get_node_knobs_setting(selected_preset) ) - if node_knobs and preset_name: - if not node_knobs_settings: - nuke.message("No knobs value found in subset group..\nDefault setting will be used..") # noqa + if selected_preset and preset_name: + if not node_knobs_presets: + nuke.message( + "No knobs value found in subset group.." + "\nDefault setting will be used..") else: - knobs = node_knobs_settings + knobs = node_knobs_presets ext_knob_list = [knob for knob in knobs if knob["name"] == "file_type"] if not ext_knob_list: - nuke.message("ERROR: No file type found in the subset's knobs.\nPlease add one to complete setting up the node") # noqa + nuke.message( + "ERROR: No file type found in the subset's knobs." + "\nPlease add one to complete setting up the node") return else: for knob in ext_knob_list: @@ -117,24 +122,24 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): write_node["file"].setValue(file_path) set_node_knobs_from_settings(write_node, knobs) - def get_node_knobs_setting(self, value=None): + def get_node_knobs_setting(self, selected_preset=None): preset_name = [] knobs_nodes = [] settings = [ - node - for node in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + node_settings + for node_settings in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + if node_settings["nukeNodeClass"] == "Write" and node_settings["subsets"] ] if not settings: return for i, _ in enumerate(settings): - if value in settings[i]["subsets"]: + if selected_preset in settings[i]["subsets"]: knobs_nodes = settings[i]["knobs"] for setting in settings: - if setting["nukeNodeClass"] == "Write" and setting["subsets"]: - for knob in setting["subsets"]: - preset_name.append(knob) + for subset in setting["subsets"]: + preset_name.append(subset) return preset_name, knobs_nodes From 3da8dcc7fea93a0b844121acce82ef6803f3f275 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 19:23:32 +0800 Subject: [PATCH 190/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 007971fc27..2052a5a09e 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -126,8 +126,8 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): preset_name = [] knobs_nodes = [] settings = [ - node_settings - for node_settings in get_nuke_imageio_settings()["nodes"]["overrideNodes"] + node_settings for node_settings + in get_nuke_imageio_settings()["nodes"]["overrideNodes"] if node_settings["nukeNodeClass"] == "Write" and node_settings["subsets"] ] if not settings: From 7d99e8c8cf8941e6856e669dfe5134e8a71983fc Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 20 Jun 2023 19:24:41 +0800 Subject: [PATCH 191/207] hound fix --- openpype/hosts/nuke/startup/custom_write_node.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/startup/custom_write_node.py b/openpype/hosts/nuke/startup/custom_write_node.py index 2052a5a09e..ea53725834 100644 --- a/openpype/hosts/nuke/startup/custom_write_node.py +++ b/openpype/hosts/nuke/startup/custom_write_node.py @@ -128,7 +128,8 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): settings = [ node_settings for node_settings in get_nuke_imageio_settings()["nodes"]["overrideNodes"] - if node_settings["nukeNodeClass"] == "Write" and node_settings["subsets"] + if node_settings["nukeNodeClass"] == "Write" + and node_settings["subsets"] ] if not settings: return From 9cc22939794fb1710c43ca7df28e16f81b07617d Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 20 Jun 2023 14:04:17 +0200 Subject: [PATCH 192/207] :recycle: make code compatible with 3dsmax 2022 python 3.7 in 3dsmax 2022 is not supporting walrus operator --- openpype/hosts/max/api/plugin.py | 4 +++- .../hosts/max/plugins/create/create_render.py | 3 ++- .../publish/validate_camera_contents.py | 3 ++- .../publish/validate_model_contents.py | 3 ++- .../plugins/publish/validate_pointcloud.py | 19 ++++++++++++------- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/openpype/hosts/max/api/plugin.py b/openpype/hosts/max/api/plugin.py index 4c1dbb2810..71a0b94e1f 100644 --- a/openpype/hosts/max/api/plugin.py +++ b/openpype/hosts/max/api/plugin.py @@ -207,7 +207,9 @@ class MaxCreator(Creator, MaxCreatorBase): """ for instance in instances: - if instance_node := rt.GetNodeByName(instance.data.get("instance_node")): # noqa + instance_node = rt.GetNodeByName( + instance.data.get("instance_node")) + if instance_node: count = rt.custAttributes.count(instance_node) rt.custAttributes.delete(instance_node, count) rt.Delete(instance_node) diff --git a/openpype/hosts/max/plugins/create/create_render.py b/openpype/hosts/max/plugins/create/create_render.py index 41e49f4620..235046684e 100644 --- a/openpype/hosts/max/plugins/create/create_render.py +++ b/openpype/hosts/max/plugins/create/create_render.py @@ -24,7 +24,8 @@ class CreateRender(plugin.MaxCreator): instance_data, pre_create_data) container_name = instance.data.get("instance_node") - if sel_obj := self.selected_nodes: + sel_obj = self.selected_nodes + if sel_obj: # set viewport camera for rendering(mandatory for deadline) RenderSettings(self.project_settings).set_render_camera(sel_obj) # set output paths for rendering(mandatory for deadline) diff --git a/openpype/hosts/max/plugins/publish/validate_camera_contents.py b/openpype/hosts/max/plugins/publish/validate_camera_contents.py index 85be5d59fa..ab13e5dc05 100644 --- a/openpype/hosts/max/plugins/publish/validate_camera_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_camera_contents.py @@ -18,7 +18,8 @@ class ValidateCameraContent(pyblish.api.InstancePlugin): "$Physical_Camera", "$Target"] def process(self, instance): - if invalid := self.get_invalid(instance): # noqa + invalid = self.get_invalid(instance) + if invalid: raise PublishValidationError(("Camera instance must only include" "camera (and camera target). " f"Invalid content {invalid}")) diff --git a/openpype/hosts/max/plugins/publish/validate_model_contents.py b/openpype/hosts/max/plugins/publish/validate_model_contents.py index 1ec08d9c5f..cfe016f03f 100644 --- a/openpype/hosts/max/plugins/publish/validate_model_contents.py +++ b/openpype/hosts/max/plugins/publish/validate_model_contents.py @@ -18,7 +18,8 @@ class ValidateModelContent(pyblish.api.InstancePlugin): label = "Model Contents" def process(self, instance): - if invalid := self.get_invalid(instance): # noqa + invalid = self.get_invalid(instance) + if invalid: raise PublishValidationError(("Model instance must only include" "Geometry and Editable Mesh. " f"Invalid types on: {invalid}")) diff --git a/openpype/hosts/max/plugins/publish/validate_pointcloud.py b/openpype/hosts/max/plugins/publish/validate_pointcloud.py index e1c2151c9d..1ff6eb126f 100644 --- a/openpype/hosts/max/plugins/publish/validate_pointcloud.py +++ b/openpype/hosts/max/plugins/publish/validate_pointcloud.py @@ -35,12 +35,16 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): """ report = [] - if invalid := self.get_tyflow_object(instance): # noqa - report.append(f"Non tyFlow object found: {invalid}") - if invalid := self.get_tyflow_operator(instance): # noqa - report.append( - f"tyFlow ExportParticle operator not found: {invalid}") + invalid_object = self.get_tyflow_object(instance) + if invalid_object: + report.append(f"Non tyFlow object found: {invalid_object}") + + invalid_operator = self.get_tyflow_operator(instance) + if invalid_operator: + report.append(( + "tyFlow ExportParticle operator not " + f"found: {invalid_operator}")) if self.validate_export_mode(instance): report.append("The export mode is not at PRT") @@ -49,9 +53,10 @@ class ValidatePointCloud(pyblish.api.InstancePlugin): report.append(("tyFlow Partition setting is " "not at the default value")) - if invalid := self.validate_custom_attribute(instance): # noqa + invalid_attribute = self.validate_custom_attribute(instance) + if invalid_attribute: report.append(("Custom Attribute not found " - f":{invalid}")) + f":{invalid_attribute}")) if report: raise PublishValidationError(f"{report}") From b94b7ff5de4af8b27a171bfae5c88c0ea46d4d70 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 20 Jun 2023 16:50:49 +0200 Subject: [PATCH 193/207] backward compatibility fix studio could have set host config paths but those were not resolving to custom config OCIO environment path. Instead it was always falling back to global ocio config paths settings --- openpype/pipeline/colorspace.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 1999ad3bed..13846e9f5c 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -377,6 +377,10 @@ def get_imageio_config( activate_host_color_management = imageio_host.get( "activate_host_color_management", True) + # TODO: remove this in future - backward compatibility + if activate_host_color_management is None: + activate_host_color_management = host_ocio_config.get("enabled", False) + if not activate_host_color_management: # if host settings are disabled return False because # it is expected that no colorspace management is needed From 6f8d47d36bfb948a09bd79891c739d7179579cc3 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 20 Jun 2023 16:52:03 +0200 Subject: [PATCH 194/207] nuke: user prompt if config path changes environment variable cannot be changed dynamically and user should now that settings had been changed and the nuke should be reopened. --- openpype/hosts/nuke/api/lib.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index c05182ce97..e3b34222d4 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2069,6 +2069,35 @@ class WorkfileSettings(object): log.debug("nuke.root()['{}'] changed to: {}".format( knob, value_)) + # set ocio config path + if config_data: + current_ocio_path = os.getenv("OCIO") + if current_ocio_path != config_data["path"]: + message = """ +It seems like there's a mismatch between the OCIO config path set in your Nuke +settings and the actual path set in your OCIO environment. + +To resolve this, please follow these steps: +1. Close Nuke if it's currently open. +2. Reopen Nuke. + +Please note the paths for your reference: + +- The OCIO environment path currently set: + `{env_path}` + +- The path in your current Nuke settings: + `{settings_path}` + +Reopening Nuke should synchronize these paths and resolve any discrepancies. +""" + nuke.message( + message.format( + env_path=current_ocio_path, + settings_path=config_data["path"] + ) + ) + def set_writes_colorspace(self): ''' Adds correct colorspace to write node dict From a5b93a9062dc957b06f1b99e10b0298318bda909 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 20 Jun 2023 16:30:44 +0100 Subject: [PATCH 195/207] Copy shading assignments. --- openpype/hosts/maya/plugins/publish/extract_xgen.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openpype/hosts/maya/plugins/publish/extract_xgen.py b/openpype/hosts/maya/plugins/publish/extract_xgen.py index fb097ca84a..17b60e3108 100644 --- a/openpype/hosts/maya/plugins/publish/extract_xgen.py +++ b/openpype/hosts/maya/plugins/publish/extract_xgen.py @@ -88,6 +88,18 @@ class ExtractXgen(publish.Extractor): delete_bin.append(palette) + # Copy shading assignments. + nodes = ( + instance.data["xgmDescriptions"] + + instance.data["xgmSubdPatches"] + ) + for node in nodes: + target_node = node.split(":")[-1] + shading_engine = cmds.listConnections( + node, type="shadingEngine" + )[0] + cmds.sets(target_node, edit=True, forceElement=shading_engine) + # Export duplicated palettes. xgenm.exportPalette(palette, xgen_path) From 8d621f9fbfb962fcde09c97bdc09080f7f0370cd Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 20 Jun 2023 17:42:34 +0100 Subject: [PATCH 196/207] Fix patches export. --- openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py b/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py index 20e1bd37d8..0d2a97bc4b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py +++ b/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py @@ -57,7 +57,7 @@ class ExtractWorkfileXgen(publish.Extractor): continue render_start_frame = instance.data["frameStart"] - render_end_frame = instance.data["frameStart"] + render_end_frame = instance.data["frameEnd"] if start_frame is None: start_frame = render_start_frame From b18b44fd984112e9815811b474205a7923d6e7d9 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Wed, 21 Jun 2023 03:25:18 +0000 Subject: [PATCH 197/207] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index 9c5a60964b..3a218f3a06 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.15.11-nightly.3" +__version__ = "3.15.11-nightly.4" From 588148cb9f92b824d15cd055f93e006c931b8559 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 21 Jun 2023 03:26:01 +0000 Subject: [PATCH 198/207] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2fd2780e55..203ac1df23 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.15.11-nightly.4 - 3.15.11-nightly.3 - 3.15.11-nightly.2 - 3.15.11-nightly.1 @@ -134,7 +135,6 @@ body: - 3.14.3 - 3.14.3-nightly.7 - 3.14.3-nightly.6 - - 3.14.3-nightly.5 validations: required: true - type: dropdown From 7dd30b505d267074af625c1b24175e8e8a51df7e Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Wed, 21 Jun 2023 08:16:53 +0100 Subject: [PATCH 199/207] Update openpype/hosts/maya/plugins/publish/collect_xgen.py Co-authored-by: Roy Nieterau --- openpype/hosts/maya/plugins/publish/collect_xgen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_xgen.py b/openpype/hosts/maya/plugins/publish/collect_xgen.py index e7c730cbf4..46968f7d1a 100644 --- a/openpype/hosts/maya/plugins/publish/collect_xgen.py +++ b/openpype/hosts/maya/plugins/publish/collect_xgen.py @@ -35,8 +35,7 @@ class CollectXgen(pyblish.api.InstancePlugin): connected_transform = get_attribute_input( node + ".transform" ).split(".")[0] - if connected_transform not in data["xgenConnections"]: - data["xgenConnections"].add(connected_transform) + data["xgenConnections"].add(connected_transform) # Collect all files under palette root as resources. import xgenm From c18afe974bee2e9e8a4bd59c97fda6098b8910e8 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 21 Jun 2023 16:27:17 +0800 Subject: [PATCH 200/207] remove unused text files --- igniter/.ass | 212 --------------------------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 igniter/.ass diff --git a/igniter/.ass b/igniter/.ass deleted file mode 100644 index 599a76d732..0000000000 --- a/igniter/.ass +++ /dev/null @@ -1,212 +0,0 @@ -### exported: Thu Jun 15 17:07:53 2023 -### from: Arnold 7.1.3.2 [2a385cac] windows clang-10.0.1 oiio-2.4.1 osl-1.12.0 vdb-7.1.1 adlsdk-6.3.1.44 clmhub-2.0.0.235 rlm-14.1.3 optix-6.6.0 2022/09/12 08:50:17 -### host app: MtoA 5.2.1.1 6a048927 (fix-5.2.1) Maya 2023 -### bounds: -1.207354 -0.269835 -1.207354 1.207354 2.144874 1.207354 -### user: Kayla -### render_layer: defaultRenderLayer -### scene: D:/dummy_test/test_Project/test/work/test_v002/test_project_test_test_v002_v070.mb -### meters_per_unit: 0.010000 - - - -options -{ - AA_samples 3 - outputs 4 1 STRING - "RGBA RGBA defaultArnoldFilter/gaussian_filter defaultArnoldDriver/driver_exr.RGBA" - "P VECTOR aiAOVFilter1/closest_filter defaultArnoldDriver/driver_exr.RGBA" - "Pref RGB aiAOVFilter2/closest_filter defaultArnoldDriver/driver_exr.RGBA" - "albedo RGB defaultArnoldFilter/gaussian_filter defaultArnoldDriver/driver_exr.RGBA" - xres 1920 - yres 1080 - texture_per_file_stats on - texture_searchpath "[OPENPYPE_PROJECT_ROOT_WORK];D:/dummy_test/test_Project/test/work/test_v002/sourceimages" - texture_automip off - camera "/camera1/cameraShape1" - color_manager "defaultColorMgtGlobals" - operator "aiMerge1" - meters_per_unit 0.00999999978 - frame 1 - fps 25 - procedural_searchpath "[OPENPYPE_PROJECT_ROOT_WORK];D:/dummy_test/test_Project/test/work/test_v002/" - GI_diffuse_depth 1 - GI_specular_depth 1 - GI_transmission_depth 8 - declare render_layer constant STRING - render_layer "defaultRenderLayer" -} - -gaussian_filter -{ - name defaultArnoldFilter/gaussian_filter -} - -driver_exr -{ - name defaultArnoldDriver/driver_exr.RGBA - filename "D:/dummy_test/test_Project/test/work/test_v002/renders/test_project_test_test_v002_v070/masterLayer/masterLayer.exr" - color_space "" -} - -closest_filter -{ - name aiAOVFilter1/closest_filter -} - -closest_filter -{ - name aiAOVFilter2/closest_filter -} - -merge -{ - name aiMerge1 - inputs "test_01_:string_replace_operator" -} - -string_replace -{ - name test_01_:string_replace_operator - selection "*.(@node=='alembic')" - match "resources/test_project_test_modelMain_v067_proxy.abc" - replace "test_project_test_modelMain_v067.abc" -} - -color_manager_ocio -{ - name defaultColorMgtGlobals - config "D:/maya_config/OCIO-configs/Maya2022-default/config.ocio" - color_space_linear "ACEScg" -} - -polymesh -{ - name /proxy/pSphere/pSphereShape - visibility 255 - sidedness 255 - matrix - 2.41470838 0 0 0 - 0 2.41470838 0 0 - 0 0 2.41470838 0 - 0 0.937519372 0 1 - shader "lambert1" - id 2564139679 - nsides 6 1 UINT -4 4 4 4 4 4 - vidxs 24 1 b85UINT -B$ZuK*%:$$-?2$vMr4%:&UObB$w/J=(3BP? - vlist 8 1 b85VECTOR -aDq99aDq9989+]c89+]caDq9989+]caDq99!89+]c$$$$)aDq9989+]caDq9989+]c89+]c!aDq99$$$$(89+]caDq99aDq99 - nlist 24 1 b85VECTOR -zzyzzyzzyzzyzyzzyzzyzzy!$$$$$$$$$'aRT=dzzaRT=dzzaRT=dzzaRT=dzaRT=dzzaRT=dzzaRT=dzzaRT=dzyzzyzzyzzyzzaRT=dzzaRT=dzzaRT=dzzaRT=dzz - uvlist 14 1 b85VECTOR2 -82:0xz80l$K@wi$mMpJ$pnKs$PHvV$PKhS$rXa4$v$<]$USg@$UVY=$wcQs%&/-G$Z^X*$ZaJ'%'nB]%+9s1$_iHi$_l:f%-$3G%0Dcp$dt9S$dw+P%2/$1$h@,s$j**=$j,q:%79ip%:ZED$o4p'$o7b$%j%8uiM%8x[J%[0T+%^Q/T%>+Z7%>.L4%`;Dj%c[u>%C6Jv%C9%mqVg%ML,J%MNsG%o[l(%s'GQ%RVr4%RYd1%tf\g%x28;%5U-2%WdT\&$qMQ&(=)%%\lS]%\oEZ&*'>;&-Gnd%awDG%b%6D&/2/%&2R_N%g-51%g0'.&4RV8&As1a%vM\D%vPNA&C]Fw&$nOd&&XM.&&[?+&Hh7a&L3h5&+c=m&+f/j&Ms(K&Q>Xt&0n.W&0puT&S(n5&VII^&5xtA&6&f>&X3^t&[T:H&;.e+&;1W(&]>O^&`_+2&@9Uj&@x&jta[&JO7>&JR);&l^vq&p*RE&OZ((&O\o%&qig[&u5C/&Tdmg&Tg_d&vtXE'%@3n&Yo^Q&YrPN''*I/'*K$X&_%O;&_(A8',59n'/UjB&d0@%&d31w'1@*X'4`[,&G.Ox&i=wM'6JpB'9kKk&nEvN&nHhK';Ua,'>vb'VriE'Vu[B($*ai('N/L'\(Z/'\+L,()8Db(,Xu6'a3Jn'a6;X'fA-U(3N&6(6nV_'kI,B'kKs?(8Xku(<$GI'pSr,'pVd)(=c\_(A/83'u^bk'uaTh(BnMI(F:(r'X\ri(%lE>(H$>3(KDn\(*tD?(*w6<(M/.r(PO_F(0*5)(0-'&(R9t\(UZP0(55%h(57le(WDeF(Ze@o(:?kR(:B]O(\OV0(_p1Y(?J\<(?MN9(aZFo(e%wC(DUM&(DX>x(fe7Y(Gv@F(I`=e(Ic/b(kp(C(o;Xl(Nk.O(NmuL(q%n-(tFIV(Sut9(Sxf6(v0^l)$Q:@(Y+dx(Y.Vu)&;OV))\+*(^6Ub(^9G_)+F@@).fpi(cAFL(cD8I)0Q1*)3qaS(hL76(hO)3)5Y/Z)9'R=(mW'u(mYnr):fgS)>2C'(ram_(rd_\)?qX=)C=3f(wl^I(woPF)E'I')HH$P)'wO3)(%A0)J29f)MRj:)--?r)-01o)O=*P)R][$)280\)2:wY)TGp:)WhKc(j6@Z)7Eh/)YRa$)\sc`)Kn9C)Kq+@)n(xv)qITJ)Q$*-)Q&q*)s3i`)vTE4)V.ol)V1ai)x>ZJ)YOc7)[9`V)[Z)toi=)tr[:*B*Sp*EK/D*%%Z'*%(L$*G2RK*JUu.**0Jf**3-M*QK&.*TkVW*4F,:*4Hs7*VUkm*YvGA*9Pr$*9Scv*[`\W*_,8+*>[bc*>^T`*`kMA*d7(j*CfSM*CiEJ*ev>+*iAnT*&dcK*Ht5u*k,.j*nL_>*N'4v*N*&s*p6tT*sWP(*S2%`*S4l]*uAe>*xb@g*Xp+/b7Q+3-h%*g]=]*g`/Z+4m(;*k)1(*lh.G*ljuD+9wn%+=CIN*qrt1*quf.+?-^d+BN:8*w(dp*w+Vm+D8ON+GY*w+'3UZ+'6GW+IC@8+Lcpa+,>FD+,A8A+NN0w+QnaK+1I7.+1L)++SXva+W$R5+6T'm+6Vnj+X`u<+Yj%R+Yj1W+Yj=\+YjIa+YjUf+Yjak+Yjmp+Yk$u+Yk1%+Yk=*+YkI/+YkU4+Yka9+Ykm>+Yl$C+Yl0H+Yl$GoW-$IVb>$IVnF$K>Tg$R08V$SlCg$SlOo$UT6;$\Eo*$^-%;$^-1C$_ild$f[PS$$)E7$)3rI$j*)Y$ka82$/uZ&$0%nh$mMp;$plM,$:6;M$:;,-$rXa($uwb%$DKqs$DP>G$wcQj%&-vs$NaSD$NePa%'nBW%+96l$Xw4j$Y%c&%-$3D%0DKe$c7k;$c:u@%2/$1$j$j?$hC+1$hEr-%5R^`%:ZED$o4p'$o7b$%+Z7%>.L4%`;Dj%c[u>%C6Jv%C9%mqVg%ML,J%MNsG%o[l(%s'GQ%RVr4%RYd1%tf\g%x28;%7<8B%YK_m&&XL\&(=)$%\lS\%\oEZ&*'>;&-Gnd%awDG%b%6D&/2/%&2R_N%g-51%g0'.&4RV8&As1a%vM\D%vPNA&C]Fw&&Ufx&$qMw&$t?s&G,,Q&L3h5&+c=m&+f/j&Ms(K&Q>Xt&0n.W&0puT&S(n5&VII^&5xtA&6&f>&X3^t&[T:H&;.e+&;1W(&]>O^&`_+2&@9Uj&@vb'VriE'Vu[B($*mn(%fm9'\(N,'\+@(()8Db(,Xu6'a3Jn'a6;X'fA-U(3N&6(6nV_'kI,B'kKs?(8Xku(<$GI'pSr,'pVd)(=c\_(A/83'u^bk'uaTh(BnMI(F:(r'ZD)$('SPO(I`=>(KDn[(*tD>(*w6<(M/.r(PO_F(0*5)(0-'&(R9t\(UZP0(55%h(57le(WDeF(Ze@o(:?kR(:B]O(\OV0(_p1Y(?J\<(?MN9(aZFo(e%wC(DUM&(DX>x(fe7Y(I]WZ(H$>Y(H'0U(j3r3(o;Xl(Nk.O(NmuL(q%n-(tFIV(Sut9(Sxf6(v0^l)$Q:@(Y+dx(Y.Vu)&;OV))\+*(^6Ub(^9G_)+F@@).fpi(cAFL(cD8I)0Q1*)3qaS(hL76(hO)3)5Y;_)7@;*(mVpr(mYbn):fgS)>2C'(ram_(rd_\)?qX=)C=3f(wl^I(woPF)E'I')HH$P)'wO3)(%A0)J29f)MRj:)--?r)-01o)O=*P)R][$)280\)2:wY)TGp:)WhKc(krKj)9,s@)[9`/)\sc`)Kn9C)Kq+@)n(xv)qITJ)Q$*-)Q&q*)s3i`)vTE4)V.ol)V1ai)x>ZJ)[7%K)YRaJ)YUSF*&b@$*+j&])`DQ@)`GC=*-T;s*0tlG)eOB*)eR4'*2_,]*6*]1)jZ2i)j]$f*7irG*;5Mp)odxS)ogjP*Z)toi=)tr[:*B*Sp*EK/D*%%Z'*%(L$*G2^P*Hn]p**0>c**30_*L@5D*O`em*/;;P*/>-M*QK&.*TkVW*4F,:*4Hs7*VUkm*YvGA*9Pr$*9Scv*[`\W*_,8+*>[bc*>^T`*`kMA*d7(j*CfSM*CiEJ*ev>+*iAnT*(Kn[*J[A1*lh-u*nL_=*N'4u*N*&s*p6tT*sWP(*S2%`*S4l]*uAe>*xb@g*Xp+/b7Q+3-h%*g]=]*g`/Z+4m(;*leH<*k,/;*k.v7+8;bj+=CIN*qrt1*quf.+?-^d+BN:8*w(dp*w+Vm+D8ON+GY*w+'3UZ+'6GW+IC@8+Lcpa+,>FD+,A8A+NN0w+QnaK+1I7.+1L)++SXva+W$R5+6T'm+6Vnj+Xa,A+Yj%R+Yj1Y+YjUg+Yjmq+Yk1&+YkI0+Yka:+Yl$D+YlHN$N^ls$,R7G$,U5H$PI98$Si]]$1](1$1`&2$UT)w$XtNG$6gmp$6jkq$Z^oa$^*?1$;r^Z$;u\[$_i`K$c5/p$A(OD$A+ME$dtQ5$h?uZ$F3@.$GrI?$kfY4$o2(Y$M%H-$M(F.$pqIs$t'W%&2+G%)ROl$\Eo@$\HmA%++Z8%>.X9%aw\)%eC+N%C6Jw%C9Hx%g-Lh%jMq8%HA;a%HD9b%l8=R%oXaw%ML,K%MO*L%qC.<%tcRa%RVr5%RYp6%vMt&&$nCK%Wabt%Wd`u&&Xde&*$45%\lS^%^V\o&-Jld&0k<4%c^[]%caY^&2U]N&5v,s%hiLG%hlJH&7`N8&;+r]%mt=1%mw;2&w&@6cG%s*-p%s-+q&Av/a&EAT1%x4sZ%x7q[&G+uK&JLDp&(?dD&(BbE&L6f5&OW5Z&/1lB&/4jD&S(n4&VI=Y&4<]-&4?[.&X3^s&[T.C&9GMl&9JKm&]>O]&`^t-&>R>V&>U''3'Al'6Gf<&i;0e&i>.f'822V';RW&&nEvO&nHtP'=xwt'?&uu'bp$e'f;I5'Ek*r'En(t'ib,d'm-Q4'Jup]'Jxn^'nlrN'r8As'P+aG'P._H'swc8'wC2]'U6R1'U9P2($-Sw('MxG'ZABp'ZD@q()8Da(,Xi1'_L3Z'_O1[(.C5K(1cYp'dW$D'dYwE(3N&5(8Uao'kI,C'kL*D(:@.4(=`RY'pSr-'pVp.(?Jss(BkCC'u^bl'ua`m(DUd](Gv4-(%iSV(%lQW(I`UG(M,$l(*tD@(*wBA(NkF1(R6jV(0*5*(0-3+(Sv6p(WA[@(55%i(6t/%(Zh>o(^3c?(<'-h(<*+i(_s/Y(c>T)(A1sR(A4qS(e(uC(hIDh(FVl(r_&<(PREe(PUCf(tIGV(wil&(U]6O(U`4P)$T8@)'t\e(\O>M(\R26w(q%VK(q(TL)?qX<)C='a(v0G5(v3E6)E'I&)HGmK)&;7t)&>5u)J29e)O9uJ)--?s)-0=t)Q$Ad)TDf4)280])2;.^)V/2N)YOVs)7BvG)7EtH)[9x8)^ZG])Xp@)s3R()s6P**B*So*EJx?)x>Bh)xA@i*G5DY*JUi)*(I3R*(L1S*L@5C*O`Yh*-T$<*-Vw=*QK&-*TkJR*2^j&*2ah'*VUkl*Yv;<*7iZe*7lXf*[`\V*_,,&*[8*S2%a*S4xb*w)'R+%IKw*X^&+/_-K*bRLt*d1+.%]Z+.([[+Qq_K+U=.p+4leX+4ocZ+XcgJ+\/6o+9wVC+:%TD+]nX4+a:'Y+?-G-+?0E.+c$Hs+fDmC+D87l+D;5m+h/9]+kO^-+IC(V+IF&W+m:*G+pZNl+NMn@+NPlA+rDp1+ue?V+SX_*+S[]++wO`p,%:P.,&vgC,(^)X,*E@m,,,X-,-hoB,/P1W,17Hl,2s`,,4ZwA,6B9V,8)Pk,9eh+,;M*@,=4AU,>pXj,@Wp*,B?2?,D&IT,Eb`i,H'r1,Id4F,KKK[,M2bp,No%0,PVaQ7[Aa/f5)7xuYSaQ7[Aa794h7l?EtaQ7[Aa9['fzaQ7[Aa:L<8`x/vJaQ7[Aa9['ea/f5'aQ7[Aa794fa794faQ7[Aa/f5&a9['caQ7[A`x/vGa:L<5aQ7[Aza9['caQ7[A7l?Eqa794eaQ7[A7xuYOa/f5%aQ7[A8+HY:`x/vGaQ7[A8-jL7]8wuQaQ7[A8.[`^7l?EmaQ7[A8-jL67xuYLaQ7[A8+HY98+HY8aQ7[A7xuYM8-jL6aQ7[A7l?En8.[`]aQ7[Az85BheaOV5ba+:2Y81k?taOV5ba82J)8,AnSaOV5ba=[pI7tIW-aOV5baA3D9zaOV5baBETaa+:2XaOV5baA3D8a82J'aOV5ba=[pFa=[pEaOV5ba82J&aA3D6aOV5ba+:2UaBET^aOV5bzaA3D6aOV5b7tIW*a=[pDaOV5b8,AnOa82J%aOV5b81k?na+:2UaOV5b85Bh^]@q8xaOV5b86U$17tIW(aOV5b85Bh]8,AnMaOV5b81k?m81k?laOV5b8,AnN85Bh\aOV5b7tIW)86U$/aOV5bz8:_aQaMAiaa/f5)87d&JaMAiaa,;a/f5(aMAiaaFP=%a,8aMAiazaFPcW<8'x-gaJT2f8=h8A84LjgaJT2f8;)%18;)%1aJT2f84Lji8=h8@aJT2f8'x-i8>cW;aJT2fz8@J=naG>,6a794h8=>KTaG>,6aCTVt87d&IaG>,6aI/')8+HY,6aL:nBzaG>,6aMAiga794gaG>,6aL:nAaCTVqaG>,6aI/''aI/'&aG>,6aCTVoaL:n?aG>,6a794eaMAidaG>,6zaL:n?aG>,68+HY:aI/'%aG>,687d&CaCTVnaG>,68=>KNa794eaG>,68@J=g]KmN*aG>,68AQ988+HY7aG>,68@J=g87d&@aG>,68=>KM8=>KMaG>,687d&A8@J=faG>,68+HY88AQ96aG>,6z8BUCkaBETZa8YmK8?.MqaBETZaES@889bdbaBETZaJt)F8,iza-&.3aR7`ga::XDa-&.3aPqK=aG-,<8;MPfzaMAii8.[`bzaQ7[IzzaRT=ha:L<8zaQ7[HaG>,:zaMAifaMAiezaG>,9aQ7[Eza:L<5aRT=fzzaQ7[Ez8.[`_aMAidz8;MPbaG>,8z8AQ98a:L<5z8EG*m]Q*w-z8Fcb:8.[`\z8EG*l8;MP`z8AQ978AQ96z8;MPa8EG*kz8.[`]yzz8E+oj7v5R]a::XE8A:.B7v5R]aG-z7v5R]aR7`ga::XD7v5R]aPqK=aG-KT8;MP`aCTVt87d&I8;MP`aI/')8+HY<8;MP`aL:nBz8;MP`aMAiga794g8;MP`aL:nAaCTVq8;MP`aI/''aI/'&8;MP`aCTVoaL:n?8;MP`a794eaMAid8;MP`zaL:n?8;MP`8+HY:aI/'%8;MP`87d&CaCTVn8;MP`8=>KNa794e8;MP`8@J=g]KmN*8;MP`8AQ988+HY78;MP`8@J=g87d&@8;MP`8=>KM8=>KM8;MP`87d&A8@J=f8;MP`8+HY88AQ968;MP`z8=h8G8>cW;a3h^G8;)%78>cW;a@=FF84Ljp8>cW;aFnUa8'x-p8>cW;aIXhqz8>cW;aJT2la3h^F8>cW;aIXhpa@=FC8>cW;aFnU_aFnU^8>cW;a@=FBaIXhn8>cW;a3h^AaJT2i8>cW;zaIXhn8>cW;8'x-kaFnU^8>cW;84Ljja@=F@8>cW;8;)%2a3h^A8>cW;8=h8A]I*l/8>cW;8>cW<8'x-g8>cW;8=h8A84Ljg8>cW;8;)%18;)%18>cW;84Lji8=h8@8>cW;8'x-i8>cW;8>cW;z8:_aQ8AQ96a/f5)87d&J8AQ96a,;a/f5(8AQ96aFP=%a,88AQ96zaFP8EG*ka/f5)7xuYS8EG*ka794h7l?Et8EG*ka9['fz8EG*ka:L<8`x/vJ8EG*ka9['ea/f5'8EG*ka794fa794f8EG*ka/f5&a9['c8EG*k`x/vGa:L<58EG*kza9['c8EG*k7l?Eqa794e8EG*k7xuYOa/f5%8EG*k8+HY:`x/vG8EG*k8-jL7]8wuQ8EG*k8.[`^7l?Em8EG*k8-jL67xuYL8EG*k8+HY98+HY88EG*k7xuYM8-jL68EG*k7l?En8.[`]8EG*kz7uCHt8FG04`jc&P7rt'w8FG04`wC3.7kRWX8FG04a)dXM7^rJx8FG04a,4$Iz8FG04a-&.?`jc&N8FG04a,4$H`wC3,8FG04a)dXKa)dXJ8FG04`wC3*a,4$F8FG04`jc&Ka-&.=8FG04za,4$F8FG047^rJua)dXJ8FG047kRWS`wC3)8FG047rt's`jc&K8FG047uCHo]+QgX8FG047v5Re7^rJq8FG047uCHn7kRWQ8FG047rt'r7rt'r8FG047kRWR7uCHn8FG047^rJr7v5Rd8FG04zzaRT=dzzyz - nlist 382 1 b85VECTOR -8$sL?aR%6>`p]C(7vj/8aR%6>a($j&8,Oq4aQ$=Ea1Ba1j/2]ZEXpaQ$=Ea;iAh`p]BBaR%6?a0d'ta$guxaQ$=Da:rPna($inaR%6>a-Z`,a1B7dlgqa:rPoaQ$=C7mwEMa-Z_iaR%6?7q49%a8@LcaQ$=C8%Qa:a($iiaR%6@7vj/6a1B7dlgx8/,uEaQ$=A7mwE_8&$SXaR%6@5(Kln8/xfEaQ$=D4n,BY82U=faOAqMa8`53867kIaOAqLa+j;W8,oYWaOAqMa>En;7u$`;aOAqNaB(Fp]^u6:aOAqMaC>G8a+j;saOAqNaB(Fta8`55aOAqLa>En?a>En@aOAqMa8`51aB(FxaOAqMa+j;haC>G@aOAqK4Y^O1aB(G%aOAqK7u$`Fa>EnAaOAqK8,oY]a8`50aOAqL82U=ma+j;kaOAqJ867kP4J,])aOAqJ87Mkl7u$`FaOAqK867kM8,oY\aOAqK82U=k82U=jaOAqJ8,oYb867kOaOAqL7u$`@87MkgaOAqM4i*v)88;[taM-K^a%E_aJ@lva4+;Q84c;FaJ@luaG)&O8(:`VaJ@lsaIjv2]_U%E^]2IK3aJ@lr8>v_'8(:`caJ@lt8>%E]84c;QaJ@lq8;8K%8;8K$aJ@lq84c;K8>%E\aJ@lq8(:`W8>v_'aJ@lq5/=Vk8=HJ&aG,t^aCc,n8@V'DaG,t\a7@i]87rQ>aG,t]aI9%T8+P9HaG,t[aLFWk]hcZA7aG,tY8A]V-8+P9PaG,tY8@V'>87rQFaG,tY8=HJ'8=HJ)aG,tY87rQC8@V'@aG,tY8+P9K8A]V.aG,tY50&a>8?43^aB)a>aEWKc8B\)XaB)a?a8^5`89fp4aB)a@aK$d78,mZJaB)aDaNLZ)]Yd;iaB)aDaO]8ja8^6,aB)aDaNLZ'aEWKeaB)aCaK$d1aK$d5aB)aAaEWK_aNLZ(aB)aBa8^6$aO]8jaB)aG]SCosaNLZ'aB)aF8,mZOaK$d3aB)aD89fp8aEWKaaB)a@8?43_a8^6&aB)a>8B\)S4]4BYaB)a;8Cl]?8,mZTaB)a<8B\)S89fp6aB)a;8?43^8?43`aB)a<89fp78B\)TaB)a>8,mZP8Cl]AaB)a<52v)T8@LmMa:8ZwaFR128D3$9a:8Zwa9\x^8:aUXa:8[$aL=I&8-lHLa:8[&aOxT_]2EE>a:8[$aQ:iJa9]$-a:8ZxaOxT^aFR14a:8[%aL=HvaL=I&a:8[$aFR1/aOxT_a:8Zwa9]$&aQ:iJa:8[']Db/faOxT]a:8[&8-lHRaL=I$a:8Zp8:aU\aFR10a:8Zq8@LmPa9]$$a:8Zu8D3$44e9woa:8Zv8EJ8t8-lHUa:8Zx8D3$38:aU[a:8Zw8@LmN8@LmOa:8Zv8:aU[8D3$4a:8Zt8-lHP8EJ8wa:8Zq53XsU8A:e0a,fiLaG-dd8E,[,68EG*p\jrsaa:L;i8;MP]]I`mKaMAib8.[`S]I`mMaQ7[BzzaRT=da:L<;]I`mPaQ7[@aG>,:]H,4aQ7[A3_-C8a:L<2aRT=c\jrsa3leGaaQ7[?\xUx78.[`_aMAi_z8;MPbaG>,5]FmUA8AQ98a:L<.]LT0e8EG*kzz8Fcb88.[`^\jrsc8EG*k8;MPa\xUx<8AQ978AQ96\jrsc8;MP`8EG*kz8.[`_y3_-C453fkZ8A:e07uv8uaG-dd8E,[<7uv9&a:;,o8;=457uv9(aM+@]8.JQ\7uv9(aPr6cz7uv9$aR8OQa:;-?7uv9%aPr6`aG-dg7uv8waM+@WaM+@\7uv8taG-d`aPr6d7uv8ma:;-6aR8OR7uv8b4%`)+aPr6b7uv8a8.JQcaM+@Z7uv8j8;=49aG-db7uv8t8A:e0a:;-47uv8x8E,[74W=-`7uv9$8FGt&8.JQe7uv9$8E,[68;=487uv8v8A:e/8A:e07uv8w8;=488E,[97uv8t8.JQc8FGt&7uv8x53Dx68@LmM8.H*NaFR138D3$98.H*Na9\x^8:aUX8.H*OaL=I'8-lHL8.H*PaOxT_]2EE>8.H*OaQ:iJa9]$,8.H*NaOxT\aFR138.H*MaL=HvaL=I'8.H*MaFR1/aOxT_8.H*La9]$&aQ:iJ8.H*N]:)QhaOxT_8.H*L8-lHRaL=I$8.H*G8:aU\aFR108.H*F8@LmQa9]$$8.H*J8D3$44eYgJ8.H*K8EJ8t8-lHS8.H*M8D3$28:aU[8.H*M8@LmO8@LmO8.H*K8:aU[8D3$48.H*H8-lHP8EJ8w8.H*I52v;@8?43]8690laEWKc8B\)Y8690ka8^5`89fp48690laK$d68,mZL8690naNLZ*]Yd;i8690naO]8ja8^6+8690oaNLZ'aEWKe8690kaK$d1aK$d68690kaEWK_aNLZ*8690ma8^6&aO]8j8690m]OP%E^8>PPPPPPPPPPPPP%E^]2IK38>Pv_'8(:`c8>P%E]84c;N8>PP%E\8>Pv_(8>PEnF7u$`98CQ@vaB(Fs]`=mC8CQ@xaC>G6a+j;s8CQ@xaB(Foa8`548CQ@wa>En:a>En@8CQ@va8`5-aB(G$8CQ@wa+j;naC>G@8CQ@u4Y^O1aB(Fx8CQ@u7u$`Ua>En@8CQ@v8,oY]a8`518CQ@w82U=ia+j;l8CQ@t867kQ4I`qe8CQ@t87Mkp7u$`H8CQ@u867kP8,oY]8CQ@v82U=k82U=l8CQ@u8,oY`867kL8CQ@t7u$`F87Mkg8CQ@w4piDe8,Oq38E3ama1B=/8/,uC8E3ana$guO8%QaB8E3ala8@Lj7mwE<8E3aoa:rPi]ZEXp8E3aoa;iAaa$guw8E3aoa:rPfa1B0s7_[,H7uNfZ7_[,H8%v5I7_[,H8+HY87_[,H8.1k07_[,H80p((7_[,H83Y9u7_[,H86BKm7_[,H89+]d7_[,H8:Jf`7_[,H8;io\7_[,H8=3xX7_[,H8>S,T7_[,H8?r5P7_[,H8A<>L7_[,H8B[GH7_[,H8D%PD7_[,H8EDY@7_[,H8Fcb:7_[,Hz7m>0s7_[,H!7m>0s$$$$'7uNfZ7m>0s8%v5I7m>0s8+HY87m>0s8.1k07m>0s80p((7m>0s83Y9u7m>0s86BKm7m>0s89+]d7m>0s8:Jf`7m>0s8;io\7m>0s8=3xX7m>0s8>S,T7m>0s8?r5P7m>0s8A<>L7m>0s8B[GH7m>0s8D%PD7m>0s8EDY@7m>0s8Fcb:7m>0sz7uNfZ7_[,H7uNfZ7m>0s!7uNfZ$$$$'8%v5I7uNfZ8+HY87uNfZ8.1k07uNfZ80p((7uNfZ83Y9u7uNfZ86BKm7uNfZ89+]d7uNfZ8:Jf`7uNfZ8;io\7uNfZ8=3xX7uNfZ8>S,T7uNfZ8?r5P7uNfZ8A<>L7uNfZ8B[GH7uNfZ8D%PD7uNfZ8EDY@7uNfZ8Fcb:7uNfZz8%v5I7_[,H8%v5I7m>0s8%v5I7uNfZ!8%v5I$$$$'8+HY88%v5I8.1k08%v5I80p((8%v5I83Y9u8%v5I86BKm8%v5I89+]d8%v5I8:Jf`8%v5I8;io\8%v5I8=3xX8%v5I8>S,T8%v5I8?r5P8%v5I8A<>L8%v5I8B[GH8%v5I8D%PD8%v5I8EDY@8%v5I8Fcb:8%v5Iz8+HY87_[,H8+HY87m>0s8+HY87uNfZ8+HY88%v5I!8+HY8$$$$'8.1k08+HY880p((8+HY883Y9u8+HY886BKm8+HY889+]d8+HY88:Jf`8+HY88;io\8+HY88=3xX8+HY88>S,T8+HY88?r5P8+HY88A<>L8+HY88B[GH8+HY88D%PD8+HY88EDY@8+HY88Fcb:8+HY8z8.1k07_[,H8.1k07m>0s8.1k07uNfZ8.1k08%v5I8.1k08+HY8!8.1k0$$$$'80p((8.1k083Y9u8.1k086BKm8.1k089+]d8.1k08:Jf`8.1k08;io\8.1k08=3xX8.1k08>S,T8.1k08?r5P8.1k08A<>L8.1k08B[GH8.1k08D%PD8.1k08EDY@8.1k08Fcb:8.1k0z80p((7_[,H80p((7m>0s80p((7uNfZ80p((8%v5I80p((8+HY880p((8.1k0!80p(($$$$'83Y9u80p((86BKm80p((89+]d80p((8:Jf`80p((8;io\80p((8=3xX80p((8>S,T80p((8?r5P80p((8A<>L80p((8B[GH80p((8D%PD80p((8EDY@80p((8Fcb:80p((z83Y9u7_[,H83Y9u7m>0s83Y9u7uNfZ83Y9u8%v5I83Y9u8+HY883Y9u8.1k083Y9u80p((83Y9u83Y9u83Y9u86BKm83Y9u89+]d83Y9u8:Jf`83Y9u8;io\83Y9u8=3xX83Y9u8>S,T83Y9u8?r5P83Y9u8A<>L83Y9u8B[GH83Y9u8D%PD83Y9u8EDY@83Y9u8Fcb:83Y9uz86BKm7_[,H86BKm7m>0s86BKm7uNfZ86BKm8%v5I86BKm8+HY886BKm8.1k086BKm80p((86BKm83Y9u!86BKm$$$$'89+]d86BKm8:Jf`86BKm8;io\86BKm8=3xX86BKm8>S,T86BKm8?r5P86BKm8A<>L86BKm8B[GH86BKm8D%PD86BKm8EDY@86BKm8Fcb:86BKmz89+]d7_[,H89+]d7m>0s89+]d7uNfZ89+]d8%v5I89+]d8+HY889+]d8.1k089+]d80p((89+]d83Y9u89+]d86BKm!89+]d$$$$'8:Jf`89+]d8;io\89+]d8=3xX89+]d8>S,T89+]d8?r5P89+]d8A<>L89+]d8B[GH89+]d8D%PD89+]d8EDY@89+]d8Fcb:89+]dz8:Jf`7_[,H8:Jf`7m>0s8:Jf`7uNfZ8:Jf`8%v5I8:Jf`8+HY88:Jf`8.1k08:Jf`80p((8:Jf`83Y9u8:Jf`86BKm8:Jf`89+]d!8:Jf`$$$$'8;io\8:Jf`8=3xX8:Jf`8>S,T8:Jf`8?r5P8:Jf`8A<>L8:Jf`8B[GH8:Jf`8D%PD8:Jf`8EDY@8:Jf`8Fcb:8:Jf`z8;io\7_[,H8;io\7m>0s8;io\7uNfZ8;io\8%v5I8;io\8+HY88;io\8.1k08;io\80p((8;io\83Y9u8;io\86BKm8;io\89+]d8;io\8:Jf`!8;io\$$$$'8=3xX8;io\8>S,T8;io\8?r5P8;io\8A<>L8;io\8B[GH8;io\8D%PD8;io\8EDY@8;io\8Fcb:8;io\z8=3xX7_[,H8=3xX7m>0s8=3xX7uNfZ8=3xX8%v5I8=3xX8+HY88=3xX8.1k08=3xX80p((8=3xX83Y9u8=3xX86BKm8=3xX89+]d8=3xX8:Jf`8=3xX8;io\!8=3xX$$$$'8>S,T8=3xX8?r5P8=3xX8A<>L8=3xX8B[GH8=3xX8D%PD8=3xX8EDY@8=3xX8Fcb:8=3xXz8>S,T7_[,H8>S,T7m>0s8>S,T7uNfZ8>S,T8%v5I8>S,T8+HY88>S,T8.1k08>S,T80p((8>S,T83Y9u8>S,T86BKm8>S,T89+]d8>S,T8:Jf`8>S,T8;io\8>S,T8=3xX!8>S,T$$$$'8?r5P8>S,T8A<>L8>S,T8B[GH8>S,T8D%PD8>S,T8EDY@8>S,T8Fcb:8>S,Tz8?r5P7_[,H8?r5P7m>0s8?r5P7uNfZ8?r5P8%v5I8?r5P8+HY88?r5P8.1k08?r5P80p((8?r5P83Y9u8?r5P86BKm8?r5P89+]d8?r5P8:Jf`8?r5P8;io\8?r5P8=3xX8?r5P8>S,T!8?r5P$$$$'8A<>L8?r5P8B[GH8?r5P8D%PD8?r5P8EDY@8?r5P8Fcb:8?r5Pz8A<>L7_[,H8A<>L7m>0s8A<>L7uNfZ8A<>L8%v5I8A<>L8+HY88A<>L8.1k08A<>L80p((8A<>L83Y9u8A<>L86BKm8A<>L89+]d8A<>L8:Jf`8A<>L8;io\8A<>L8=3xX8A<>L8>S,T8A<>L8?r5P!8A<>L$$$$'8B[GH8A<>L8D%PD8A<>L8EDY@8A<>L8Fcb:8A<>Lz8B[GH7_[,H8B[GH7m>0s8B[GH7uNfZ8B[GH8%v5I8B[GH8+HY88B[GH8.1k08B[GH80p((8B[GH83Y9u8B[GH86BKm8B[GH89+]d8B[GH8:Jf`8B[GH8;io\8B[GH8=3xX8B[GH8>S,T8B[GH8?r5P8B[GH8A<>L!8B[GH$$$$'8D%PD8B[GH8EDY@8B[GH8Fcb:8B[GHz8D%PD7_[,H8D%PD7m>0s8D%PD7uNfZ8D%PD8%v5I8D%PD8+HY88D%PD8.1k08D%PD80p((8D%PD83Y9u8D%PD86BKm8D%PD89+]d8D%PD8:Jf`8D%PD8;io\8D%PD8=3xX8D%PD8>S,T8D%PD8?r5P8D%PD8A<>L8D%PD8B[GH!8D%PD$$$$'8EDY@8D%PD8Fcb:8D%PDz8EDY@7_[,H8EDY@7m>0s8EDY@7uNfZ8EDY@8%v5I8EDY@8+HY88EDY@8.1k08EDY@80p((8EDY@83Y9u8EDY@86BKm8EDY@89+]d8EDY@8:Jf`8EDY@8;io\8EDY@8=3xX8EDY@8>S,T8EDY@8?r5P8EDY@8A<>L8EDY@8B[GH8EDY@8D%PD!8EDY@$$$$'8Fcb:8EDY@7Qx'rz7gkb/z7reTbz7x7xRz8(_GAz8,gb4z8/Pt,z82:0xz84xBpz87aThz89eb6z8;/k2z8 Date: Wed, 21 Jun 2023 16:42:52 +0800 Subject: [PATCH 201/207] toke's comment --- .../publish/collect_arnold_scene_source.py | 49 +++++-------------- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py index 1b8ec27509..d93811c23e 100644 --- a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py @@ -18,49 +18,24 @@ class CollectArnoldSceneSource(pyblish.api.InstancePlugin): for objset in objsets: objset = str(objset) members = cmds.sets(objset, query=True) + members = cmds.ls(members, long=True) if members is None: self.log.warning("Skipped empty instance: \"%s\" " % objset) continue if objset.endswith("content_SET"): - members = cmds.ls(members, long=True) - members_list = [] - for member in members: - shape = cmds.listRelatives( - member, shapes=True, fullPath=True) - if not shape: - continue - members_list = members + shape - group_name = "|{}".format(member) - if group_name in members_list: - members_list.remove(group_name) - children = get_all_children(members) - - if members_list: - children.extend(members_list) - instance.data["contentMembers"] = children - self.log.debug("content members: {}".format(children)) - + instance.data["contentMembers"] = children + members + self.log.debug( + "content members: {}".format( + instance.data["contentMembers"] + ) + ) elif objset.endswith("proxy_SET"): - proxy_members = cmds.ls(members, long=True) - proxy_list = [] - for proxy in proxy_members: - shape = cmds.listRelatives( - proxy, shapes=True, fullPath=True) - if not shape: - continue - proxy_list = proxy_members + shape - group_name = "|{}".format(proxy) - if group_name in proxy_list: - proxy_list.remove(group_name) - - set_members = get_all_children(proxy_members) - if proxy_list: - set_members.extend(proxy_list) - - instance.data["proxy"] = set_members - self.log.debug("proxy members: {}".format(set_members)) - + children = get_all_children(cmds.ls(members, long=True)) + instance.data["proxy"] = children + members + self.log.debug( + "proxy members: {}".format(instance.data["proxy"]) + ) # Use camera in object set if present else default to render globals # camera. From 1c2955a90aa027b0611197ddaa741dcceb2eaca7 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 21 Jun 2023 16:50:08 +0800 Subject: [PATCH 202/207] remove docstring --- .../maya/plugins/publish/extract_arnold_scene_source.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py index 8696f5a94b..102f0e46a2 100644 --- a/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/extract_arnold_scene_source.py @@ -69,8 +69,7 @@ class ExtractArnoldSceneSource(publish.Extractor): "camera": instance.data["camera"], "mask": mask } - # TODO: dont use instance.data["contentMembers"] - # but use the new instance.data["contentMemberTransforms"] + filenames, nodes_by_id = self._extract( instance.data["contentMembers"], attribute_data, kwargs ) @@ -110,8 +109,7 @@ class ExtractArnoldSceneSource(publish.Extractor): return kwargs["filename"] = file_path.replace(".ass", "_proxy.ass") - # TODO: dont use instance.data["proxy"] - # but use the new instance.data["proxyTransforms"] + filenames, _ = self._extract( instance.data["proxy"], attribute_data, kwargs ) From 29c8cfe99236faf3a0723e7b064c34226d19c925 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 21 Jun 2023 18:48:25 +0800 Subject: [PATCH 203/207] roy's comment --- .../publish/collect_arnold_scene_source.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py index d93811c23e..69a07b4aaf 100644 --- a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py @@ -23,19 +23,9 @@ class CollectArnoldSceneSource(pyblish.api.InstancePlugin): self.log.warning("Skipped empty instance: \"%s\" " % objset) continue if objset.endswith("content_SET"): - children = get_all_children(members) - instance.data["contentMembers"] = children + members - self.log.debug( - "content members: {}".format( - instance.data["contentMembers"] - ) - ) - elif objset.endswith("proxy_SET"): - children = get_all_children(cmds.ls(members, long=True)) - instance.data["proxy"] = children + members - self.log.debug( - "proxy members: {}".format(instance.data["proxy"]) - ) + instance.data["contentMembers"] = self.get_hierarchy(members) + if objset.endswith("content_SET"): + instance.data["proxy"] = self.get_hierarchy(members) # Use camera in object set if present else default to render globals # camera. @@ -54,3 +44,13 @@ class CollectArnoldSceneSource(pyblish.api.InstancePlugin): self.log.debug("No renderable cameras found.") self.log.debug("data: {}".format(instance.data)) + + def get_hierarchy(self, nodes): + """Return nodes with all their children""" + nodes = cmds.ls(nodes, long=True) + if not nodes: + return [] + children = get_all_children(nodes) + # Make sure nodes merged with children only + # contains unique entries + return list(set(nodes + children)) From 223a3338f3b5a02daf3b7172ab3161a3b95414c4 Mon Sep 17 00:00:00 2001 From: Kayla Man <64118225+moonyuet@users.noreply.github.com> Date: Wed, 21 Jun 2023 19:25:47 +0800 Subject: [PATCH 204/207] Update openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py Co-authored-by: Toke Jepsen --- .../hosts/maya/plugins/publish/collect_arnold_scene_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py index 69a07b4aaf..90079c715a 100644 --- a/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py +++ b/openpype/hosts/maya/plugins/publish/collect_arnold_scene_source.py @@ -24,7 +24,7 @@ class CollectArnoldSceneSource(pyblish.api.InstancePlugin): continue if objset.endswith("content_SET"): instance.data["contentMembers"] = self.get_hierarchy(members) - if objset.endswith("content_SET"): + if objset.endswith("proxy_SET"): instance.data["proxy"] = self.get_hierarchy(members) # Use camera in object set if present else default to render globals From 2d1fc8e72857a63510fb9e6e27fe2ddea85527e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Wed, 21 Jun 2023 14:09:29 +0200 Subject: [PATCH 205/207] Update openpype/pipeline/colorspace.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 13846e9f5c..269825f85f 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -375,7 +375,7 @@ def get_imageio_config( # This is for backward compatibility. # TODO: in future rewrite this to be more explicit activate_host_color_management = imageio_host.get( - "activate_host_color_management", True) + "activate_host_color_management") # TODO: remove this in future - backward compatibility if activate_host_color_management is None: From 39d2159ed462e3e84236ba4497277d2a7f65016a Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Thu, 22 Jun 2023 10:57:23 +0100 Subject: [PATCH 206/207] Blender: Add support for custom path for app templates (#5137) * Add support for custom path for app templates * Use same env variable as scripts and assure correct path exist --- openpype/hosts/blender/api/lib.py | 21 +++++++++++++++++++++ openpype/hosts/blender/api/pipeline.py | 1 + 2 files changed, 22 insertions(+) diff --git a/openpype/hosts/blender/api/lib.py b/openpype/hosts/blender/api/lib.py index 6526f1fb87..9bb560c364 100644 --- a/openpype/hosts/blender/api/lib.py +++ b/openpype/hosts/blender/api/lib.py @@ -134,6 +134,27 @@ def append_user_scripts(): traceback.print_exc() +def set_app_templates_path(): + # Blender requires the app templates to be in `BLENDER_USER_SCRIPTS`. + # After running Blender, we set that variable to our custom path, so + # that the user can use their custom app templates. + + # We look among the scripts paths for one of the paths that contains + # the app templates. The path must contain the subfolder + # `startup/bl_app_templates_user`. + paths = os.environ.get("OPENPYPE_BLENDER_USER_SCRIPTS").split(os.pathsep) + + app_templates_path = None + for path in paths: + if os.path.isdir( + os.path.join(path, "startup", "bl_app_templates_user")): + app_templates_path = path + break + + if app_templates_path and os.path.isdir(app_templates_path): + os.environ["BLENDER_USER_SCRIPTS"] = app_templates_path + + def imprint(node: bpy.types.bpy_struct_meta_idprop, data: Dict): r"""Write `data` to `node` as userDefined attributes diff --git a/openpype/hosts/blender/api/pipeline.py b/openpype/hosts/blender/api/pipeline.py index 9cc557c01a..0f756d8cb6 100644 --- a/openpype/hosts/blender/api/pipeline.py +++ b/openpype/hosts/blender/api/pipeline.py @@ -60,6 +60,7 @@ def install(): register_creator_plugin_path(str(CREATE_PATH)) lib.append_user_scripts() + lib.set_app_templates_path() register_event_callback("new", on_new) register_event_callback("open", on_open) From 97f3bdf5ec7483932ba4550bfab7c4a75795a831 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 22 Jun 2023 12:02:23 +0200 Subject: [PATCH 207/207] Color Management- added color management support for simple expected files on Deadline (#5122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * OP-5864 - added color management support for simple expected files Previously implemented only for AOVs. * OP-5864 - fix colorspace query colorspace might be not on instance.data * OP-5864 - refactore name to more descriptive one It is actually instance.data, not proper `instance`. --------- Co-authored-by: Jakub Ježek --- .../plugins/publish/submit_publish_job.py | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index 590acf86c2..69e9fb6449 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -21,6 +21,7 @@ from openpype.pipeline import ( from openpype.tests.lib import is_in_tests from openpype.pipeline.farm.patterning import match_aov_pattern from openpype.lib import is_running_from_build +from openpype.pipeline import publish def get_resources(project_name, version, extension=None): @@ -79,7 +80,8 @@ def get_resource_files(resources, frame_range=None): return list(res_collection) -class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): +class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, + publish.ColormanagedPyblishPluginMixin): """Process Job submitted on farm. These jobs are dependent on a deadline or muster job @@ -598,7 +600,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): self.log.debug("instances:{}".format(instances)) return instances - def _get_representations(self, instance, exp_files, do_not_add_review): + def _get_representations(self, instance_data, exp_files, + do_not_add_review): """Create representations for file sequences. This will return representations of expected files if they are not @@ -606,7 +609,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): most cases, but if not - we create representation from each of them. Arguments: - instance (dict): instance data for which we are + instance_data (dict): instance.data for which we are setting representations exp_files (list): list of expected files do_not_add_review (bool): explicitly skip review @@ -628,9 +631,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): # expected files contains more explicitly and from what # should be review made. # - "review" tag is never added when is set to 'False' - if instance["useSequenceForReview"]: + if instance_data["useSequenceForReview"]: # toggle preview on if multipart is on - if instance.get("multipartExr", False): + if instance_data.get("multipartExr", False): self.log.debug( "Adding preview tag because its multipartExr" ) @@ -655,8 +658,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): " This may cause issues on farm." ).format(staging)) - frame_start = int(instance.get("frameStartHandle")) - if instance.get("slate"): + frame_start = int(instance_data.get("frameStartHandle")) + if instance_data.get("slate"): frame_start -= 1 preview = preview and not do_not_add_review @@ -665,10 +668,10 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "ext": ext, "files": [os.path.basename(f) for f in list(collection)], "frameStart": frame_start, - "frameEnd": int(instance.get("frameEndHandle")), + "frameEnd": int(instance_data.get("frameEndHandle")), # If expectedFile are absolute, we need only filenames "stagingDir": staging, - "fps": instance.get("fps"), + "fps": instance_data.get("fps"), "tags": ["review"] if preview else [], } @@ -676,17 +679,17 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): if ext in self.skip_integration_repre_list: rep["tags"].append("delete") - if instance.get("multipartExr", False): + if instance_data.get("multipartExr", False): rep["tags"].append("multipartExr") # support conversion from tiled to scanline - if instance.get("convertToScanline"): + if instance_data.get("convertToScanline"): self.log.info("Adding scanline conversion.") rep["tags"].append("toScanline") representations.append(rep) - self._solve_families(instance, preview) + self._solve_families(instance_data, preview) # add remainders as representations for remainder in remainders: @@ -717,13 +720,13 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): preview = preview and not do_not_add_review if preview: rep.update({ - "fps": instance.get("fps"), + "fps": instance_data.get("fps"), "tags": ["review"] }) - self._solve_families(instance, preview) + self._solve_families(instance_data, preview) already_there = False - for repre in instance.get("representations", []): + for repre in instance_data.get("representations", []): # might be added explicitly before by publish_on_farm already_there = repre.get("files") == rep["files"] if already_there: @@ -733,6 +736,13 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): if not already_there: representations.append(rep) + for rep in representations: + # inject colorspace data + self.set_representation_colorspace( + rep, self.context, + colorspace=instance_data["colorspace"] + ) + return representations def _solve_families(self, instance, preview=False): @@ -861,7 +871,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "jobBatchName": data.get("jobBatchName", ""), "useSequenceForReview": data.get("useSequenceForReview", True), # map inputVersions `ObjectId` -> `str` so json supports it - "inputVersions": list(map(str, data.get("inputVersions", []))) + "inputVersions": list(map(str, data.get("inputVersions", []))), + "colorspace": instance.data.get("colorspace") } # skip locking version if we are creating v01