From e9afd17b296677b1558b83469cdf68cd3cf4e555 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 6 May 2022 10:02:20 +0200 Subject: [PATCH 01/64] converted event to be able create multiple independent event systems --- openpype/lib/events.py | 76 +++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/openpype/lib/events.py b/openpype/lib/events.py index 7bec6ee30d..3762cec9f9 100644 --- a/openpype/lib/events.py +++ b/openpype/lib/events.py @@ -11,6 +11,10 @@ except Exception: from openpype.lib.python_2_comp import WeakMethod +class MissingEventSystem(Exception): + pass + + class EventCallback(object): """Callback registered to a topic. @@ -179,13 +183,14 @@ class Event(object): """ _data = {} - def __init__(self, topic, data=None, source=None): + def __init__(self, topic, data=None, source=None, event_system=None): self._id = str(uuid4()) self._topic = topic if data is None: data = {} self._data = data self._source = source + self._event_system = event_system def __getitem__(self, key): return self._data[key] @@ -211,28 +216,69 @@ class Event(object): def emit(self): """Emit event and trigger callbacks.""" - StoredCallbacks.emit_event(self) + if self._event_system is None: + raise MissingEventSystem( + "Can't emit event {}. Does not have set event system.".format( + str(repr(self)) + ) + ) + self._event_system.emit_event(self) -class StoredCallbacks: - _registered_callbacks = [] +class EventSystem(object): + def __init__(self): + self._registered_callbacks = [] - @classmethod - def add_callback(cls, topic, callback): + def add_callback(self, topic, callback): callback = EventCallback(topic, callback) - cls._registered_callbacks.append(callback) + self._registered_callbacks.append(callback) return callback - @classmethod - def emit_event(cls, event): + def create_event(self, topic, data, source): + return Event(topic, data, source, self) + + def emit(self, topic, data, source): + event = self.create_event(topic, data, source) + event.emit() + return event + + def emit_event(self, event): invalid_callbacks = [] - for callback in cls._registered_callbacks: + for callback in self._registered_callbacks: callback.process_event(event) if not callback.is_ref_valid: invalid_callbacks.append(callback) for callback in invalid_callbacks: - cls._registered_callbacks.remove(callback) + self._registered_callbacks.remove(callback) + + +class GlobalEvent(Event): + def __init__(self, topic, data=None, source=None): + event_system = GlobalEventSystem.get_global_event_system() + + super(GlobalEvent, self).__init__(topic, data, source, event_system) + + +class GlobalEventSystem: + _global_event_system = None + + @classmethod + def get_global_event_system(cls): + if cls._global_event_system is None: + cls._global_event_system = EventSystem() + return cls._global_event_system + + @classmethod + def add_callback(cls, topic, callback): + event_system = cls.get_global_event_system() + return event_system.add_callback(topic, callback) + + @classmethod + def emit(cls, topic, data, source): + event = GlobalEvent(topic, data, source) + event.emit() + return event def register_event_callback(topic, callback): @@ -249,7 +295,8 @@ def register_event_callback(topic, callback): enable/disable listening to a topic or remove the callback from the topic completely. """ - return StoredCallbacks.add_callback(topic, callback) + + return GlobalEventSystem.add_callback(topic, callback) def emit_event(topic, data=None, source=None): @@ -263,6 +310,5 @@ def emit_event(topic, data=None, source=None): Returns: Event: Object of event that was emitted. """ - event = Event(topic, data, source) - event.emit() - return event + + return GlobalEventSystem.emit(topic, data, source) From 569d7c98fc7eaed14bb20ea86c5ea78c1d2941d2 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 21 Jun 2022 16:06:53 +0300 Subject: [PATCH 02/64] Add hardware fog keys to Schema --- .../schemas/schema_maya_capture.json | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index d6b81c8687..a5e1cb45d9 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -224,6 +224,42 @@ "key": "twoSidedLighting", "label": "Two Sided Lighting" }, + { + "type": "splitter" + }, + { + "type": "boolean", + "key": "hwFogEnable", + "label": "Enable Hardware Fog" + }, + { + "type": "number", + "key": "hwFogStart", + "label": "Hardware Fog Start" + }, + { + "type": "number", + "key": "hwFogEnd", + "label": "Hardware Fog End" + }, + { + "type": "number", + "key": "hwFogAlpha", + "label": "Hardware Fog Alpha" + }, + { + "type": "number", + "key": "hwFogFalloff", + "label": "Hardware Fog Falloff" + }, + { + "type": "number", + "key": "hwFogDensity", + "label": "Hardware Fog Density" + }, + { + "type": "splitter" + }, { "type": "boolean", "key": "ssaoEnable", From cb6e093ee33be1aa9af97dca37e07cad7387b4af Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 21 Jun 2022 16:25:11 +0300 Subject: [PATCH 03/64] Add SSAO options to schema --- .../schemas/schema_maya_capture.json | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index a5e1cb45d9..919c847a9b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -227,6 +227,34 @@ { "type": "splitter" }, + { + "type": "boolean", + "key": "ssaoEnable", + "label": "Screen Space Ambient Occlusion" + }, + { + "type": "number", + "key": "ssaoAmount", + "label": "SSAO Amount" + }, + { + "type": "number", + "key": "ssaoFilterRadius", + "label": "SSAO Filter Radius" + }, + { + "type": "number", + "key": "ssaoRadius", + "label": "SSAO Radius" + }, + { + "type": "number", + "key": "ssaoSamples", + "label": "SSAO Samples" + }, + { + "type": "splitter" + }, { "type": "boolean", "key": "hwFogEnable", @@ -262,8 +290,18 @@ }, { "type": "boolean", - "key": "ssaoEnable", - "label": "Screen Space Ambient Occlusion" + "key": "motionBlurEnable", + "label": "Enable Motion Blur" + }, + { + "type": "number", + "key": "motionBlurShutterOpenFraction", + "label": "Shutter Open Fraction" + }, + { + "type": "number", + "key": "hwFogFalloff", + "label": "Hardware Fog Falloff" }, { "type": "splitter" From 697916c3cdba015b68f0376902422606ac27f9fe Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 21 Jun 2022 17:03:10 +0300 Subject: [PATCH 04/64] Append enum for fog falloff. --- .../schemas/schema_maya_capture.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 919c847a9b..caf001f7e1 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -260,6 +260,16 @@ "key": "hwFogEnable", "label": "Enable Hardware Fog" }, + { + "type": "enum", + "key": "hwFogFalloff", + "label": "Hardware Fog Falloff", + "enum_items": [ + { "0": "Linear"}, + { "1": "Exponential"}, + { "2": "Exponential Squared"} + ] + }, { "type": "number", "key": "hwFogStart", @@ -275,11 +285,6 @@ "key": "hwFogAlpha", "label": "Hardware Fog Alpha" }, - { - "type": "number", - "key": "hwFogFalloff", - "label": "Hardware Fog Falloff" - }, { "type": "number", "key": "hwFogDensity", @@ -298,11 +303,6 @@ "key": "motionBlurShutterOpenFraction", "label": "Shutter Open Fraction" }, - { - "type": "number", - "key": "hwFogFalloff", - "label": "Hardware Fog Falloff" - }, { "type": "splitter" }, From ed0ba7e3ab306f1674def5f7cc69666cb96e8dc6 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 21 Jun 2022 17:39:46 +0300 Subject: [PATCH 05/64] Append Antialiasing and MotionBlur Sampling --- .../schemas/schema_maya_capture.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index caf001f7e1..fa5be19cda 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -201,6 +201,14 @@ "label": "Texture Clamp Resolution", "decimal": 0 }, + { + "type": "splitter" + }, + { + "type": "boolean", + "key": "lineAAEnable", + "label": "Smooth Wireframe" + }, { "type": "number", "key": "multiSample", @@ -209,6 +217,9 @@ "minimum": 0, "maximum": 32 }, + { + "type": "splitter" + }, { "type": "boolean", "key": "shadows", @@ -303,6 +314,11 @@ "key": "motionBlurShutterOpenFraction", "label": "Shutter Open Fraction" }, + { + "type": "number", + "key": "motionBlurSampleCount", + "label": "Sample Count" + }, { "type": "splitter" }, From de6bd72c2ed1ef40b3cecfa4a7caed9cf93937ea Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 21 Jun 2022 18:01:49 +0300 Subject: [PATCH 06/64] Appen defaults. --- .../settings/defaults/project_settings/maya.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 69fbf5bfdf..6780921001 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -491,11 +491,25 @@ "override_viewport_options": true, "displayLights": "default", "textureMaxResolution": 1024, + "lineAAEnable": true, "multiSample": 4, "shadows": true, "textures": true, "twoSidedLighting": true, "ssaoEnable": true, + "ssaoAmount": 0, + "ssaoFilterRadius": 0, + "ssaoRadius": 0, + "ssaoSamples": 0, + "hwFogEnable": true, + "hwFogFalloff": "0", + "hwFogStart": 0, + "hwFogEnd": 0, + "hwFogAlpha": 0, + "hwFogDensity": 0, + "motionBlurEnable": true, + "motionBlurShutterOpenFraction": 0, + "motionBlurSampleCount": 0, "cameras": false, "clipGhosts": false, "controlVertices": false, From 269c752bfc9ff109b8a75e57b3f78349d7bf1b75 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 21 Jun 2022 18:01:49 +0300 Subject: [PATCH 07/64] Append settings defaults. --- .../settings/defaults/project_settings/maya.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 69fbf5bfdf..6780921001 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -491,11 +491,25 @@ "override_viewport_options": true, "displayLights": "default", "textureMaxResolution": 1024, + "lineAAEnable": true, "multiSample": 4, "shadows": true, "textures": true, "twoSidedLighting": true, "ssaoEnable": true, + "ssaoAmount": 0, + "ssaoFilterRadius": 0, + "ssaoRadius": 0, + "ssaoSamples": 0, + "hwFogEnable": true, + "hwFogFalloff": "0", + "hwFogStart": 0, + "hwFogEnd": 0, + "hwFogAlpha": 0, + "hwFogDensity": 0, + "motionBlurEnable": true, + "motionBlurShutterOpenFraction": 0, + "motionBlurSampleCount": 0, "cameras": false, "clipGhosts": false, "controlVertices": false, From 759cea424c30b06960fc7a247055b96c58ab0eea Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 22 Jun 2022 10:45:14 +0300 Subject: [PATCH 08/64] Start separating "lineAAEnable" --- openpype/vendor/python/common/capture.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openpype/vendor/python/common/capture.py b/openpype/vendor/python/common/capture.py index 6b4c40a6e8..ae3a0d5cc1 100644 --- a/openpype/vendor/python/common/capture.py +++ b/openpype/vendor/python/common/capture.py @@ -361,7 +361,6 @@ Viewport2Options = { "floatingPointRTFormat": 1, "gammaCorrectionEnable": False, "gammaValue": 2.2, - "lineAAEnable": False, "maxHardwareLights": 8, "motionBlurEnable": False, "motionBlurSampleCount": 8, @@ -383,6 +382,10 @@ Viewport2Options = { "vertexAnimationCache": 0 } +Viewport2OAAoption = { + "lineAAenable": False, +} + def apply_view(panel, **options): """Apply options to panel""" @@ -496,6 +499,13 @@ def parse_view(panel): except ValueError: continue + for key in Viewport2OAAoption.keys(): + attr = "hardwareRenderingGlobals.{0}".format(key) + try: + viewport2_options[key] = cmds.getAttr(attr) + except ValueError: + continue + return { "camera": camera, "display_options": display_options, From 277682c03dcdbed093905188def33545f8a9b24a Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 22 Jun 2022 10:56:49 +0300 Subject: [PATCH 09/64] Revert "Start separating "lineAAEnable"" This reverts commit 759cea424c30b06960fc7a247055b96c58ab0eea. --- openpype/vendor/python/common/capture.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/openpype/vendor/python/common/capture.py b/openpype/vendor/python/common/capture.py index ae3a0d5cc1..6b4c40a6e8 100644 --- a/openpype/vendor/python/common/capture.py +++ b/openpype/vendor/python/common/capture.py @@ -361,6 +361,7 @@ Viewport2Options = { "floatingPointRTFormat": 1, "gammaCorrectionEnable": False, "gammaValue": 2.2, + "lineAAEnable": False, "maxHardwareLights": 8, "motionBlurEnable": False, "motionBlurSampleCount": 8, @@ -382,10 +383,6 @@ Viewport2Options = { "vertexAnimationCache": 0 } -Viewport2OAAoption = { - "lineAAenable": False, -} - def apply_view(panel, **options): """Apply options to panel""" @@ -499,13 +496,6 @@ def parse_view(panel): except ValueError: continue - for key in Viewport2OAAoption.keys(): - attr = "hardwareRenderingGlobals.{0}".format(key) - try: - viewport2_options[key] = cmds.getAttr(attr) - except ValueError: - continue - return { "camera": camera, "display_options": display_options, From f43042eb169ad9214ad01511a3c4dee5fe469083 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 22 Jun 2022 15:12:40 +0300 Subject: [PATCH 10/64] Change hwFogEnable into fogging flag. --- .../projects_schema/schemas/schema_maya_capture.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index fa5be19cda..217aa947fc 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -268,7 +268,7 @@ }, { "type": "boolean", - "key": "hwFogEnable", + "key": "fogging", "label": "Enable Hardware Fog" }, { @@ -304,21 +304,11 @@ { "type": "splitter" }, - { - "type": "boolean", - "key": "motionBlurEnable", - "label": "Enable Motion Blur" - }, { "type": "number", "key": "motionBlurShutterOpenFraction", "label": "Shutter Open Fraction" }, - { - "type": "number", - "key": "motionBlurSampleCount", - "label": "Sample Count" - }, { "type": "splitter" }, From 38522154e78c22cd0037dbbe91c2ea1f820b057c Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 22 Jun 2022 16:45:51 +0300 Subject: [PATCH 11/64] Remove flags --- .../defaults/project_settings/maya.json | 9 +------ .../schemas/schema_maya_capture.json | 25 ------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 0f40651c35..f9201286ab 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -496,25 +496,18 @@ "override_viewport_options": true, "displayLights": "default", "textureMaxResolution": 1024, - "lineAAEnable": true, "multiSample": 4, "shadows": true, "textures": true, "twoSidedLighting": true, "ssaoEnable": true, - "ssaoAmount": 0, "ssaoFilterRadius": 0, - "ssaoRadius": 0, "ssaoSamples": 0, - "hwFogEnable": true, + "fogging": true, "hwFogFalloff": "0", "hwFogStart": 0, "hwFogEnd": 0, "hwFogAlpha": 0, - "hwFogDensity": 0, - "motionBlurEnable": true, - "motionBlurShutterOpenFraction": 0, - "motionBlurSampleCount": 0, "cameras": false, "clipGhosts": false, "controlVertices": false, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 217aa947fc..c7842e5031 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -204,11 +204,6 @@ { "type": "splitter" }, - { - "type": "boolean", - "key": "lineAAEnable", - "label": "Smooth Wireframe" - }, { "type": "number", "key": "multiSample", @@ -243,21 +238,11 @@ "key": "ssaoEnable", "label": "Screen Space Ambient Occlusion" }, - { - "type": "number", - "key": "ssaoAmount", - "label": "SSAO Amount" - }, { "type": "number", "key": "ssaoFilterRadius", "label": "SSAO Filter Radius" }, - { - "type": "number", - "key": "ssaoRadius", - "label": "SSAO Radius" - }, { "type": "number", "key": "ssaoSamples", @@ -296,19 +281,9 @@ "key": "hwFogAlpha", "label": "Hardware Fog Alpha" }, - { - "type": "number", - "key": "hwFogDensity", - "label": "Hardware Fog Density" - }, { "type": "splitter" }, - { - "type": "number", - "key": "motionBlurShutterOpenFraction", - "label": "Shutter Open Fraction" - }, { "type": "splitter" }, From 137ef3e22bbe9495e69a4379c3f85f367f3b4a7d Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 22 Jun 2022 17:35:51 +0300 Subject: [PATCH 12/64] Remove keys that fail. --- .../defaults/project_settings/maya.json | 6 --- .../schemas/schema_maya_capture.json | 38 ------------------- 2 files changed, 44 deletions(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index f9201286ab..8494989556 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -501,13 +501,7 @@ "textures": true, "twoSidedLighting": true, "ssaoEnable": true, - "ssaoFilterRadius": 0, - "ssaoSamples": 0, "fogging": true, - "hwFogFalloff": "0", - "hwFogStart": 0, - "hwFogEnd": 0, - "hwFogAlpha": 0, "cameras": false, "clipGhosts": false, "controlVertices": false, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index c7842e5031..ace9fc22da 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -238,16 +238,6 @@ "key": "ssaoEnable", "label": "Screen Space Ambient Occlusion" }, - { - "type": "number", - "key": "ssaoFilterRadius", - "label": "SSAO Filter Radius" - }, - { - "type": "number", - "key": "ssaoSamples", - "label": "SSAO Samples" - }, { "type": "splitter" }, @@ -256,34 +246,6 @@ "key": "fogging", "label": "Enable Hardware Fog" }, - { - "type": "enum", - "key": "hwFogFalloff", - "label": "Hardware Fog Falloff", - "enum_items": [ - { "0": "Linear"}, - { "1": "Exponential"}, - { "2": "Exponential Squared"} - ] - }, - { - "type": "number", - "key": "hwFogStart", - "label": "Hardware Fog Start" - }, - { - "type": "number", - "key": "hwFogEnd", - "label": "Hardware Fog End" - }, - { - "type": "number", - "key": "hwFogAlpha", - "label": "Hardware Fog Alpha" - }, - { - "type": "splitter" - }, { "type": "splitter" }, From 5b037244fe4e43c7a738e9fe2ace5c6f1883e72e Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 11:36:22 +0300 Subject: [PATCH 13/64] Append capture schema. --- .../schemas/schema_maya_capture.json | 71 ++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index ace9fc22da..f8dba0be4b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -238,14 +238,83 @@ "key": "ssaoEnable", "label": "Screen Space Ambient Occlusion" }, + { + "type": "number", + "key": "ssaoAmount", + "label": "SSAO Amount" + }, + { + "type": "number", + "key": "ssaoRadius", + "label": "SSAO Radius" + }, + { + "type": "number", + "key": "ssaoFilterRadius", + "label": "SSAO Filter Radius" + }, + { + "type": "number", + "key": "ssaoSamples", + "label": "SSAO Samples", + "decimal": 0, + "minimum": 8, + "maximum": 32 + }, { "type": "splitter" }, { "type": "boolean", - "key": "fogging", + "key": "hwFogEnable", "label": "Enable Hardware Fog" }, + { + "type": "enum", + "key": "hwFogFalloff", + "label": "Hardware Falloff", + "enum_items": [ + { "0": "Linear"}, + { "1": "Exponential"}, + { "2": "Exponential Squared"} + ] + }, + { + "type": "number", + "key": "hwFogStart", + "label": "Fog Start" + }, + { + "type": "number", + "key": "hwFogEnd", + "label": "Fog End" + }, + { + "type": "number", + "key": "hwFogAlpha", + "label": "Enable Fog Alpha" + }, + { + "type": "splitter" + }, + { + "type": "boolean", + "key": "motionBlurEnable", + "label": "Enable Motion Blur" + }, + { + "type": "number", + "key": "motionBlurSampleCount", + "label": "Motion Blur Sample Count", + "decimal": 0, + "minimum": 8, + "maximum": 32 + }, + { + "type": "number", + "key": "motionBlurShutterOpenFraction", + "label": "Shutter Open Fraction" + }, { "type": "splitter" }, From 4a521ec081e22b226655f49a41a38dbe31ef8f49 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 11:39:23 +0300 Subject: [PATCH 14/64] Adjust --- .../settings/defaults/project_settings/maya.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 8494989556..437adbc1f0 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -501,7 +501,18 @@ "textures": true, "twoSidedLighting": true, "ssaoEnable": true, - "fogging": true, + "ssaoAmount": 0, + "ssaoRadius": 0, + "ssaoFilterRadius": 0, + "ssaoSamples": 8, + "hwFogEnable": true, + "hwFogFalloff": "0", + "hwFogStart": 0, + "hwFogEnd": 0, + "hwFogAlpha": 0, + "motionBlurEnable": true, + "motionBlurSampleCount": 8, + "motionBlurShutterOpenFraction": 0, "cameras": false, "clipGhosts": false, "controlVertices": false, From ea6b098bb2f86d027815e8e685ff5932a85fcc73 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 11:40:01 +0300 Subject: [PATCH 15/64] Adjust `load_capture_preset()` to work with additional settings. --- openpype/hosts/maya/api/lib.py | 62 +++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index de9a9da911..bd403ad340 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2525,8 +2525,19 @@ def load_capture_preset(data=None): if key == 'ssaoEnable': if preset[id][key] is True: temp_options2['ssaoEnable'] = True + temp_options2['ssaoSamples'] = preset[id][key] else: temp_options2['ssaoEnable'] = False + temp_options2['ssaoSamples'] = preset[id][key] + + if key == 'ssaoAmount': + temp_options2['ssaoAmount'] = preset[id][key] + + if key == 'ssaoRadius': + temp_options2['ssaoRadius'] = preset[id][key] + + if key == 'ssaoFilterRadius': + temp_options2['ssaoFilterRadius'] = preset[id][key] if key == 'alphaCut': temp_options2['transparencyAlgorithm'] = 5 @@ -2535,6 +2546,42 @@ def load_capture_preset(data=None): if key == 'headsUpDisplay': temp_options['headsUpDisplay'] = True + if key == 'hwFogEnable': + if preset[id][key] is True: + temp_options2['hwFogEnable'] = True + else: + temp_options2['hwFogEnable'] = False + + if key == 'hwFogStart': + temp_options2['hwFogStart'] = preset[id][key] + + if key == 'hwFogEnd': + temp_options2['hwFogEnd'] = preset[id][key] + + if key == 'hwFogAlpha': + temp_options2['hwFogAlpha'] = preset[id][key] + + if key == 'hwFogFalloff': + temp_options2['hwFogFalloff'] = preset[id][key] + + if key == 'motionBlurEnable': + if preset[id][key] is True: + temp_options2['motionBlurEnable'] = True + else: + temp_options2['motionBlurEnable'] = False + + if key == 'motionBlurSampleCount': + temp_options2['motionBlurSampleCount'] = preset[id][key] + + if key == 'motionBlurShutterOpenFraction': + temp_options2['motionBlurShutterOpenFraction'] = preset[id][key] + + if key == 'lineAAEnable': + if preset[id][key] is True: + temp_options2['lineAAEnable'] = True + else: + temp_options2['lineAAEnable'] = False + else: temp_options[str(key)] = preset[id][key] @@ -2544,7 +2591,20 @@ def load_capture_preset(data=None): 'gpuCacheDisplayFilter', 'multiSample', 'ssaoEnable', - 'textureMaxResolution' + 'ssaoSamples', + 'ssaoAmount', + 'ssaoFilterRadius', + 'ssaoRadius', + 'hwFogEnable', + 'hwFogStart', + 'hwFogEnd', + 'hwFogAlpha', + 'hwFogFalloff', + 'textureMaxResolution', + 'motionBlurEnable', + 'motionBlurSampleCount', + 'motionBlurShutterOpenFraction', + 'lineAAEnable', ]: temp_options.pop(key, None) From f5e3f56981660fd6131cf80d802cb6ed382a6915 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 12:31:50 +0300 Subject: [PATCH 16/64] Append AA flag as schema key. --- .../schemas/schema_maya_capture.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index f8dba0be4b..2c5aed8a67 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -233,6 +233,14 @@ { "type": "splitter" }, + { + "type": "boolean", + "key": "lineAAEnable", + "label": "Enable Anti-Aliasing" + }, + { + "type": "splitter" + }, { "type": "boolean", "key": "ssaoEnable", @@ -313,7 +321,10 @@ { "type": "number", "key": "motionBlurShutterOpenFraction", - "label": "Shutter Open Fraction" + "label": "Shutter Open Fraction", + "decimal": 3, + "minimum": 0.01, + "maximum": 32 }, { "type": "splitter" From f497956c5fc31657f9798137c303b359004046c9 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 12:31:58 +0300 Subject: [PATCH 17/64] Adjust schema defaults. --- openpype/settings/defaults/project_settings/maya.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 437adbc1f0..48a34068db 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -500,6 +500,7 @@ "shadows": true, "textures": true, "twoSidedLighting": true, + "lineAAEnable": true, "ssaoEnable": true, "ssaoAmount": 0, "ssaoRadius": 0, @@ -512,7 +513,7 @@ "hwFogAlpha": 0, "motionBlurEnable": true, "motionBlurSampleCount": 8, - "motionBlurShutterOpenFraction": 0, + "motionBlurShutterOpenFraction": 0.01, "cameras": false, "clipGhosts": false, "controlVertices": false, From 98b912f0b36634c345faaf0e617385460a402af1 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 12:32:15 +0300 Subject: [PATCH 18/64] Change key check placement. --- openpype/hosts/maya/api/lib.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index bd403ad340..12cbac2a32 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2525,10 +2525,11 @@ def load_capture_preset(data=None): if key == 'ssaoEnable': if preset[id][key] is True: temp_options2['ssaoEnable'] = True - temp_options2['ssaoSamples'] = preset[id][key] else: temp_options2['ssaoEnable'] = False - temp_options2['ssaoSamples'] = preset[id][key] + + if key == 'ssaoSamples': + temp_options2['ssaoSamples'] = preset[id][key] if key == 'ssaoAmount': temp_options2['ssaoAmount'] = preset[id][key] @@ -2549,20 +2550,16 @@ def load_capture_preset(data=None): if key == 'hwFogEnable': if preset[id][key] is True: temp_options2['hwFogEnable'] = True + temp_options2['hwFogStart'] = preset[id][key] + temp_options2['hwFogEnd'] = preset[id][key] + temp_options2['hwFogAlpha'] = preset[id][key] + temp_options2['hwFogFalloff'] = preset[id][key] else: temp_options2['hwFogEnable'] = False - - if key == 'hwFogStart': - temp_options2['hwFogStart'] = preset[id][key] - - if key == 'hwFogEnd': - temp_options2['hwFogEnd'] = preset[id][key] - - if key == 'hwFogAlpha': - temp_options2['hwFogAlpha'] = preset[id][key] - - if key == 'hwFogFalloff': - temp_options2['hwFogFalloff'] = preset[id][key] + temp_options2['hwFogStart'] = preset[id][key] + temp_options2['hwFogEnd'] = preset[id][key] + temp_options2['hwFogAlpha'] = preset[id][key] + temp_options2['hwFogFalloff'] = preset[id][key] if key == 'motionBlurEnable': if preset[id][key] is True: From ae897ed2901de70da53ff16bfc5a6d3fa1bc1432 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 13:07:38 +0300 Subject: [PATCH 19/64] Append Fog Color Key to schema. --- .../schemas/projects_schema/schemas/schema_maya_capture.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 2c5aed8a67..08207824b1 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -302,6 +302,11 @@ "key": "hwFogAlpha", "label": "Enable Fog Alpha" }, + { + "type": "color", + "key": "hwFogColor", + "label": "Fog Color" + }, { "type": "splitter" }, From 4c1bba042d69bfbc807f2aea81a004fe27593163 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 13:08:13 +0300 Subject: [PATCH 20/64] Append Fog Color to functionk, fix loop bug. --- openpype/hosts/maya/api/lib.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 12cbac2a32..4b76757e97 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2550,16 +2550,24 @@ def load_capture_preset(data=None): if key == 'hwFogEnable': if preset[id][key] is True: temp_options2['hwFogEnable'] = True - temp_options2['hwFogStart'] = preset[id][key] - temp_options2['hwFogEnd'] = preset[id][key] - temp_options2['hwFogAlpha'] = preset[id][key] - temp_options2['hwFogFalloff'] = preset[id][key] + else: temp_options2['hwFogEnable'] = False - temp_options2['hwFogStart'] = preset[id][key] - temp_options2['hwFogEnd'] = preset[id][key] - temp_options2['hwFogAlpha'] = preset[id][key] - temp_options2['hwFogFalloff'] = preset[id][key] + + if key == 'hwFogStart': + temp_options2['hwFogStart'] = preset[id][key] + + if key == 'hwFogEnd': + temp_options2['hwFogEnd'] = preset[id][key] + + if key == 'hwFogAlpha': + temp_options2['hwFogAlpha'] = preset[id][key] + + if key == 'hwFogFalloff': + temp_options2['hwFogFalloff'] = int(preset[id][key]) + + if key == 'hwFogColor': + temp_options2['hwFogColor'] = preset[id][key] if key == 'motionBlurEnable': if preset[id][key] is True: @@ -2597,6 +2605,7 @@ def load_capture_preset(data=None): 'hwFogEnd', 'hwFogAlpha', 'hwFogFalloff', + 'hwFogColor', 'textureMaxResolution', 'motionBlurEnable', 'motionBlurSampleCount', From bb339e0bbd9828a650f213d8839fecf7ca0f3ff7 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Thu, 23 Jun 2022 13:08:26 +0300 Subject: [PATCH 21/64] Append schema default for color. --- openpype/settings/defaults/project_settings/maya.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 48a34068db..874e23400e 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -511,6 +511,12 @@ "hwFogStart": 0, "hwFogEnd": 0, "hwFogAlpha": 0, + "hwFogColor": [ + 158, + 53, + 53, + 255 + ], "motionBlurEnable": true, "motionBlurSampleCount": 8, "motionBlurShutterOpenFraction": 0.01, From f2ef34c1a2b5dc531c476f5661a79bd8dfeb7d15 Mon Sep 17 00:00:00 2001 From: "Allan I. A" <76656700+Allan-I@users.noreply.github.com> Date: Thu, 23 Jun 2022 19:18:28 +0300 Subject: [PATCH 22/64] Update openpype/hosts/maya/api/lib.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplify key test. Co-authored-by: OndΕ™ej Samohel <33513211+antirotor@users.noreply.github.com> --- openpype/hosts/maya/api/lib.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 4b76757e97..b9f23a2c0e 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2548,11 +2548,7 @@ def load_capture_preset(data=None): temp_options['headsUpDisplay'] = True if key == 'hwFogEnable': - if preset[id][key] is True: - temp_options2['hwFogEnable'] = True - - else: - temp_options2['hwFogEnable'] = False + temp_options2['hwFogEnable'] = preset[id][key] or False if key == 'hwFogStart': temp_options2['hwFogStart'] = preset[id][key] From 3af840f8881432634f776a904655be32536de000 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 04:00:33 +0300 Subject: [PATCH 23/64] Add Color Options --- openpype/hosts/maya/api/lib.py | 14 ++++++++--- .../defaults/project_settings/maya.json | 9 +++---- .../schemas/schema_maya_capture.json | 25 ++++++++++++++++--- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 4b76757e97..c6585f5a8f 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2566,8 +2566,14 @@ def load_capture_preset(data=None): if key == 'hwFogFalloff': temp_options2['hwFogFalloff'] = int(preset[id][key]) - if key == 'hwFogColor': - temp_options2['hwFogColor'] = preset[id][key] + if key == 'hwFogColorR': + temp_options2['hwFogColorR'] = preset[id][key] + + if key == 'hwFogColorG': + temp_options2['hwFogColorG'] = preset[id][key] + + if key == 'hwFogColorB': + temp_options2['hwFogColorB'] = preset[id][key] if key == 'motionBlurEnable': if preset[id][key] is True: @@ -2605,7 +2611,9 @@ def load_capture_preset(data=None): 'hwFogEnd', 'hwFogAlpha', 'hwFogFalloff', - 'hwFogColor', + 'hwFogColorR', + 'hwFogColorG', + 'hwFogColorB', 'textureMaxResolution', 'motionBlurEnable', 'motionBlurSampleCount', diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 874e23400e..7057160a40 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -511,12 +511,9 @@ "hwFogStart": 0, "hwFogEnd": 0, "hwFogAlpha": 0, - "hwFogColor": [ - 158, - 53, - 53, - 255 - ], + "hwFogColorR": 0, + "hwFogColorG": 0, + "hwFogColorB": 0, "motionBlurEnable": true, "motionBlurSampleCount": 8, "motionBlurShutterOpenFraction": 0.01, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 08207824b1..42685623ce 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -303,9 +303,28 @@ "label": "Enable Fog Alpha" }, { - "type": "color", - "key": "hwFogColor", - "label": "Fog Color" + "type": "number", + "key": "hwFogColorR", + "label": "Fog Color R", + "decimal": 2, + "minimum": 0, + "maximum": 1 + }, + { + "type": "number", + "key": "hwFogColorG", + "label": "Fog Color G", + "decimal": 2, + "minimum": 0, + "maximum": 1 + }, + { + "type": "number", + "key": "hwFogColorB", + "label": "Fog Color B", + "decimal": 2, + "minimum": 0, + "maximum": 1 }, { "type": "splitter" From d0f1f897fcfb67623d21dd87a25e969ab03180a7 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 11:18:20 +0300 Subject: [PATCH 24/64] Append SSAO Radius minimum. --- .../schemas/projects_schema/schemas/schema_maya_capture.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 42685623ce..d9d565943f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -259,7 +259,10 @@ { "type": "number", "key": "ssaoFilterRadius", - "label": "SSAO Filter Radius" + "label": "SSAO Filter Radius", + "decimal": 0, + "minimum": 1, + "maximum": 32 }, { "type": "number", From 54b8056238250d8699b2c59bfafd13947a88ff4d Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 11:19:25 +0300 Subject: [PATCH 25/64] Adjust defaults. --- openpype/settings/defaults/project_settings/maya.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 7057160a40..293648385b 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -504,7 +504,7 @@ "ssaoEnable": true, "ssaoAmount": 0, "ssaoRadius": 0, - "ssaoFilterRadius": 0, + "ssaoFilterRadius": 1, "ssaoSamples": 8, "hwFogEnable": true, "hwFogFalloff": "0", From 96fefa32c039fee52bc2120ab3c8c23bb63d8de6 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 12:50:20 +0300 Subject: [PATCH 26/64] Add Fog Density --- .../projects_schema/schemas/schema_maya_capture.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index d9d565943f..6e5eb43dd0 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -290,6 +290,11 @@ { "2": "Exponential Squared"} ] }, + { + "type": "number", + "key": "hwFogDensity", + "label": "Fog Density" + }, { "type": "number", "key": "hwFogStart", @@ -303,7 +308,7 @@ { "type": "number", "key": "hwFogAlpha", - "label": "Enable Fog Alpha" + "label": "Fog Alpha" }, { "type": "number", From 66cce36da5646553e6ffde4ec278433c47aea202 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 12:50:30 +0300 Subject: [PATCH 27/64] Adjust defaults to Maya Values --- .../defaults/project_settings/maya.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 293648385b..bd8d1fecf5 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -502,21 +502,21 @@ "twoSidedLighting": true, "lineAAEnable": true, "ssaoEnable": true, - "ssaoAmount": 0, - "ssaoRadius": 0, - "ssaoFilterRadius": 1, - "ssaoSamples": 8, + "ssaoAmount": 1, + "ssaoRadius": 16, + "ssaoFilterRadius": 16, + "ssaoSamples": 16, "hwFogEnable": true, "hwFogFalloff": "0", "hwFogStart": 0, - "hwFogEnd": 0, + "hwFogEnd": 100, "hwFogAlpha": 0, - "hwFogColorR": 0, - "hwFogColorG": 0, - "hwFogColorB": 0, + "hwFogColorR": 1.0, + "hwFogColorG": 1.0, + "hwFogColorB": 1.0, "motionBlurEnable": true, "motionBlurSampleCount": 8, - "motionBlurShutterOpenFraction": 0.01, + "motionBlurShutterOpenFraction": 0.2, "cameras": false, "clipGhosts": false, "controlVertices": false, From 5b9168b421ed91870beb11bccc2dc9bf71136370 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 12:51:54 +0300 Subject: [PATCH 28/64] Append density default --- openpype/settings/defaults/project_settings/maya.json | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index bd8d1fecf5..bf6c18bb95 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -508,6 +508,7 @@ "ssaoSamples": 16, "hwFogEnable": true, "hwFogFalloff": "0", + "hwFogDensity": 0, "hwFogStart": 0, "hwFogEnd": 100, "hwFogAlpha": 0, From 76cf10a61186d38a4dd1f4c3bc33edce7d605e06 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 13:08:47 +0300 Subject: [PATCH 29/64] Add missing hwFogDensity key. --- openpype/hosts/maya/api/lib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 166f348319..924dc03729 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2537,6 +2537,9 @@ def load_capture_preset(data=None): if key == 'ssaoRadius': temp_options2['ssaoRadius'] = preset[id][key] + if key == 'hwFogDensity': + temp_options2['hwFogDensity'] = preset[id][key] + if key == 'ssaoFilterRadius': temp_options2['ssaoFilterRadius'] = preset[id][key] @@ -2610,6 +2613,7 @@ def load_capture_preset(data=None): 'hwFogColorR', 'hwFogColorG', 'hwFogColorB', + 'hwFogDensity', 'textureMaxResolution', 'motionBlurEnable', 'motionBlurSampleCount', From 0486b99a3438f8b70635e06087a0bbc9f9676b1d Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Fri, 24 Jun 2022 14:14:41 +0300 Subject: [PATCH 30/64] Change hwFogDensity into float key. --- .../schemas/projects_schema/schemas/schema_maya_capture.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 6e5eb43dd0..a87918878d 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -293,7 +293,10 @@ { "type": "number", "key": "hwFogDensity", - "label": "Fog Density" + "label": "Fog Density", + "decimal": 2, + "minimum": 0, + "maximum": 1 }, { "type": "number", From a080eb00ece263ddb645f7f562934fd8f5364073 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 24 Jun 2022 17:05:45 +0200 Subject: [PATCH 31/64] Convert basic families from old standalone publiser to the new one --- .../project_settings/traypublisher.json | 184 +++++++++++++++++- 1 file changed, 182 insertions(+), 2 deletions(-) diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 0b54cfd39e..da5fb2e8b5 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -8,8 +8,8 @@ "default_variants": [ "Main" ], - "description": "Publish workfile backup", - "detailed_description": "", + "description": "Backup of a working scene", + "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": true, "extensions": [ ".ma", @@ -30,6 +30,186 @@ ".psb", ".aep" ] + }, + { + "family": "model", + "identifier": "", + "label": "Model", + "icon": "fa.cubes", + "default_variants": [ + "Main", + "Proxy", + "Sculpt" + ], + "description": "Clean models", + "detailed_description": "Models should only contain geometry data, without any extras like cameras, locators or bones. It should be ready to be loaded into other scenes as is.\n", + "allow_sequences": false, + "extensions": [ + ".ma", + ".mb", + ".obj", + ".abc", + ".fbx", + ".bgeo", + ".bgeogz", + ".bgeosc", + ".usd", + ".blend" + ] + }, + { + "family": "pointcache", + "identifier": "", + "label": "Pointcache", + "icon": "fa.gears", + "default_variants": [ + "Main" + ], + "description": "Geometry Caches", + "detailed_description": "Alembic or bgeo cache of animated data", + "allow_sequences": true, + "extensions": [ + ".abc", + ".bgeo", + ".bgeogz", + ".bgeosc" + ] + }, + { + "family": "plate", + "identifier": "", + "label": "Plate", + "icon": "mdi.camera-image", + "default_variants": [ + "Main", + "BG", + "Animatic", + "Reference", + "Offline" + ], + "description": "Footage Plates", + "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, + "extensions": [ + ".exr", + ".png", + ".dpx", + ".jpg", + ".tiff", + ".tif", + ".mov", + ".mp4", + ".avi" + ] + }, + { + "family": "render", + "identifier": "", + "label": "Render", + "icon": "mdi.folder-multiple-image", + "default_variants": [], + "description": "Rendered images or video", + "detailed_description": "Sequence or single file renders", + "allow_sequences": true, + "extensions": [ + ".exr", + ".png", + ".dpx", + ".jpg", + ".tiff", + ".tif", + ".mov", + ".mp4", + ".avi" + ] + }, + { + "family": "camera", + "identifier": "", + "label": "Camera", + "icon": "fa.video-camera", + "default_variants": [], + "description": "3d Camera", + "detailed_description": "Ideally this should be only camera itself with baked animation, however, it can technically also include helper geometry.", + "allow_sequences": false, + "extensions": [ + ".abc", + ".ma", + ".hip", + ".blend", + ".fbx", + ".usd" + ] + }, + { + "family": "image", + "identifier": "", + "label": "Image", + "icon": "fa.image", + "default_variants": [ + "Reference", + "Texture", + "Concept", + "Background" + ], + "description": "Single image", + "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, + "extensions": [ + ".exr", + ".jpg", + ".dpx", + ".bmp", + ".tif", + ".tiff", + ".png", + ".psb", + ".psd" + ] + }, + { + "family": "vdb", + "identifier": "", + "label": "VDB Volumes", + "icon": "fa.cloud", + "default_variants": [], + "description": "Sparse volumetric data", + "detailed_description": "Hierarchical data structure for the efficient storage and manipulation of sparse volumetric data discretized on three-dimensional grids", + "allow_sequences": true, + "extensions": [ + ".vdb" + ] + }, + { + "family": "matchmove", + "identifier": "", + "label": "Matchmove", + "icon": "fa.empire", + "default_variants": [ + "Camera", + "Object", + "Mocap" + ], + "description": "Matchmoving script", + "detailed_description": "Script exported from matchmoving application to be later processed into a tracked camera with additional data", + "allow_sequences": false, + "extensions": [] + }, + { + "family": "rig", + "identifier": "", + "label": "Rig", + "icon": "fa.wheelchair", + "default_variants": [], + "description": "CG rig file", + "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, + "extensions": [ + ".ma", + ".blend", + ".hip", + ".hda" + ] } ] } \ No newline at end of file From 5ec1f8c1ccf094bf11d7f9e9bd722d4606e0d127 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 24 Jun 2022 17:47:28 +0200 Subject: [PATCH 32/64] add unreal texture and tweak model help --- .../defaults/project_settings/traypublisher.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index da5fb2e8b5..5afaaee78c 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -42,7 +42,7 @@ "Sculpt" ], "description": "Clean models", - "detailed_description": "Models should only contain geometry data, without any extras like cameras, locators or bones. It should be ready to be loaded into other scenes as is.\n", + "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, "extensions": [ ".ma", @@ -210,6 +210,19 @@ ".hip", ".hda" ] + }, + { + "family": "simpleUnrealTexture", + "identifier": "", + "label": "Simple UE texture", + "icon": "fa.image", + "default_variants": [ + "" + ], + "description": "Simple Unreal Engine texture", + "detailed_description": "Texture files with Unreal Engine naming conventions", + "allow_sequences": false, + "extensions": [] } ] } \ No newline at end of file From f25c662c37ced86fde5c22764665c55b9268edea Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Sat, 25 Jun 2022 11:21:25 +0300 Subject: [PATCH 33/64] Replace `hwFogEnable` with `fogging` flag. --- openpype/hosts/maya/api/lib.py | 5 ++--- openpype/settings/defaults/project_settings/maya.json | 2 +- .../schemas/projects_schema/schemas/schema_maya_capture.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 924dc03729..cd41ba3ffd 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2550,8 +2550,8 @@ def load_capture_preset(data=None): if key == 'headsUpDisplay': temp_options['headsUpDisplay'] = True - if key == 'hwFogEnable': - temp_options2['hwFogEnable'] = preset[id][key] or False + if key == 'fogging': + temp_options['fogging'] = preset[id][key] or False if key == 'hwFogStart': temp_options2['hwFogStart'] = preset[id][key] @@ -2605,7 +2605,6 @@ def load_capture_preset(data=None): 'ssaoAmount', 'ssaoFilterRadius', 'ssaoRadius', - 'hwFogEnable', 'hwFogStart', 'hwFogEnd', 'hwFogAlpha', diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index bf6c18bb95..77bc8118df 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -506,7 +506,7 @@ "ssaoRadius": 16, "ssaoFilterRadius": 16, "ssaoSamples": 16, - "hwFogEnable": true, + "fogging": true, "hwFogFalloff": "0", "hwFogDensity": 0, "hwFogStart": 0, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index a87918878d..2323fbaba0 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -277,7 +277,7 @@ }, { "type": "boolean", - "key": "hwFogEnable", + "key": "fogging", "label": "Enable Hardware Fog" }, { From b74e144dbb6d9fda8ac701d957d7c9fa98005139 Mon Sep 17 00:00:00 2001 From: "Allan I. A" <76656700+Allan-I@users.noreply.github.com> Date: Mon, 27 Jun 2022 12:15:13 +0300 Subject: [PATCH 34/64] Update openpype/settings/defaults/project_settings/maya.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: OndΕ™ej Samohel <33513211+antirotor@users.noreply.github.com> --- openpype/settings/defaults/project_settings/maya.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 77bc8118df..2f1dca6978 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -506,7 +506,7 @@ "ssaoRadius": 16, "ssaoFilterRadius": 16, "ssaoSamples": 16, - "fogging": true, + "fogging": false, "hwFogFalloff": "0", "hwFogDensity": 0, "hwFogStart": 0, From 800a2f90d2baaf59ad662a42a920012fac827931 Mon Sep 17 00:00:00 2001 From: "Allan I. A" <76656700+Allan-I@users.noreply.github.com> Date: Mon, 27 Jun 2022 12:15:21 +0300 Subject: [PATCH 35/64] Update openpype/settings/defaults/project_settings/maya.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: OndΕ™ej Samohel <33513211+antirotor@users.noreply.github.com> --- openpype/settings/defaults/project_settings/maya.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 2f1dca6978..117b260853 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -515,7 +515,7 @@ "hwFogColorR": 1.0, "hwFogColorG": 1.0, "hwFogColorB": 1.0, - "motionBlurEnable": true, + "motionBlurEnable": false, "motionBlurSampleCount": 8, "motionBlurShutterOpenFraction": 0.2, "cameras": false, From dd5cef560a44a513ae3395fd84f6c02c1adffff8 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 28 Jun 2022 05:56:36 +0300 Subject: [PATCH 36/64] Adjust setting position --- .../schemas/schema_maya_capture.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 2323fbaba0..0a63315622 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -204,14 +204,6 @@ { "type": "splitter" }, - { - "type": "number", - "key": "multiSample", - "label": "Anti Aliasing Samples", - "decimal": 0, - "minimum": 0, - "maximum": 32 - }, { "type": "splitter" }, @@ -238,6 +230,14 @@ "key": "lineAAEnable", "label": "Enable Anti-Aliasing" }, + { + "type": "number", + "key": "multiSample", + "label": "Anti Aliasing Samples", + "decimal": 0, + "minimum": 0, + "maximum": 32 + }, { "type": "splitter" }, From e9f67f8747cad536c591884701fc441f177d3574 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 28 Jun 2022 05:56:51 +0300 Subject: [PATCH 37/64] Adjust some defaults. --- openpype/settings/defaults/project_settings/maya.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 117b260853..bb7719dc30 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -496,19 +496,19 @@ "override_viewport_options": true, "displayLights": "default", "textureMaxResolution": 1024, - "multiSample": 4, "shadows": true, "textures": true, "twoSidedLighting": true, "lineAAEnable": true, - "ssaoEnable": true, + "multiSample": 8, + "ssaoEnable": false, "ssaoAmount": 1, "ssaoRadius": 16, "ssaoFilterRadius": 16, "ssaoSamples": 16, "fogging": false, "hwFogFalloff": "0", - "hwFogDensity": 0, + "hwFogDensity": 0.0, "hwFogStart": 0, "hwFogEnd": 100, "hwFogAlpha": 0, From f76d84dff177c31f46d369f0ccd97d0a253251a7 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 6 Jul 2022 22:57:02 +0300 Subject: [PATCH 38/64] Append "Depth of Field" to plablast options and function. --- openpype/hosts/maya/api/lib.py | 4 ++++ openpype/settings/defaults/project_settings/maya.json | 1 + .../schemas/projects_schema/schemas/schema_maya_capture.json | 5 +++++ openpype/vendor/python/common/capture.py | 3 ++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index cd41ba3ffd..a159554b54 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -2522,6 +2522,9 @@ def load_capture_preset(data=None): temp_options2['multiSampleEnable'] = False temp_options2['multiSampleCount'] = preset[id][key] + if key == 'renderDepthOfField': + temp_options2['renderDepthOfField'] = preset[id][key] + if key == 'ssaoEnable': if preset[id][key] is True: temp_options2['ssaoEnable'] = True @@ -2618,6 +2621,7 @@ def load_capture_preset(data=None): 'motionBlurSampleCount', 'motionBlurShutterOpenFraction', 'lineAAEnable', + 'renderDepthOfField' ]: temp_options.pop(key, None) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index bb7719dc30..39a8688267 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -496,6 +496,7 @@ "override_viewport_options": true, "displayLights": "default", "textureMaxResolution": 1024, + "renderDepthOfField": true, "shadows": true, "textures": true, "twoSidedLighting": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 0a63315622..7a40f349cc 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -204,6 +204,11 @@ { "type": "splitter" }, + { + "type":"boolean", + "key": "renderDepthOfField", + "label": "Depth of Field" + }, { "type": "splitter" }, diff --git a/openpype/vendor/python/common/capture.py b/openpype/vendor/python/common/capture.py index 6b4c40a6e8..4d9e1da3e4 100644 --- a/openpype/vendor/python/common/capture.py +++ b/openpype/vendor/python/common/capture.py @@ -380,7 +380,8 @@ Viewport2Options = { "transparencyAlgorithm": 1, "transparencyQuality": 0.33, "useMaximumHardwareLights": True, - "vertexAnimationCache": 0 + "vertexAnimationCache": 0, + "renderDepthOfField": 0 } From 64d80f2d05c7639505db50a9c512d01d6e1cf224 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 12 Jul 2022 13:40:24 +0200 Subject: [PATCH 39/64] nuke: adding retime loading option to clip loader --- openpype/hosts/nuke/plugins/load/load_clip.py | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/openpype/hosts/nuke/plugins/load/load_clip.py b/openpype/hosts/nuke/plugins/load/load_clip.py index d177e6ba76..e9530c58c0 100644 --- a/openpype/hosts/nuke/plugins/load/load_clip.py +++ b/openpype/hosts/nuke/plugins/load/load_clip.py @@ -55,7 +55,8 @@ class LoadClip(plugin.NukeLoader): # option gui defaults = { - "start_at_workfile": True + "start_at_workfile": True, + "add_retime": True } options = [ @@ -63,6 +64,11 @@ class LoadClip(plugin.NukeLoader): "start_at_workfile", help="Load at workfile start frame", default=True + ), + qargparse.Boolean( + "add_retime", + help="Load with retime", + default=True ) ] @@ -88,6 +94,9 @@ class LoadClip(plugin.NukeLoader): start_at_workfile = options.get( "start_at_workfile", self.defaults["start_at_workfile"]) + add_retime = options.get( + "add_retime", self.defaults["add_retime"]) + version = context['version'] version_data = version.get("data", {}) repre_id = repre["_id"] @@ -151,7 +160,7 @@ class LoadClip(plugin.NukeLoader): data_imprint = {} for k in add_keys: if k == 'version': - data_imprint.update({k: context["version"]['name']}) + data_imprint[k] = context["version"]['name'] elif k == 'colorspace': colorspace = repre["data"].get(k) colorspace = colorspace or version_data.get(k) @@ -159,10 +168,13 @@ class LoadClip(plugin.NukeLoader): if used_colorspace: data_imprint["used_colorspace"] = used_colorspace else: - data_imprint.update( - {k: context["version"]['data'].get(k, str(None))}) + data_imprint[k] = context["version"]['data'].get( + k, str(None)) - data_imprint.update({"objectName": read_name}) + data_imprint["objectName"] = read_name + + if add_retime and version_data.get("retime", None): + data_imprint["addRetime"] = True read_node["tile_color"].setValue(int("0x4ecd25ff", 16)) @@ -174,7 +186,7 @@ class LoadClip(plugin.NukeLoader): loader=self.__class__.__name__, data=data_imprint) - if version_data.get("retime", None): + if add_retime and version_data.get("retime", None): self._make_retimes(read_node, version_data) self.set_as_member(read_node) @@ -200,6 +212,10 @@ class LoadClip(plugin.NukeLoader): start_at_workfile = bool("start at" in read_node['frame_mode'].value()) + # TODO: find `addRetime` add openpipe data + # add_retime = options.get( + # "add_retime", self.defaults["add_retime"]) + project_name = legacy_io.active_project() version_doc = get_version_by_id(project_name, representation["parent"]) @@ -286,7 +302,7 @@ class LoadClip(plugin.NukeLoader): "updated to version: {}".format(version_doc.get("name")) ) - if version_data.get("retime", None): + if add_retime and version_data.get("retime", None): self._make_retimes(read_node, version_data) else: self.clear_members(read_node) From dfb041d8524fe8b1cc415a5be86a49cb0148f529 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 12 Jul 2022 15:06:46 +0200 Subject: [PATCH 40/64] timers manager is using client query functions --- .../modules/timers_manager/timers_manager.py | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/openpype/modules/timers_manager/timers_manager.py b/openpype/modules/timers_manager/timers_manager.py index 3cf1614316..3453e4bc4c 100644 --- a/openpype/modules/timers_manager/timers_manager.py +++ b/openpype/modules/timers_manager/timers_manager.py @@ -2,13 +2,13 @@ import os import platform +from openpype.client import get_asset_by_name from openpype.modules import OpenPypeModule from openpype_interfaces import ( ITrayService, ILaunchHookPaths ) from openpype.lib.events import register_event_callback -from openpype.pipeline import AvalonMongoDB from .exceptions import InvalidContextError @@ -197,22 +197,13 @@ class TimersManager(OpenPypeModule, ITrayService, ILaunchHookPaths): " Project: \"{}\" Asset: \"{}\" Task: \"{}\"" ).format(str(project_name), str(asset_name), str(task_name))) - dbconn = AvalonMongoDB() - dbconn.install() - dbconn.Session["AVALON_PROJECT"] = project_name - - asset_doc = dbconn.find_one( - { - "type": "asset", - "name": asset_name - }, - { - "data.tasks": True, - "data.parents": True - } + asset_doc = get_asset_by_name( + project_name, + asset_name, + fields=["_id", "name", "data.tasks", "data.parents"] ) + if not asset_doc: - dbconn.uninstall() raise InvalidContextError(( "Asset \"{}\" not found in project \"{}\"" ).format(asset_name, project_name)) @@ -220,7 +211,6 @@ class TimersManager(OpenPypeModule, ITrayService, ILaunchHookPaths): asset_data = asset_doc.get("data") or {} asset_tasks = asset_data.get("tasks") or {} if task_name not in asset_tasks: - dbconn.uninstall() raise InvalidContextError(( "Task \"{}\" not found on asset \"{}\" in project \"{}\"" ).format(task_name, asset_name, project_name)) @@ -238,9 +228,10 @@ class TimersManager(OpenPypeModule, ITrayService, ILaunchHookPaths): hierarchy_items = asset_data.get("parents") or [] hierarchy_items.append(asset_name) - dbconn.uninstall() return { "project_name": project_name, + "asset_id": str(asset_doc["_id"]), + "asset_name": asset_doc["name"], "task_name": task_name, "task_type": task_type, "hierarchy": hierarchy_items From 498ed608ebce7d639fcc091da979307f0f21da62 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 12 Jul 2022 16:24:22 +0200 Subject: [PATCH 41/64] nuke: setting loader option defaults from settings --- openpype/hosts/nuke/plugins/load/load_clip.py | 36 ++++++++------- .../defaults/project_settings/nuke.json | 6 ++- .../schemas/schema_nuke_load.json | 46 ++++++++++++++++++- 3 files changed, 68 insertions(+), 20 deletions(-) diff --git a/openpype/hosts/nuke/plugins/load/load_clip.py b/openpype/hosts/nuke/plugins/load/load_clip.py index e9530c58c0..43dd5a66eb 100644 --- a/openpype/hosts/nuke/plugins/load/load_clip.py +++ b/openpype/hosts/nuke/plugins/load/load_clip.py @@ -54,26 +54,28 @@ class LoadClip(plugin.NukeLoader): script_start = int(nuke.root()["first_frame"].value()) # option gui - defaults = { + options_defaults = { "start_at_workfile": True, "add_retime": True } - options = [ - qargparse.Boolean( - "start_at_workfile", - help="Load at workfile start frame", - default=True - ), - qargparse.Boolean( - "add_retime", - help="Load with retime", - default=True - ) - ] - node_name_template = "{class_name}_{ext}" + @classmethod + def get_options(cls, *args): + return [ + qargparse.Boolean( + "start_at_workfile", + help="Load at workfile start frame", + default=cls.options_defaults["start_at_workfile"] + ), + qargparse.Boolean( + "add_retime", + help="Load with retime", + default=cls.options_defaults["add_retime"] + ) + ] + @classmethod def get_representations(cls): return ( @@ -92,10 +94,10 @@ class LoadClip(plugin.NukeLoader): file = self.fname.replace("\\", "/") start_at_workfile = options.get( - "start_at_workfile", self.defaults["start_at_workfile"]) + "start_at_workfile", self.options_defaults["start_at_workfile"]) add_retime = options.get( - "add_retime", self.defaults["add_retime"]) + "add_retime", self.options_defaults["add_retime"]) version = context['version'] version_data = version.get("data", {}) @@ -214,7 +216,7 @@ class LoadClip(plugin.NukeLoader): # TODO: find `addRetime` add openpipe data # add_retime = options.get( - # "add_retime", self.defaults["add_retime"]) + # "add_retime", self.options_defaults["add_retime"]) project_name = legacy_io.active_project() version_doc = get_version_by_id(project_name, representation["parent"]) diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 6c45e2a9c1..3e29122074 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -287,7 +287,11 @@ "LoadClip": { "enabled": true, "_representations": [], - "node_name_template": "{class_name}_{ext}" + "node_name_template": "{class_name}_{ext}", + "options_defaults": { + "start_at_workfile": true, + "add_retime": true + } } }, "workfile_builder": { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_load.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_load.json index 5bd8337e4c..805424c632 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_load.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_load.json @@ -11,10 +11,52 @@ { "key": "LoadImage", "label": "Image Loader" + } + ] + }, + { + "type": "dict", + "collapsible": true, + "key": "LoadClip", + "label": "Clip Loader", + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" }, { - "key": "LoadClip", - "label": "Clip Loader" + "type": "list", + "key": "_representations", + "label": "Representations", + "object_type": "text" + }, + { + "type": "text", + "key": "node_name_template", + "label": "Node name template" + }, + { + "type": "splitter" + }, + { + "type": "dict", + "collapsible": false, + "key": "options_defaults", + "label": "Loader option defaults", + "children": [ + { + "type": "boolean", + "key": "start_at_workfile", + "label": "Start at worfile beggining" + }, + { + "type": "boolean", + "key": "add_retime", + "label": "Add retime" + } + ] } ] } From d04e95e28f9a206c4a7390a7a1c82f418736b7c9 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 12 Jul 2022 16:48:39 +0200 Subject: [PATCH 42/64] nuke: updating clip with retime options --- openpype/hosts/nuke/plugins/load/load_clip.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/nuke/plugins/load/load_clip.py b/openpype/hosts/nuke/plugins/load/load_clip.py index 43dd5a66eb..b2dc4a52d7 100644 --- a/openpype/hosts/nuke/plugins/load/load_clip.py +++ b/openpype/hosts/nuke/plugins/load/load_clip.py @@ -212,11 +212,12 @@ class LoadClip(plugin.NukeLoader): read_node = nuke.toNode(container['objectName']) file = get_representation_path(representation).replace("\\", "/") - start_at_workfile = bool("start at" in read_node['frame_mode'].value()) + start_at_workfile = "start at" in read_node['frame_mode'].value() - # TODO: find `addRetime` add openpipe data - # add_retime = options.get( - # "add_retime", self.options_defaults["add_retime"]) + add_retime = [ + key for key in read_node.knobs().keys() + if "addRetime" in key + ] project_name = legacy_io.active_project() version_doc = get_version_by_id(project_name, representation["parent"]) From 9d4d8873358bcb6fde08e46817f47a09d858c68d Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 12 Jul 2022 17:13:50 +0200 Subject: [PATCH 43/64] keep mismatch target plugins in report --- openpype/pipeline/create/context.py | 10 ++++++++++ openpype/tools/publisher/control.py | 15 +++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/openpype/pipeline/create/context.py b/openpype/pipeline/create/context.py index 7f0341c127..ac345ea47b 100644 --- a/openpype/pipeline/create/context.py +++ b/openpype/pipeline/create/context.py @@ -709,6 +709,7 @@ class CreateContext: self.manual_creators = {} self.publish_discover_result = None + self.publish_plugins_mismatch_targets = [] self.publish_plugins = [] self.plugins_with_defs = [] self._attr_plugins_by_family = {} @@ -831,6 +832,7 @@ class CreateContext: discover_result = DiscoverResult() plugins_with_defs = [] plugins_by_targets = [] + plugins_mismatch_targets = [] if discover_publish_plugins: discover_result = publish_plugins_discover() publish_plugins = discover_result.plugins @@ -840,11 +842,19 @@ class CreateContext: plugins_by_targets = pyblish.logic.plugins_by_targets( publish_plugins, list(targets) ) + # Collect plugins that can have attribute definitions for plugin in publish_plugins: if OpenPypePyblishPluginMixin in inspect.getmro(plugin): plugins_with_defs.append(plugin) + plugins_mismatch_targets = [ + plugin + for plugin in publish_plugins + if plugin not in plugins_by_targets + ] + + self.publish_plugins_mismatch_targets = plugins_mismatch_targets self.publish_discover_result = discover_result self.publish_plugins = plugins_by_targets self.plugins_with_defs = plugins_with_defs diff --git a/openpype/tools/publisher/control.py b/openpype/tools/publisher/control.py index 915fb7f32e..f692bb4000 100644 --- a/openpype/tools/publisher/control.py +++ b/openpype/tools/publisher/control.py @@ -154,15 +154,20 @@ class PublishReport: self._all_instances_by_id = {} self._current_context = None - def reset(self, context, publish_discover_result=None): + def reset(self, context, create_context): """Reset report and clear all data.""" - self._publish_discover_result = publish_discover_result + + self._publish_discover_result = create_context.publish_discover_result self._plugin_data = [] self._plugin_data_with_plugin = [] self._current_plugin_data = {} self._all_instances_by_id = {} self._current_context = context + for plugin in create_context.publish_plugins_mismatch_targets: + plugin_data = self._add_plugin_data_item(plugin) + plugin_data["skipped"] = True + def add_plugin_iter(self, plugin, context): """Add report about single iteration of plugin.""" for instance in context: @@ -205,6 +210,7 @@ class PublishReport: "name": plugin.__name__, "label": label, "order": plugin.order, + "targets": list(plugin.targets), "instances_data": [], "actions_data": [], "skipped": False, @@ -777,10 +783,7 @@ class PublisherController: # - pop the key after first collector using it would be safest option? self._publish_context.data["create_context"] = self.create_context - self._publish_report.reset( - self._publish_context, - self.create_context.publish_discover_result - ) + self._publish_report.reset(self._publish_context, self.create_context) self._publish_validation_errors = [] self._publish_current_plugin_validation_errors = None self._publish_error = None From 8a951ee60f837dbce81442574f922691707ce614 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 12 Jul 2022 17:27:47 +0200 Subject: [PATCH 44/64] removed GlobalEvent --- openpype/lib/events.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/openpype/lib/events.py b/openpype/lib/events.py index 3762cec9f9..4a7d648a7e 100644 --- a/openpype/lib/events.py +++ b/openpype/lib/events.py @@ -253,13 +253,6 @@ class EventSystem(object): self._registered_callbacks.remove(callback) -class GlobalEvent(Event): - def __init__(self, topic, data=None, source=None): - event_system = GlobalEventSystem.get_global_event_system() - - super(GlobalEvent, self).__init__(topic, data, source, event_system) - - class GlobalEventSystem: _global_event_system = None @@ -276,7 +269,7 @@ class GlobalEventSystem: @classmethod def emit(cls, topic, data, source): - event = GlobalEvent(topic, data, source) + event = Event(topic, data, source, cls.get_global_event_system()) event.emit() return event From 8ab6b41db5689312c39e07426fda869d9c2cc421 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 12 Jul 2022 17:34:51 +0200 Subject: [PATCH 45/64] simplified global event emit --- openpype/lib/events.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openpype/lib/events.py b/openpype/lib/events.py index 4a7d648a7e..215e36bc4e 100644 --- a/openpype/lib/events.py +++ b/openpype/lib/events.py @@ -180,7 +180,10 @@ class Event(object): topic (str): Identifier of event. data (Any): Data specific for event. Dictionary is recommended. source (str): Identifier of source. + event_system (EventSystem): Event system in which can be event + triggered. """ + _data = {} def __init__(self, topic, data=None, source=None, event_system=None): @@ -269,9 +272,8 @@ class GlobalEventSystem: @classmethod def emit(cls, topic, data, source): - event = Event(topic, data, source, cls.get_global_event_system()) - event.emit() - return event + event_system = cls.get_global_event_system() + return event_system.emit(topic, data, source) def register_event_callback(topic, callback): From 018896f9239f3fb3a036512a892a8f48593dca85 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 12 Jul 2022 18:28:03 +0200 Subject: [PATCH 46/64] added docstrings --- openpype/lib/events.py | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/openpype/lib/events.py b/openpype/lib/events.py index 215e36bc4e..301d62e2a6 100644 --- a/openpype/lib/events.py +++ b/openpype/lib/events.py @@ -229,23 +229,74 @@ class Event(object): class EventSystem(object): + """Encapsulate event handling into an object. + + System wraps registered callbacks and triggered events into single object + so it is possible to create mutltiple independent systems that have their + topics and callbacks. + + + """ + def __init__(self): self._registered_callbacks = [] def add_callback(self, topic, callback): + """Register callback in event system. + + Args: + topic (str): Topic for EventCallback. + callback (Callable): Function or method that will be called + when topic is triggered. + + Returns: + EventCallback: Created callback object which can be used to + stop listening. + """ + callback = EventCallback(topic, callback) self._registered_callbacks.append(callback) return callback def create_event(self, topic, data, source): + """Create new event which is bound to event system. + + Args: + topic (str): Event topic. + data (dict): Data related to event. + source (str): Source of event. + + Returns: + Event: Object of event. + """ + return Event(topic, data, source, self) def emit(self, topic, data, source): + """Create event based on passed data and emit it. + + This is easiest way how to trigger event in an event system. + + Args: + topic (str): Event topic. + data (dict): Data related to event. + source (str): Source of event. + + Returns: + Event: Created and emitted event. + """ + event = self.create_event(topic, data, source) event.emit() return event def emit_event(self, event): + """Emit event object. + + Args: + event (Event): Prepared event with topic and data. + """ + invalid_callbacks = [] for callback in self._registered_callbacks: callback.process_event(event) @@ -257,6 +308,12 @@ class EventSystem(object): class GlobalEventSystem: + """Event system living in global scope of process. + + This is primarily used in host implementation to trigger events + related to DCC changes or changes of context in the host implementation. + """ + _global_event_system = None @classmethod From 0222a1518d1131e31d586f47dbf4f11b1c1ebbd0 Mon Sep 17 00:00:00 2001 From: OpenPype Date: Wed, 13 Jul 2022 03:57:50 +0000 Subject: [PATCH 47/64] [Automated] Bump version --- CHANGELOG.md | 30 +++++++++++------------------- openpype/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a0c058f73..55ee51b38a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [3.12.1-nightly.4](https://github.com/pypeclub/OpenPype/tree/HEAD) +## [3.12.1-nightly.5](https://github.com/pypeclub/OpenPype/tree/HEAD) [Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.12.0...HEAD) @@ -14,6 +14,9 @@ **πŸš€ Enhancements** +- TrayPublisher: Added more options for grouping of instances [\#3494](https://github.com/pypeclub/OpenPype/pull/3494) +- NewPublisher: Align creator attributes from top to bottom [\#3487](https://github.com/pypeclub/OpenPype/pull/3487) +- NewPublisher: Added ability to use label of instance [\#3484](https://github.com/pypeclub/OpenPype/pull/3484) - General: Creator Plugins have access to project [\#3476](https://github.com/pypeclub/OpenPype/pull/3476) - General: Better arguments order in creator init [\#3475](https://github.com/pypeclub/OpenPype/pull/3475) - Ftrack: Trigger custom ftrack events on project creation and preparation [\#3465](https://github.com/pypeclub/OpenPype/pull/3465) @@ -25,6 +28,11 @@ **πŸ› Bug fixes** +- TrayPublisher: Keep use instance label in list view [\#3493](https://github.com/pypeclub/OpenPype/pull/3493) +- General: Extract review use first frame of input sequence [\#3491](https://github.com/pypeclub/OpenPype/pull/3491) +- General: Fix Plist loading for application launch [\#3485](https://github.com/pypeclub/OpenPype/pull/3485) +- Nuke: Workfile tools open on start [\#3479](https://github.com/pypeclub/OpenPype/pull/3479) +- New Publisher: Disabled context change allows creation [\#3478](https://github.com/pypeclub/OpenPype/pull/3478) - General: thumbnail extractor fix [\#3474](https://github.com/pypeclub/OpenPype/pull/3474) - Kitsu: bugfix with sync-service ans publish plugins [\#3473](https://github.com/pypeclub/OpenPype/pull/3473) - Flame: solved problem with multi-selected loading [\#3470](https://github.com/pypeclub/OpenPype/pull/3470) @@ -46,7 +54,9 @@ - General: Use query functions in global plugins [\#3459](https://github.com/pypeclub/OpenPype/pull/3459) - Clockify: Use query functions in clockify actions [\#3458](https://github.com/pypeclub/OpenPype/pull/3458) - General: Use query functions in rest api calls [\#3457](https://github.com/pypeclub/OpenPype/pull/3457) +- General: Use query functions in openpype lib functions [\#3454](https://github.com/pypeclub/OpenPype/pull/3454) - General: Use query functions in load utils [\#3446](https://github.com/pypeclub/OpenPype/pull/3446) +- General: Move publish plugin and publish render abstractions [\#3442](https://github.com/pypeclub/OpenPype/pull/3442) - General: Use Anatomy after move to pipeline [\#3436](https://github.com/pypeclub/OpenPype/pull/3436) - General: Anatomy moved to pipeline [\#3435](https://github.com/pypeclub/OpenPype/pull/3435) - Fusion: Use client query functions [\#3380](https://github.com/pypeclub/OpenPype/pull/3380) @@ -66,8 +76,6 @@ - Webserver: Added CORS middleware [\#3422](https://github.com/pypeclub/OpenPype/pull/3422) - Attribute Defs UI: Files widget show what is allowed to drop in [\#3411](https://github.com/pypeclub/OpenPype/pull/3411) - General: Add ability to change user value for templates [\#3366](https://github.com/pypeclub/OpenPype/pull/3366) -- Hosts: More options for in-host callbacks [\#3357](https://github.com/pypeclub/OpenPype/pull/3357) -- Multiverse: expose some settings to GUI [\#3350](https://github.com/pypeclub/OpenPype/pull/3350) **πŸ› Bug fixes** @@ -82,7 +90,6 @@ - Maya: vray device aspect ratio fix [\#3381](https://github.com/pypeclub/OpenPype/pull/3381) - Flame: bunch of publishing issues [\#3377](https://github.com/pypeclub/OpenPype/pull/3377) - Harmony: added unc path to zifile command in Harmony [\#3372](https://github.com/pypeclub/OpenPype/pull/3372) -- Standalone: settings improvements [\#3355](https://github.com/pypeclub/OpenPype/pull/3355) **πŸ”€ Refactored code** @@ -107,16 +114,9 @@ [Full Changelog](https://github.com/pypeclub/OpenPype/compare/CI/3.11.1-nightly.1...3.11.1) -**πŸ†• New features** - -- Flame: custom export temp folder [\#3346](https://github.com/pypeclub/OpenPype/pull/3346) -- Nuke: removing third-party plugins [\#3344](https://github.com/pypeclub/OpenPype/pull/3344) - **πŸš€ Enhancements** - Pyblish Pype: Hiding/Close issues [\#3367](https://github.com/pypeclub/OpenPype/pull/3367) -- Ftrack: Removed requirement of pypeclub role from default settings [\#3354](https://github.com/pypeclub/OpenPype/pull/3354) -- Kitsu: Prevent crash on missing frames information [\#3352](https://github.com/pypeclub/OpenPype/pull/3352) **πŸ› Bug fixes** @@ -125,19 +125,11 @@ - Nuke: Fix missing variable in extract thumbnail [\#3363](https://github.com/pypeclub/OpenPype/pull/3363) - Nuke: Fix precollect writes [\#3361](https://github.com/pypeclub/OpenPype/pull/3361) - AE- fix validate\_scene\_settings and renderLocal [\#3358](https://github.com/pypeclub/OpenPype/pull/3358) -- deadline: fixing misidentification of revieables [\#3356](https://github.com/pypeclub/OpenPype/pull/3356) -- General: Create only one thumbnail per instance [\#3351](https://github.com/pypeclub/OpenPype/pull/3351) -- nuke: adding extract thumbnail settings 3.10 [\#3347](https://github.com/pypeclub/OpenPype/pull/3347) -- General: Fix last version function [\#3345](https://github.com/pypeclub/OpenPype/pull/3345) ## [3.11.0](https://github.com/pypeclub/OpenPype/tree/3.11.0) (2022-06-17) [Full Changelog](https://github.com/pypeclub/OpenPype/compare/CI/3.11.0-nightly.4...3.11.0) -**πŸ› Bug fixes** - -- General: Handle empty source key on instance [\#3342](https://github.com/pypeclub/OpenPype/pull/3342) - ## [3.10.0](https://github.com/pypeclub/OpenPype/tree/3.10.0) (2022-05-26) [Full Changelog](https://github.com/pypeclub/OpenPype/compare/CI/3.10.0-nightly.6...3.10.0) diff --git a/openpype/version.py b/openpype/version.py index 3239b0e2a2..08bb4706cc 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.12.1-nightly.4" +__version__ = "3.12.1-nightly.5" diff --git a/pyproject.toml b/pyproject.toml index f5bd7cc946..1251299612 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "OpenPype" -version = "3.12.1-nightly.4" # OpenPype +version = "3.12.1-nightly.5" # OpenPype description = "Open VFX and Animation pipeline with support." authors = ["OpenPype Team "] license = "MIT License" From cda2c37b9548f90e63f34f04e2873169e167c3f9 Mon Sep 17 00:00:00 2001 From: OpenPype Date: Wed, 13 Jul 2022 07:26:22 +0000 Subject: [PATCH 48/64] [Automated] Bump version --- CHANGELOG.md | 15 +++++---------- openpype/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ee51b38a..59c51396e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,9 @@ # Changelog -## [3.12.1-nightly.5](https://github.com/pypeclub/OpenPype/tree/HEAD) +## [3.12.1-nightly.6](https://github.com/pypeclub/OpenPype/tree/HEAD) [Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.12.0...HEAD) -### πŸ“– Documentation - -- Docs: Added minimal permissions for MongoDB [\#3441](https://github.com/pypeclub/OpenPype/pull/3441) - **πŸ†• New features** - Maya: Add VDB to Arnold loader [\#3433](https://github.com/pypeclub/OpenPype/pull/3433) @@ -24,7 +20,7 @@ - Blender: Bugfix - Set fps properly on open [\#3426](https://github.com/pypeclub/OpenPype/pull/3426) - Hiero: Add custom scripts menu [\#3425](https://github.com/pypeclub/OpenPype/pull/3425) - Blender: pre pyside install for all platforms [\#3400](https://github.com/pypeclub/OpenPype/pull/3400) -- Maya: Ability to set resolution for playblasts from asset, and override through review instance. [\#3360](https://github.com/pypeclub/OpenPype/pull/3360) +- Maya: Add additional playblast options to review Extractor. [\#3384](https://github.com/pypeclub/OpenPype/pull/3384) **πŸ› Bug fixes** @@ -40,7 +36,6 @@ - Resolve: removed few bugs [\#3464](https://github.com/pypeclub/OpenPype/pull/3464) - General: Delete old versions is safer when ftrack is disabled [\#3462](https://github.com/pypeclub/OpenPype/pull/3462) - Nuke: fixing metadata slate TC difference [\#3455](https://github.com/pypeclub/OpenPype/pull/3455) -- Nuke: prerender reviewable fails [\#3450](https://github.com/pypeclub/OpenPype/pull/3450) - Maya: fix hashing in Python 3 for tile rendering [\#3447](https://github.com/pypeclub/OpenPype/pull/3447) - LogViewer: Escape html characters in log message [\#3443](https://github.com/pypeclub/OpenPype/pull/3443) - Nuke: Slate frame is integrated [\#3427](https://github.com/pypeclub/OpenPype/pull/3427) @@ -59,8 +54,8 @@ - General: Move publish plugin and publish render abstractions [\#3442](https://github.com/pypeclub/OpenPype/pull/3442) - General: Use Anatomy after move to pipeline [\#3436](https://github.com/pypeclub/OpenPype/pull/3436) - General: Anatomy moved to pipeline [\#3435](https://github.com/pypeclub/OpenPype/pull/3435) -- Fusion: Use client query functions [\#3380](https://github.com/pypeclub/OpenPype/pull/3380) - Resolve: Use client query functions [\#3379](https://github.com/pypeclub/OpenPype/pull/3379) +- Photoshop: Use client query functions [\#3375](https://github.com/pypeclub/OpenPype/pull/3375) ## [3.12.0](https://github.com/pypeclub/OpenPype/tree/3.12.0) (2022-06-28) @@ -68,6 +63,7 @@ ### πŸ“– Documentation +- Docs: Added minimal permissions for MongoDB [\#3441](https://github.com/pypeclub/OpenPype/pull/3441) - Fix typo in documentation: pyenv on mac [\#3417](https://github.com/pypeclub/OpenPype/pull/3417) - Linux: update OIIO package [\#3401](https://github.com/pypeclub/OpenPype/pull/3401) @@ -100,9 +96,9 @@ - Hiero: Use client query functions [\#3393](https://github.com/pypeclub/OpenPype/pull/3393) - Nuke: Use client query functions [\#3391](https://github.com/pypeclub/OpenPype/pull/3391) - Maya: Use client query functions [\#3385](https://github.com/pypeclub/OpenPype/pull/3385) +- Fusion: Use client query functions [\#3380](https://github.com/pypeclub/OpenPype/pull/3380) - Harmony: Use client query functions [\#3378](https://github.com/pypeclub/OpenPype/pull/3378) - Celaction: Use client query functions [\#3376](https://github.com/pypeclub/OpenPype/pull/3376) -- Photoshop: Use client query functions [\#3375](https://github.com/pypeclub/OpenPype/pull/3375) - AfterEffects: Use client query functions [\#3374](https://github.com/pypeclub/OpenPype/pull/3374) **Merged pull requests:** @@ -124,7 +120,6 @@ - Harmony: audio validator has wrong logic [\#3364](https://github.com/pypeclub/OpenPype/pull/3364) - Nuke: Fix missing variable in extract thumbnail [\#3363](https://github.com/pypeclub/OpenPype/pull/3363) - Nuke: Fix precollect writes [\#3361](https://github.com/pypeclub/OpenPype/pull/3361) -- AE- fix validate\_scene\_settings and renderLocal [\#3358](https://github.com/pypeclub/OpenPype/pull/3358) ## [3.11.0](https://github.com/pypeclub/OpenPype/tree/3.11.0) (2022-06-17) diff --git a/openpype/version.py b/openpype/version.py index 08bb4706cc..26c7e4fa34 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.12.1-nightly.5" +__version__ = "3.12.1-nightly.6" diff --git a/pyproject.toml b/pyproject.toml index 1251299612..ed7799a7ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "OpenPype" -version = "3.12.1-nightly.5" # OpenPype +version = "3.12.1-nightly.6" # OpenPype description = "Open VFX and Animation pipeline with support." authors = ["OpenPype Team "] license = "MIT License" From f9b23a27d20b07b549fcf43277bfc796d73e6da8 Mon Sep 17 00:00:00 2001 From: OpenPype Date: Wed, 13 Jul 2022 07:43:12 +0000 Subject: [PATCH 49/64] [Automated] Release --- CHANGELOG.md | 16 ++++++++++------ openpype/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59c51396e3..cc5bf39a29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog -## [3.12.1-nightly.6](https://github.com/pypeclub/OpenPype/tree/HEAD) +## [3.12.1](https://github.com/pypeclub/OpenPype/tree/3.12.1) (2022-07-13) -[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.12.0...HEAD) +[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.12.0...3.12.1) + +### πŸ“– Documentation + +- Docs: Added minimal permissions for MongoDB [\#3441](https://github.com/pypeclub/OpenPype/pull/3441) **πŸ†• New features** @@ -36,11 +40,13 @@ - Resolve: removed few bugs [\#3464](https://github.com/pypeclub/OpenPype/pull/3464) - General: Delete old versions is safer when ftrack is disabled [\#3462](https://github.com/pypeclub/OpenPype/pull/3462) - Nuke: fixing metadata slate TC difference [\#3455](https://github.com/pypeclub/OpenPype/pull/3455) +- Nuke: prerender reviewable fails [\#3450](https://github.com/pypeclub/OpenPype/pull/3450) - Maya: fix hashing in Python 3 for tile rendering [\#3447](https://github.com/pypeclub/OpenPype/pull/3447) - LogViewer: Escape html characters in log message [\#3443](https://github.com/pypeclub/OpenPype/pull/3443) - Nuke: Slate frame is integrated [\#3427](https://github.com/pypeclub/OpenPype/pull/3427) - Maya: Camera extra data - additional fix for \#3304 [\#3386](https://github.com/pypeclub/OpenPype/pull/3386) - Maya: Handle excluding `model` family from frame range validator. [\#3370](https://github.com/pypeclub/OpenPype/pull/3370) +- Harmony: audio validator has wrong logic [\#3364](https://github.com/pypeclub/OpenPype/pull/3364) **πŸ”€ Refactored code** @@ -54,8 +60,8 @@ - General: Move publish plugin and publish render abstractions [\#3442](https://github.com/pypeclub/OpenPype/pull/3442) - General: Use Anatomy after move to pipeline [\#3436](https://github.com/pypeclub/OpenPype/pull/3436) - General: Anatomy moved to pipeline [\#3435](https://github.com/pypeclub/OpenPype/pull/3435) +- Fusion: Use client query functions [\#3380](https://github.com/pypeclub/OpenPype/pull/3380) - Resolve: Use client query functions [\#3379](https://github.com/pypeclub/OpenPype/pull/3379) -- Photoshop: Use client query functions [\#3375](https://github.com/pypeclub/OpenPype/pull/3375) ## [3.12.0](https://github.com/pypeclub/OpenPype/tree/3.12.0) (2022-06-28) @@ -63,7 +69,6 @@ ### πŸ“– Documentation -- Docs: Added minimal permissions for MongoDB [\#3441](https://github.com/pypeclub/OpenPype/pull/3441) - Fix typo in documentation: pyenv on mac [\#3417](https://github.com/pypeclub/OpenPype/pull/3417) - Linux: update OIIO package [\#3401](https://github.com/pypeclub/OpenPype/pull/3401) @@ -96,9 +101,9 @@ - Hiero: Use client query functions [\#3393](https://github.com/pypeclub/OpenPype/pull/3393) - Nuke: Use client query functions [\#3391](https://github.com/pypeclub/OpenPype/pull/3391) - Maya: Use client query functions [\#3385](https://github.com/pypeclub/OpenPype/pull/3385) -- Fusion: Use client query functions [\#3380](https://github.com/pypeclub/OpenPype/pull/3380) - Harmony: Use client query functions [\#3378](https://github.com/pypeclub/OpenPype/pull/3378) - Celaction: Use client query functions [\#3376](https://github.com/pypeclub/OpenPype/pull/3376) +- Photoshop: Use client query functions [\#3375](https://github.com/pypeclub/OpenPype/pull/3375) - AfterEffects: Use client query functions [\#3374](https://github.com/pypeclub/OpenPype/pull/3374) **Merged pull requests:** @@ -117,7 +122,6 @@ **πŸ› Bug fixes** - Nuke: bake streams with slate on farm [\#3368](https://github.com/pypeclub/OpenPype/pull/3368) -- Harmony: audio validator has wrong logic [\#3364](https://github.com/pypeclub/OpenPype/pull/3364) - Nuke: Fix missing variable in extract thumbnail [\#3363](https://github.com/pypeclub/OpenPype/pull/3363) - Nuke: Fix precollect writes [\#3361](https://github.com/pypeclub/OpenPype/pull/3361) diff --git a/openpype/version.py b/openpype/version.py index 26c7e4fa34..c7b0de0381 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.12.1-nightly.6" +__version__ = "3.12.1" diff --git a/pyproject.toml b/pyproject.toml index ed7799a7ba..4bdaaab4ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "OpenPype" -version = "3.12.1-nightly.6" # OpenPype +version = "3.12.1" # OpenPype description = "Open VFX and Animation pipeline with support." authors = ["OpenPype Team "] license = "MIT License" From c9e714a7afc37f98c9cb4792fa42b53b1b2272c3 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 12:00:21 +0200 Subject: [PATCH 50/64] implemented tray publisher host using HostBase --- openpype/hosts/traypublisher/api/__init__.py | 16 +----- openpype/hosts/traypublisher/api/pipeline.py | 60 ++++++++++---------- openpype/tools/traypublisher/window.py | 13 +++-- 3 files changed, 41 insertions(+), 48 deletions(-) diff --git a/openpype/hosts/traypublisher/api/__init__.py b/openpype/hosts/traypublisher/api/__init__.py index c461c0c526..4e7284b09a 100644 --- a/openpype/hosts/traypublisher/api/__init__.py +++ b/openpype/hosts/traypublisher/api/__init__.py @@ -1,20 +1,8 @@ from .pipeline import ( - install, - ls, - - set_project_name, - get_context_title, - get_context_data, - update_context_data, + TrayPublisherHost, ) __all__ = ( - "install", - "ls", - - "set_project_name", - "get_context_title", - "get_context_data", - "update_context_data", + "TrayPublisherHost", ) diff --git a/openpype/hosts/traypublisher/api/pipeline.py b/openpype/hosts/traypublisher/api/pipeline.py index 954a0bae47..2d9db7801e 100644 --- a/openpype/hosts/traypublisher/api/pipeline.py +++ b/openpype/hosts/traypublisher/api/pipeline.py @@ -9,6 +9,8 @@ from openpype.pipeline import ( register_creator_plugin_path, legacy_io, ) +from openpype.host import HostBase, INewPublisher + ROOT_DIR = os.path.dirname(os.path.dirname( os.path.abspath(__file__) @@ -17,6 +19,35 @@ PUBLISH_PATH = os.path.join(ROOT_DIR, "plugins", "publish") CREATE_PATH = os.path.join(ROOT_DIR, "plugins", "create") +class TrayPublisherHost(HostBase, INewPublisher): + name = "traypublisher" + + def install(self): + os.environ["AVALON_APP"] = self.name + legacy_io.Session["AVALON_APP"] = self.name + + pyblish.api.register_host("traypublisher") + pyblish.api.register_plugin_path(PUBLISH_PATH) + register_creator_plugin_path(CREATE_PATH) + + def get_context_title(self): + return HostContext.get_project_name() + + def get_context_data(self): + return HostContext.get_context_data() + + def update_context_data(self, data, changes): + HostContext.save_context_data(data, changes) + + def set_project_name(self, project_name): + # TODO Deregister project specific plugins and register new project + # plugins + os.environ["AVALON_PROJECT"] = project_name + legacy_io.Session["AVALON_PROJECT"] = project_name + legacy_io.install() + HostContext.set_project_name(project_name) + + class HostContext: _context_json_path = None @@ -150,32 +181,3 @@ def get_context_data(): def update_context_data(data, changes): HostContext.save_context_data(data) - - -def get_context_title(): - return HostContext.get_project_name() - - -def ls(): - """Probably will never return loaded containers.""" - return [] - - -def install(): - """This is called before a project is known. - - Project is defined with 'set_project_name'. - """ - os.environ["AVALON_APP"] = "traypublisher" - - pyblish.api.register_host("traypublisher") - pyblish.api.register_plugin_path(PUBLISH_PATH) - register_creator_plugin_path(CREATE_PATH) - - -def set_project_name(project_name): - # TODO Deregister project specific plugins and register new project plugins - os.environ["AVALON_PROJECT"] = project_name - legacy_io.Session["AVALON_PROJECT"] = project_name - legacy_io.install() - HostContext.set_project_name(project_name) diff --git a/openpype/tools/traypublisher/window.py b/openpype/tools/traypublisher/window.py index 5934c4aa8a..cc33287091 100644 --- a/openpype/tools/traypublisher/window.py +++ b/openpype/tools/traypublisher/window.py @@ -12,9 +12,7 @@ from openpype.pipeline import ( install_host, AvalonMongoDB, ) -from openpype.hosts.traypublisher import ( - api as traypublisher -) +from openpype.hosts.traypublisher.api import TrayPublisherHost from openpype.tools.publisher import PublisherWindow from openpype.tools.utils.constants import PROJECT_NAME_ROLE from openpype.tools.utils.models import ( @@ -111,9 +109,13 @@ class StandaloneOverlayWidget(QtWidgets.QFrame): if project_name: self._set_project(project_name) + @property + def host(self): + return self._publisher_window.controller.host + def _set_project(self, project_name): self._project_name = project_name - traypublisher.set_project_name(project_name) + self.host.set_project_name(project_name) self.setVisible(False) self.project_selected.emit(project_name) @@ -190,7 +192,8 @@ class TrayPublishWindow(PublisherWindow): def main(): - install_host(traypublisher) + host = TrayPublisherHost() + install_host(host) app = QtWidgets.QApplication([]) window = TrayPublishWindow() window.show() From 74cd74f053023324a9a6c46e67cfd5023147cda6 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 12:00:29 +0200 Subject: [PATCH 51/64] creatos have access to host --- openpype/pipeline/create/creator_plugins.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/pipeline/create/creator_plugins.py b/openpype/pipeline/create/creator_plugins.py index 91b9d80234..52c76db5ef 100644 --- a/openpype/pipeline/create/creator_plugins.py +++ b/openpype/pipeline/create/creator_plugins.py @@ -102,6 +102,10 @@ class BaseCreator: return self.create_context.project_name + @property + def host(self): + return self.create_context.host + def get_group_label(self): """Group label under which are instances grouped in UI. From 2fbe33750df3c25b1089208bf093326720fec21e Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 12:01:55 +0200 Subject: [PATCH 52/64] implemented helper method to store new instance --- openpype/hosts/traypublisher/api/plugin.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/traypublisher/api/plugin.py b/openpype/hosts/traypublisher/api/plugin.py index 202664cfc6..cc93d7c157 100644 --- a/openpype/hosts/traypublisher/api/plugin.py +++ b/openpype/hosts/traypublisher/api/plugin.py @@ -37,6 +37,21 @@ class TrayPublishCreator(Creator): # Use same attributes as for instance attrobites return self.get_instance_attr_defs() + def _store_new_instance(self, new_instance): + """Tray publisher specific method to store instance. + + Instance is stored into "workfile" of traypublisher and also add it + to CreateContext. + + Args: + new_instance (CreatedInstance): Instance that should be stored. + """ + + # Host implementation of storing metadata about instance + HostContext.add_instance(new_instance.data_to_store()) + # Add instance to current context + self._add_instance_to_context(new_instance) + class SettingsCreator(TrayPublishCreator): create_allow_context_change = True @@ -58,10 +73,8 @@ class SettingsCreator(TrayPublishCreator): data["settings_creator"] = True # Create new instance new_instance = CreatedInstance(self.family, subset_name, data, self) - # Host implementation of storing metadata about instance - HostContext.add_instance(new_instance.data_to_store()) - # Add instance to current context - self._add_instance_to_context(new_instance) + + self._store_new_instance(new_instance) def get_instance_attr_defs(self): return [ From 9d6eb0d5c2efdbfbee8b40aac3e19cef87f9973e Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 12:30:09 +0200 Subject: [PATCH 53/64] added extract to file action to project list context actions --- openpype/tools/settings/settings/categories.py | 3 +++ openpype/tools/settings/settings/widgets.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/openpype/tools/settings/settings/categories.py b/openpype/tools/settings/settings/categories.py index 764f42f1a3..f42027d9e2 100644 --- a/openpype/tools/settings/settings/categories.py +++ b/openpype/tools/settings/settings/categories.py @@ -854,6 +854,9 @@ class ProjectWidget(SettingsCategoryWidget): project_list_widget.version_change_requested.connect( self._on_source_version_change ) + project_list_widget.extract_to_file_requested.connect( + self._on_extract_to_file + ) self.project_list_widget = project_list_widget diff --git a/openpype/tools/settings/settings/widgets.py b/openpype/tools/settings/settings/widgets.py index 45c21d5685..1d94094897 100644 --- a/openpype/tools/settings/settings/widgets.py +++ b/openpype/tools/settings/settings/widgets.py @@ -1008,6 +1008,7 @@ class ProjectSortFilterProxy(QtCore.QSortFilterProxyModel): class ProjectListWidget(QtWidgets.QWidget): project_changed = QtCore.Signal() version_change_requested = QtCore.Signal(str) + extract_to_file_requested = QtCore.Signal() def __init__(self, parent, only_active=False): self._parent = parent @@ -1099,6 +1100,10 @@ class ProjectListWidget(QtWidgets.QWidget): self.version_change_requested ) submenu.addAction(action) + + extract_action = QtWidgets.QAction("Extract to file", menu) + extract_action.triggered.connect(self.extract_to_file_requested) + menu.addMenu(submenu) menu.exec_(QtGui.QCursor.pos()) From 4e137c1f4bd88ad35b4df733a72f26d590c80284 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 12:33:31 +0200 Subject: [PATCH 54/64] add action to menu --- openpype/tools/settings/settings/widgets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/tools/settings/settings/widgets.py b/openpype/tools/settings/settings/widgets.py index 1d94094897..88d923c16a 100644 --- a/openpype/tools/settings/settings/widgets.py +++ b/openpype/tools/settings/settings/widgets.py @@ -1105,6 +1105,7 @@ class ProjectListWidget(QtWidgets.QWidget): extract_action.triggered.connect(self.extract_to_file_requested) menu.addMenu(submenu) + menu.addAction(extract_action) menu.exec_(QtGui.QCursor.pos()) def on_item_clicked(self, new_index): From f6129b5f5b84d03816e17cfd6489df4d4d300116 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 12:41:15 +0200 Subject: [PATCH 55/64] trigger 'openpype.project.structure.created' topic on finish of create project structure action --- .../event_handlers_user/action_create_project_structure.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openpype/modules/ftrack/event_handlers_user/action_create_project_structure.py b/openpype/modules/ftrack/event_handlers_user/action_create_project_structure.py index ebea8872f9..df914de854 100644 --- a/openpype/modules/ftrack/event_handlers_user/action_create_project_structure.py +++ b/openpype/modules/ftrack/event_handlers_user/action_create_project_structure.py @@ -84,6 +84,11 @@ class CreateProjectFolders(BaseAction): create_project_folders(basic_paths, project_name) self.create_ftrack_entities(basic_paths, project_entity) + self.trigger_event( + "openpype.project.structure.created", + {"project_name": project_name} + ) + except Exception as exc: self.log.warning("Creating of structure crashed.", exc_info=True) session.rollback() From 450a20dcca1b74d01c23beebdd170b356a8ccb34 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 13 Jul 2022 15:28:01 +0200 Subject: [PATCH 56/64] OP-3481 - add source key to Note formatting Allows to fill value from instance.data["source"] as a {source} in Ftrack Note. --- openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py index 952b21546d..77a7ebdfcf 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_note.py @@ -116,6 +116,7 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin): "app_name": app_name, "app_label": app_label, "published_paths": "
".join(sorted(published_paths)), + "source": instance.data.get("source", '') } comment = template.format(**format_data) if not comment: From 5d0e68385e13f8f69397a8f78c4c179307ffe1fe Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 13 Jul 2022 15:28:15 +0200 Subject: [PATCH 57/64] OP-3481 - add source key to Note formatting Allows to fill value from instance.data["source"] as a {source} in Ftrack Note. --- .../entities/schemas/projects_schema/schema_project_ftrack.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f8f9d5093d..c0069dcdab 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json @@ -822,7 +822,7 @@ }, { "type": "label", - "label": "Template may contain formatting keys intent, comment, host_name, app_name, app_label and published_paths." + "label": "Template may contain formatting keys intent, comment, host_name, app_name, app_label, published_paths and source." }, { "type": "text", From 0047ca458c3e6febe9b9826fd8938bea4c05339d Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 13 Jul 2022 15:30:10 +0200 Subject: [PATCH 58/64] OP-3481 - simple creators fill 'source' key Source filepats used to fill source value used later in Ftrack note or version in DB. --- .../traypublisher/plugins/publish/collect_simple_instances.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py index b2be43c701..2fb6fcf3ce 100644 --- a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py +++ b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py @@ -45,6 +45,8 @@ class CollectSettingsSimpleInstances(pyblish.api.InstancePlugin): "files": filenames }) + instance.data["source"] = filepaths + self.log.debug("Created Simple Settings instance {}".format( instance.data )) From dbcf9097d38d8d7a4b094e161291859905ef3a3d Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 13 Jul 2022 15:43:22 +0200 Subject: [PATCH 59/64] OP-3481 - fix source, must be string --- .../traypublisher/plugins/publish/collect_simple_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py index 2fb6fcf3ce..1f473ff71c 100644 --- a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py +++ b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py @@ -45,7 +45,7 @@ class CollectSettingsSimpleInstances(pyblish.api.InstancePlugin): "files": filenames }) - instance.data["source"] = filepaths + instance.data["source"] = "\n".join(filepaths) self.log.debug("Created Simple Settings instance {}".format( instance.data From d294ad51748fa5ba02c6ca387f1c3af7ec1ba855 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 16:10:01 +0200 Subject: [PATCH 60/64] add also default values of missing attribute definitions --- openpype/pipeline/create/context.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/openpype/pipeline/create/context.py b/openpype/pipeline/create/context.py index aecdb04635..a7a8eba383 100644 --- a/openpype/pipeline/create/context.py +++ b/openpype/pipeline/create/context.py @@ -29,6 +29,7 @@ UpdateData = collections.namedtuple("UpdateData", ["instance", "changes"]) class ImmutableKeyError(TypeError): """Accessed key is immutable so does not allow changes or removements.""" + def __init__(self, key, msg=None): self.immutable_key = key if not msg: @@ -40,6 +41,7 @@ class ImmutableKeyError(TypeError): class HostMissRequiredMethod(Exception): """Host does not have implemented required functions for creation.""" + def __init__(self, host, missing_methods): self.missing_methods = missing_methods self.host = host @@ -66,6 +68,7 @@ class InstanceMember: TODO: Implement and use! """ + def __init__(self, instance, name): self.instance = instance @@ -94,6 +97,7 @@ class AttributeValues: values(dict): Values after possible conversion. origin_data(dict): Values loaded from host before conversion. """ + def __init__(self, attr_defs, values, origin_data=None): from openpype.lib.attribute_definitions import UnknownDef @@ -174,6 +178,10 @@ class AttributeValues: output = {} for key in self._data: output[key] = self[key] + + for key, attr_def in self._attr_defs_by_key.items(): + if key not in output: + output[key] = attr_def.default return output @staticmethod @@ -196,6 +204,7 @@ class CreatorAttributeValues(AttributeValues): Args: instance (CreatedInstance): Instance for which are values hold. """ + def __init__(self, instance, *args, **kwargs): self.instance = instance super(CreatorAttributeValues, self).__init__(*args, **kwargs) @@ -211,6 +220,7 @@ class PublishAttributeValues(AttributeValues): publish_attributes(PublishAttributes): Wrapper for multiple publish attributes is used as parent object. """ + def __init__(self, publish_attributes, *args, **kwargs): self.publish_attributes = publish_attributes super(PublishAttributeValues, self).__init__(*args, **kwargs) @@ -232,6 +242,7 @@ class PublishAttributes: attr_plugins(list): List of publish plugins that may have defined attribute definitions. """ + def __init__(self, parent, origin_data, attr_plugins=None): self.parent = parent self._origin_data = copy.deepcopy(origin_data) @@ -270,6 +281,7 @@ class PublishAttributes: key(str): Plugin name. default: Default value if plugin was not found. """ + if key not in self._data: return default @@ -287,11 +299,13 @@ class PublishAttributes: def plugin_names_order(self): """Plugin names order by their 'order' attribute.""" + for name in self._plugin_names_order: yield name def data_to_store(self): """Convert attribute values to "data to store".""" + output = {} for key, attr_value in self._data.items(): output[key] = attr_value.data_to_store() @@ -299,6 +313,7 @@ class PublishAttributes: def changes(self): """Return changes per each key.""" + changes = {} for key, attr_val in self._data.items(): attr_changes = attr_val.changes() @@ -314,6 +329,7 @@ class PublishAttributes: def set_publish_plugins(self, attr_plugins): """Set publish plugins attribute definitions.""" + self._plugin_names_order = [] self._missing_plugins = [] self.attr_plugins = attr_plugins or [] @@ -365,6 +381,7 @@ class CreatedInstance: `openpype.pipeline.registered_host`. new(bool): Is instance new. """ + # Keys that can't be changed or removed from data after loading using # creator. # - 'creator_attributes' and 'publish_attributes' can change values of @@ -566,6 +583,7 @@ class CreatedInstance: @property def id(self): """Instance identifier.""" + return self._data["instance_id"] @property @@ -574,10 +592,12 @@ class CreatedInstance: Access to data is needed to modify values. """ + return self def changes(self): """Calculate and return changes.""" + changes = {} new_keys = set() for key, new_value in self._data.items(): From ba6afb8be5107affa0179a1ac4f7c64241ba35a3 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 16:10:22 +0200 Subject: [PATCH 61/64] added jpeg extension to default settings --- openpype/settings/defaults/project_settings/traypublisher.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/settings/defaults/project_settings/traypublisher.json b/openpype/settings/defaults/project_settings/traypublisher.json index 5afaaee78c..d3e8028cdb 100644 --- a/openpype/settings/defaults/project_settings/traypublisher.json +++ b/openpype/settings/defaults/project_settings/traypublisher.json @@ -116,6 +116,7 @@ ".png", ".dpx", ".jpg", + ".jpeg", ".tiff", ".tif", ".mov", @@ -158,6 +159,7 @@ "extensions": [ ".exr", ".jpg", + ".jpeg", ".dpx", ".bmp", ".tif", From ac118ddefd8d2d0d576de43115d914e2e403f925 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 16:10:42 +0200 Subject: [PATCH 62/64] fill "source" in simple instances --- .../plugins/publish/collect_simple_instances.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py index b2be43c701..bbd0221c88 100644 --- a/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py +++ b/openpype/hosts/traypublisher/plugins/publish/collect_simple_instances.py @@ -1,4 +1,6 @@ import os + +import clique import pyblish.api @@ -29,6 +31,14 @@ class CollectSettingsSimpleInstances(pyblish.api.InstancePlugin): for filename in filepath_item["filenames"] ] + cols, rems = clique.assemble(filepaths) + source = None + if cols: + source = cols[0].format("{head}{padding}{tail}") + elif rems: + source = rems[0] + + instance.data["source"] = source instance.data["sourceFilepaths"] = filepaths instance.data["stagingDir"] = filepath_item["directory"] From 5592b4fb83ad0f3f4b5e222ed0f8361d0ebee346 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Jul 2022 16:10:59 +0200 Subject: [PATCH 63/64] fill representation in instance data update --- openpype/plugins/publish/collect_from_create_context.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openpype/plugins/publish/collect_from_create_context.py b/openpype/plugins/publish/collect_from_create_context.py index f6ead98809..d2be633cbe 100644 --- a/openpype/plugins/publish/collect_from_create_context.py +++ b/openpype/plugins/publish/collect_from_create_context.py @@ -47,12 +47,11 @@ class CollectFromCreateContext(pyblish.api.ContextPlugin): "label": subset, "name": subset, "family": in_data["family"], - "families": instance_families + "families": instance_families, + "representations": [] }) for key, value in in_data.items(): if key not in instance.data: instance.data[key] = value self.log.info("collected instance: {}".format(instance.data)) self.log.info("parsing data: {}".format(in_data)) - - instance.data["representations"] = list() From 731aecd71c58153dc45586ff67bc362d37e9f281 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 13 Jul 2022 21:48:50 +0200 Subject: [PATCH 64/64] sort plugins separatelly and don't count on order from report --- .../publisher/publish_report_viewer/report_items.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openpype/tools/publisher/publish_report_viewer/report_items.py b/openpype/tools/publisher/publish_report_viewer/report_items.py index b47d14da25..8a01569723 100644 --- a/openpype/tools/publisher/publish_report_viewer/report_items.py +++ b/openpype/tools/publisher/publish_report_viewer/report_items.py @@ -83,10 +83,8 @@ class PublishReport: logs = [] plugins_items_by_id = {} - plugins_id_order = [] for plugin_data in data["plugins_data"]: item = PluginItem(plugin_data) - plugins_id_order.append(item.id) plugins_items_by_id[item.id] = item for instance_data_item in plugin_data["instances_data"]: instance_id = instance_data_item["id"] @@ -95,6 +93,14 @@ class PublishReport: copy.deepcopy(log_item_data), item.id, instance_id ) logs.append(log_item) + sorted_plugins = sorted( + plugins_items_by_id.values(), + key=lambda item: item.order + ) + plugins_id_order = [ + plugin_item.id + for plugin_item in sorted_plugins + ] logs_by_instance_id = collections.defaultdict(list) for log_item in logs: