From 190840fe052d0ee35ad9585d18ebc06eec916808 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 15 Jan 2024 12:16:50 +0000 Subject: [PATCH 01/25] Missing nuke family Windows arguments --- .../applications/server/applications.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server_addon/applications/server/applications.json b/server_addon/applications/server/applications.json index 35f1b4cfbb..d2e2d942c6 100644 --- a/server_addon/applications/server/applications.json +++ b/server_addon/applications/server/applications.json @@ -307,7 +307,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--nukeassist"], "darwin": [], "linux": [] }, @@ -329,7 +329,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--nukeassist"], "darwin": [], "linux": [] }, @@ -351,7 +351,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--nukeassist"], "darwin": [], "linux": [] }, @@ -382,7 +382,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--nukex"], "darwin": [], "linux": [] }, @@ -404,7 +404,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--nukex"], "darwin": [], "linux": [] }, @@ -426,7 +426,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--nukex"], "darwin": [], "linux": [] }, @@ -457,7 +457,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--studio"], "darwin": [], "linux": [] }, @@ -479,7 +479,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--studio"], "darwin": [], "linux": [] }, @@ -501,7 +501,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--studio"], "darwin": [], "linux": [] }, @@ -532,7 +532,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--hiero"], "darwin": [], "linux": [] }, @@ -554,7 +554,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--hiero"], "darwin": [], "linux": [] }, @@ -576,7 +576,7 @@ ] }, "arguments": { - "windows": [], + "windows": ["--hiero"], "darwin": [], "linux": [] }, From e9be330393cb5a50fcbc257ecf4ed0c8eb335804 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 15 Jan 2024 14:56:29 +0000 Subject: [PATCH 02/25] Add Linux arguments. --- .../applications/server/applications.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server_addon/applications/server/applications.json b/server_addon/applications/server/applications.json index d2e2d942c6..b0b12b2003 100644 --- a/server_addon/applications/server/applications.json +++ b/server_addon/applications/server/applications.json @@ -309,7 +309,7 @@ "arguments": { "windows": ["--nukeassist"], "darwin": [], - "linux": [] + "linux": ["--nukeassist"] }, "environment": "{}", "use_python_2": false @@ -331,7 +331,7 @@ "arguments": { "windows": ["--nukeassist"], "darwin": [], - "linux": [] + "linux": ["--nukeassist"] }, "environment": "{}", "use_python_2": false @@ -353,7 +353,7 @@ "arguments": { "windows": ["--nukeassist"], "darwin": [], - "linux": [] + "linux": ["--nukeassist"] }, "environment": "{}", "use_python_2": false @@ -384,7 +384,7 @@ "arguments": { "windows": ["--nukex"], "darwin": [], - "linux": [] + "linux": ["--nukex"] }, "environment": "{}", "use_python_2": false @@ -406,7 +406,7 @@ "arguments": { "windows": ["--nukex"], "darwin": [], - "linux": [] + "linux": ["--nukex"] }, "environment": "{}", "use_python_2": false @@ -428,7 +428,7 @@ "arguments": { "windows": ["--nukex"], "darwin": [], - "linux": [] + "linux": ["--nukex"] }, "environment": "{}", "use_python_2": false @@ -459,7 +459,7 @@ "arguments": { "windows": ["--studio"], "darwin": [], - "linux": [] + "linux": ["--studio"] }, "environment": "{}", "use_python_2": false @@ -481,7 +481,7 @@ "arguments": { "windows": ["--studio"], "darwin": [], - "linux": [] + "linux": ["--studio"] }, "environment": "{}", "use_python_2": false @@ -503,7 +503,7 @@ "arguments": { "windows": ["--studio"], "darwin": [], - "linux": [] + "linux": ["--studio"] }, "environment": "{}", "use_python_2": false @@ -534,7 +534,7 @@ "arguments": { "windows": ["--hiero"], "darwin": [], - "linux": [] + "linux": ["--hiero"] }, "environment": "{}", "use_python_2": false @@ -556,7 +556,7 @@ "arguments": { "windows": ["--hiero"], "darwin": [], - "linux": [] + "linux": ["--hiero"] }, "environment": "{}", "use_python_2": false @@ -578,7 +578,7 @@ "arguments": { "windows": ["--hiero"], "darwin": [], - "linux": [] + "linux": ["--hiero"] }, "environment": "{}", "use_python_2": false From 25b33c60f0e86f7b3303bfdff92b563bc13180b6 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 16 Jan 2024 16:49:31 +0100 Subject: [PATCH 03/25] add missing '.tif' extension --- openpype/lib/transcoding.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/openpype/lib/transcoding.py b/openpype/lib/transcoding.py index 03fd91bec2..c8ddbde061 100644 --- a/openpype/lib/transcoding.py +++ b/openpype/lib/transcoding.py @@ -44,17 +44,17 @@ XML_CHAR_REF_REGEX_HEX = re.compile(r"&#x?[0-9a-fA-F]+;") ARRAY_TYPE_REGEX = re.compile(r"^(int|float|string)\[\d+\]$") IMAGE_EXTENSIONS = { - ".ani", ".anim", ".apng", ".art", ".bmp", ".bpg", ".bsave", ".cal", - ".cin", ".cpc", ".cpt", ".dds", ".dpx", ".ecw", ".exr", ".fits", - ".flic", ".flif", ".fpx", ".gif", ".hdri", ".hevc", ".icer", - ".icns", ".ico", ".cur", ".ics", ".ilbm", ".jbig", ".jbig2", - ".jng", ".jpeg", ".jpeg-ls", ".jpeg", ".2000", ".jpg", ".xr", - ".jpeg", ".xt", ".jpeg-hdr", ".kra", ".mng", ".miff", ".nrrd", - ".ora", ".pam", ".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".pgf", - ".pictor", ".png", ".psd", ".psb", ".psp", ".qtvr", ".ras", - ".rgbe", ".logluv", ".tiff", ".sgi", ".tga", ".tiff", ".tiff/ep", - ".tiff/it", ".ufo", ".ufp", ".wbmp", ".webp", ".xbm", ".xcf", - ".xpm", ".xwd" + ".ani", ".anim", ".apng", ".art", ".bmp", ".bpg", ".bsave", + ".cal", ".cin", ".cpc", ".cpt", ".dds", ".dpx", ".ecw", ".exr", + ".fits", ".flic", ".flif", ".fpx", ".gif", ".hdri", ".hevc", + ".icer", ".icns", ".ico", ".cur", ".ics", ".ilbm", ".jbig", ".jbig2", + ".jng", ".jpeg", ".jpeg-ls", ".jpeg-hdr", ".2000", ".jpg", + ".kra", ".logluv", ".mng", ".miff", ".nrrd", ".ora", + ".pam", ".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".pgf", + ".pictor", ".png", ".psd", ".psb", ".psp", ".qtvr", + ".ras", ".rgbe", ".sgi", ".tga", + ".tif", ".tiff", ".tiff/ep", ".tiff/it", ".ufo", ".ufp", + ".wbmp", ".webp", ".xr", ".xt", ".xbm", ".xcf", ".xpm", ".xwd" } VIDEO_EXTENSIONS = { From dcf8805cfe2aca6f2615de1a7c18988d0efedae6 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 16 Jan 2024 16:53:26 +0000 Subject: [PATCH 04/25] Add settings for effect categories --- .../hiero/server/settings/publish_plugins.py | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/server_addon/hiero/server/settings/publish_plugins.py b/server_addon/hiero/server/settings/publish_plugins.py index a85e62724b..07778b8ebe 100644 --- a/server_addon/hiero/server/settings/publish_plugins.py +++ b/server_addon/hiero/server/settings/publish_plugins.py @@ -1,5 +1,7 @@ -from pydantic import Field -from ayon_server.settings import BaseSettingsModel +from pydantic import Field, validator +from ayon_server.settings import ( + BaseSettingsModel, ensure_unique_names, normalize_name +) class CollectInstanceVersionModel(BaseSettingsModel): @@ -9,6 +11,30 @@ class CollectInstanceVersionModel(BaseSettingsModel): ) +class CollectClipEffectsDefModel(BaseSettingsModel): + _layout = "expanded" + name: str = Field("", title="Name") + effect_classes: list[str] = Field( + default_factory=list, title="Effect Classes" + ) + + @validator("name") + def validate_name(cls, value): + """Ensure name does not contain weird characters""" + return normalize_name(value) + + +class CollectClipEffectsModel(BaseSettingsModel): + effect_categories: list[CollectClipEffectsDefModel] = Field( + default_factory=list, title="Effect Categories" + ) + + @validator("effect_categories") + def validate_unique_outputs(cls, value): + ensure_unique_names(value) + return value + + class ExtractReviewCutUpVideoModel(BaseSettingsModel): enabled: bool = Field( True, @@ -25,6 +51,10 @@ class PublishPuginsModel(BaseSettingsModel): default_factory=CollectInstanceVersionModel, title="Collect Instance Version" ) + CollectClipEffects: CollectClipEffectsModel = Field( + default_factory=CollectClipEffectsModel, + title="Collect Clip Effects" + ) """# TODO: enhance settings with host api: Rename class name and plugin name to match title (it makes more sense) From 9c8a4a7b6cccc2fd112b6c41f1e4c10d7f94f6e4 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 16 Jan 2024 16:53:51 +0000 Subject: [PATCH 05/25] Categorize effects from settings. --- .../plugins/publish/collect_clip_effects.py | 71 ++++++++++++++----- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py index fcb1ab27a0..89dc66d73c 100644 --- a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py +++ b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py @@ -70,29 +70,62 @@ class CollectClipEffects(pyblish.api.InstancePlugin): subset_split.insert(0, "effect") - name = "".join(subset_split) + effect_categories = { + x["name"]: x["effect_classes"] for x in self.effect_categories + } - # create new instance and inherit data - data = {} - for key, value in instance.data.items(): - if "clipEffectItems" in key: + category_by_effect = {} + for key, values in effect_categories.items(): + for cls in values: + category_by_effect[cls] = key + + effects_categorized = {k: {} for k in effect_categories.keys()} + for key, value in effects.items(): + if key == "assignTo": continue - data[key] = value - # change names - data["subset"] = name - data["family"] = family - data["families"] = [family] - data["name"] = data["subset"] + "_" + data["asset"] - data["label"] = "{} - {}".format( - data['asset'], data["subset"] - ) - data["effects"] = effects + # Some classes can have a number in them. Like Text2. + found_cls = None + for cls in category_by_effect.keys(): + if value["class"].startswith(cls): + found_cls = cls - # create new instance - _instance = instance.context.create_instance(**data) - self.log.info("Created instance `{}`".format(_instance)) - self.log.debug("instance.data `{}`".format(_instance.data)) + if found_cls is None: + continue + + effects_categorized[category_by_effect[found_cls]][key] = value + + if effects_categorized: + for key in effects_categorized.keys(): + effects_categorized[key]["assignTo"] = effects["assignTo"] + else: + effects_categorized[""] = effects + + for category, effects in effects_categorized.items(): + name = "".join(subset_split) + name += category.capitalize() + + # create new instance and inherit data + data = {} + for key, value in instance.data.items(): + if "clipEffectItems" in key: + continue + data[key] = value + + # change names + data["subset"] = name + data["family"] = family + data["families"] = [family] + data["name"] = data["subset"] + "_" + data["asset"] + data["label"] = "{} - {}".format( + data['asset'], data["subset"] + ) + data["effects"] = effects + + # create new instance + _instance = instance.context.create_instance(**data) + self.log.info("Created instance `{}`".format(_instance)) + self.log.debug("instance.data `{}`".format(_instance.data)) def test_overlap(self, effect_t_in, effect_t_out): covering_exp = bool( From b7557c754385a8a966c1b7fcce804cbcfa9e8dcf Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Wed, 17 Jan 2024 09:12:14 +0000 Subject: [PATCH 06/25] Increment version --- server_addon/applications/server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/applications/server/version.py b/server_addon/applications/server/version.py index ae7362549b..bbab0242f6 100644 --- a/server_addon/applications/server/version.py +++ b/server_addon/applications/server/version.py @@ -1 +1 @@ -__version__ = "0.1.3" +__version__ = "0.1.4" From 883eb9f4f86c49bf6e387d38fac1dcc9042c93f3 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Wed, 17 Jan 2024 09:13:03 +0000 Subject: [PATCH 07/25] Increment version --- server_addon/hiero/server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/hiero/server/version.py b/server_addon/hiero/server/version.py index 485f44ac21..3ced3581bb 100644 --- a/server_addon/hiero/server/version.py +++ b/server_addon/hiero/server/version.py @@ -1 +1 @@ -__version__ = "0.1.1" +__version__ = "0.2.1" From 7e3e567f002974436badeea5ff25bfa8db9461cf Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Wed, 17 Jan 2024 10:46:50 +0000 Subject: [PATCH 08/25] Use the new API for override context --- openpype/hosts/blender/api/capture.py | 11 +++--- .../hosts/blender/plugins/load/load_audio.py | 35 ++++++++++--------- .../plugins/publish/extract_abc_animation.py | 14 ++++---- .../plugins/publish/extract_camera_fbx.py | 26 +++++++------- .../blender/plugins/publish/extract_fbx.py | 18 +++++----- .../plugins/publish/extract_fbx_animation.py | 25 +++++++------ .../blender/plugins/publish/extract_layout.py | 23 ++++++------ 7 files changed, 81 insertions(+), 71 deletions(-) diff --git a/openpype/hosts/blender/api/capture.py b/openpype/hosts/blender/api/capture.py index bad6831143..9922140cea 100644 --- a/openpype/hosts/blender/api/capture.py +++ b/openpype/hosts/blender/api/capture.py @@ -127,8 +127,9 @@ def isolate_objects(window, objects): context = create_blender_context(selected=objects, window=window) - bpy.ops.view3d.view_axis(context, type="FRONT") - bpy.ops.view3d.localview(context) + with bpy.context.temp_override(**context): + bpy.ops.view3d.view_axis(type="FRONT") + bpy.ops.view3d.localview() deselect_all() @@ -270,10 +271,12 @@ def _independent_window(): """Create capture-window context.""" context = create_blender_context() current_windows = set(bpy.context.window_manager.windows) - bpy.ops.wm.window_new(context) + with bpy.context.temp_override(**context): + bpy.ops.wm.window_new() window = list(set(bpy.context.window_manager.windows) - current_windows)[0] context["window"] = window try: yield window finally: - bpy.ops.wm.window_close(context) + with bpy.context.temp_override(**context): + bpy.ops.wm.window_close() diff --git a/openpype/hosts/blender/plugins/load/load_audio.py b/openpype/hosts/blender/plugins/load/load_audio.py index 1e5bd39a32..367fff03f0 100644 --- a/openpype/hosts/blender/plugins/load/load_audio.py +++ b/openpype/hosts/blender/plugins/load/load_audio.py @@ -67,7 +67,8 @@ class AudioLoader(plugin.AssetLoader): oc = bpy.context.copy() oc["area"] = window_manager.windows[-1].screen.areas[0] - bpy.ops.sequencer.sound_strip_add(oc, filepath=libpath, frame_start=1) + with bpy.context.temp_override(**oc): + bpy.ops.sequencer.sound_strip_add(filepath=libpath, frame_start=1) window_manager.windows[-1].screen.areas[0].type = old_type @@ -156,17 +157,18 @@ class AudioLoader(plugin.AssetLoader): oc = bpy.context.copy() oc["area"] = window_manager.windows[-1].screen.areas[0] - # We deselect all sequencer strips, and then select the one we - # need to remove. - bpy.ops.sequencer.select_all(oc, action='DESELECT') - scene = bpy.context.scene - scene.sequence_editor.sequences_all[old_audio].select = True + with bpy.context.temp_override(**oc): + # We deselect all sequencer strips, and then select the one we + # need to remove. + bpy.ops.sequencer.select_all(action='DESELECT') + scene = bpy.context.scene + scene.sequence_editor.sequences_all[old_audio].select = True - bpy.ops.sequencer.delete(oc) - bpy.data.sounds.remove(bpy.data.sounds[old_audio]) + bpy.ops.sequencer.delete() + bpy.data.sounds.remove(bpy.data.sounds[old_audio]) - bpy.ops.sequencer.sound_strip_add( - oc, filepath=str(libpath), frame_start=1) + bpy.ops.sequencer.sound_strip_add( + filepath=str(libpath), frame_start=1) window_manager.windows[-1].screen.areas[0].type = old_type @@ -205,12 +207,13 @@ class AudioLoader(plugin.AssetLoader): oc = bpy.context.copy() oc["area"] = window_manager.windows[-1].screen.areas[0] - # We deselect all sequencer strips, and then select the one we - # need to remove. - bpy.ops.sequencer.select_all(oc, action='DESELECT') - bpy.context.scene.sequence_editor.sequences_all[audio].select = True - - bpy.ops.sequencer.delete(oc) + with bpy.context.temp_override(**oc): + # We deselect all sequencer strips, and then select the one we + # need to remove. + bpy.ops.sequencer.select_all(action='DESELECT') + scene = bpy.context.scene + scene.sequence_editor.sequences_all[audio].select = True + bpy.ops.sequencer.delete() window_manager.windows[-1].screen.areas[0].type = old_type diff --git a/openpype/hosts/blender/plugins/publish/extract_abc_animation.py b/openpype/hosts/blender/plugins/publish/extract_abc_animation.py index 6ef9b29693..2bf75aa05e 100644 --- a/openpype/hosts/blender/plugins/publish/extract_abc_animation.py +++ b/openpype/hosts/blender/plugins/publish/extract_abc_animation.py @@ -55,13 +55,13 @@ class ExtractAnimationABC( context = plugin.create_blender_context( active=asset_group, selected=selected) - # We export the abc - bpy.ops.wm.alembic_export( - context, - filepath=filepath, - selected=True, - flatten=False - ) + with bpy.context.temp_override(**context): + # We export the abc + bpy.ops.wm.alembic_export( + filepath=filepath, + selected=True, + flatten=False + ) plugin.deselect_all() diff --git a/openpype/hosts/blender/plugins/publish/extract_camera_fbx.py b/openpype/hosts/blender/plugins/publish/extract_camera_fbx.py index ee046b7d11..f904b79ddb 100644 --- a/openpype/hosts/blender/plugins/publish/extract_camera_fbx.py +++ b/openpype/hosts/blender/plugins/publish/extract_camera_fbx.py @@ -50,19 +50,19 @@ class ExtractCamera(publish.Extractor, publish.OptionalPyblishPluginMixin): scale_length = bpy.context.scene.unit_settings.scale_length bpy.context.scene.unit_settings.scale_length = 0.01 - # We export the fbx - bpy.ops.export_scene.fbx( - context, - filepath=filepath, - use_active_collection=False, - use_selection=True, - bake_anim_use_nla_strips=False, - bake_anim_use_all_actions=False, - add_leaf_bones=False, - armature_nodetype='ROOT', - object_types={'CAMERA'}, - bake_anim_simplify_factor=0.0 - ) + with bpy.context.temp_override(**context): + # We export the fbx + bpy.ops.export_scene.fbx( + filepath=filepath, + use_active_collection=False, + use_selection=True, + bake_anim_use_nla_strips=False, + bake_anim_use_all_actions=False, + add_leaf_bones=False, + armature_nodetype='ROOT', + object_types={'CAMERA'}, + bake_anim_simplify_factor=0.0 + ) bpy.context.scene.unit_settings.scale_length = scale_length diff --git a/openpype/hosts/blender/plugins/publish/extract_fbx.py b/openpype/hosts/blender/plugins/publish/extract_fbx.py index 4ae6501f7d..aed6df1d3d 100644 --- a/openpype/hosts/blender/plugins/publish/extract_fbx.py +++ b/openpype/hosts/blender/plugins/publish/extract_fbx.py @@ -57,15 +57,15 @@ class ExtractFBX(publish.Extractor, publish.OptionalPyblishPluginMixin): scale_length = bpy.context.scene.unit_settings.scale_length bpy.context.scene.unit_settings.scale_length = 0.01 - # We export the fbx - bpy.ops.export_scene.fbx( - context, - filepath=filepath, - use_active_collection=False, - use_selection=True, - mesh_smooth_type='FACE', - add_leaf_bones=False - ) + with bpy.context.temp_override(**context): + # We export the fbx + bpy.ops.export_scene.fbx( + filepath=filepath, + use_active_collection=False, + use_selection=True, + mesh_smooth_type='FACE', + add_leaf_bones=False + ) bpy.context.scene.unit_settings.scale_length = scale_length diff --git a/openpype/hosts/blender/plugins/publish/extract_fbx_animation.py b/openpype/hosts/blender/plugins/publish/extract_fbx_animation.py index 4fc8230a1b..1cb8dac0cf 100644 --- a/openpype/hosts/blender/plugins/publish/extract_fbx_animation.py +++ b/openpype/hosts/blender/plugins/publish/extract_fbx_animation.py @@ -153,17 +153,20 @@ class ExtractAnimationFBX( override = plugin.create_blender_context( active=root, selected=[root, armature]) - bpy.ops.export_scene.fbx( - override, - filepath=filepath, - use_active_collection=False, - use_selection=True, - bake_anim_use_nla_strips=False, - bake_anim_use_all_actions=False, - add_leaf_bones=False, - armature_nodetype='ROOT', - object_types={'EMPTY', 'ARMATURE'} - ) + + with bpy.context.temp_override(**override): + # We export the fbx + bpy.ops.export_scene.fbx( + filepath=filepath, + use_active_collection=False, + use_selection=True, + bake_anim_use_nla_strips=False, + bake_anim_use_all_actions=False, + add_leaf_bones=False, + armature_nodetype='ROOT', + object_types={'EMPTY', 'ARMATURE'} + ) + armature.name = armature_name asset_group.name = asset_group_name root.select_set(True) diff --git a/openpype/hosts/blender/plugins/publish/extract_layout.py b/openpype/hosts/blender/plugins/publish/extract_layout.py index 3e8978c8d3..383c3bdcc5 100644 --- a/openpype/hosts/blender/plugins/publish/extract_layout.py +++ b/openpype/hosts/blender/plugins/publish/extract_layout.py @@ -80,17 +80,18 @@ class ExtractLayout(publish.Extractor, publish.OptionalPyblishPluginMixin): override = plugin.create_blender_context( active=asset, selected=[asset, obj]) - bpy.ops.export_scene.fbx( - override, - filepath=filepath, - use_active_collection=False, - use_selection=True, - bake_anim_use_nla_strips=False, - bake_anim_use_all_actions=False, - add_leaf_bones=False, - armature_nodetype='ROOT', - object_types={'EMPTY', 'ARMATURE'} - ) + with bpy.context.temp_override(**override): + # We export the fbx + bpy.ops.export_scene.fbx( + filepath=filepath, + use_active_collection=False, + use_selection=True, + bake_anim_use_nla_strips=False, + bake_anim_use_all_actions=False, + add_leaf_bones=False, + armature_nodetype='ROOT', + object_types={'EMPTY', 'ARMATURE'} + ) obj.name = armature_name asset.name = asset_group_name asset.select_set(False) From 1d7f23ab72b83b94fd951426c392035a877fbbce Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 19 Jan 2024 09:47:17 +0200 Subject: [PATCH 09/25] include model product type --- openpype/hosts/houdini/plugins/load/load_fbx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/load/load_fbx.py b/openpype/hosts/houdini/plugins/load/load_fbx.py index cac22d62d4..649c2e9995 100644 --- a/openpype/hosts/houdini/plugins/load/load_fbx.py +++ b/openpype/hosts/houdini/plugins/load/load_fbx.py @@ -16,7 +16,7 @@ class FbxLoader(load.LoaderPlugin): order = -10 - families = ["staticMesh", "fbx"] + families = ["model", "staticMesh", "fbx"] representations = ["fbx"] def load(self, context, name=None, namespace=None, data=None): From 04c072947c7c7e5f93dc21ad2afd9434c44f2b95 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 19 Jan 2024 10:47:37 +0200 Subject: [PATCH 10/25] BigRoy's Comment - Make it able to load any FBX file --- openpype/hosts/houdini/plugins/load/load_fbx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/load/load_fbx.py b/openpype/hosts/houdini/plugins/load/load_fbx.py index 649c2e9995..894ac62b3e 100644 --- a/openpype/hosts/houdini/plugins/load/load_fbx.py +++ b/openpype/hosts/houdini/plugins/load/load_fbx.py @@ -16,8 +16,9 @@ class FbxLoader(load.LoaderPlugin): order = -10 - families = ["model", "staticMesh", "fbx"] - representations = ["fbx"] + families = ["*"] + representations = ["*"] + extensions = {"fbx"} def load(self, context, name=None, namespace=None, data=None): From 5a524b7fd99a7226e450eac2d7a12c2e239cf900 Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Fri, 19 Jan 2024 16:27:33 +0000 Subject: [PATCH 11/25] Restore actions to objects after update --- .../hosts/blender/plugins/load/load_blend.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/blender/plugins/load/load_blend.py b/openpype/hosts/blender/plugins/load/load_blend.py index 2d5ac18149..4abe4a6afb 100644 --- a/openpype/hosts/blender/plugins/load/load_blend.py +++ b/openpype/hosts/blender/plugins/load/load_blend.py @@ -102,7 +102,6 @@ class BlendLoader(plugin.AssetLoader): # Link all the container children to the collection for obj in container.children_recursive: - print(obj) bpy.context.scene.collection.objects.link(obj) # Remove the library from the blend file @@ -194,8 +193,20 @@ class BlendLoader(plugin.AssetLoader): transform = asset_group.matrix_basis.copy() old_data = dict(asset_group.get(AVALON_PROPERTY)) + old_members = old_data.get("members", []) parent = asset_group.parent + actions = {} + objects_with_anim = [ + obj for obj in asset_group.children_recursive + if obj.animation_data] + for obj in objects_with_anim: + # Check if the object has an action and, if so, add it to a dict + # so we can restore it later. Save and restore the action only + # if it wasn't originally loaded from the current asset. + if obj.animation_data.action not in old_members: + actions[obj.name] = obj.animation_data.action + self.exec_remove(container) asset_group, members = self._process_data(libpath, group_name) @@ -206,6 +217,11 @@ class BlendLoader(plugin.AssetLoader): asset_group.matrix_basis = transform asset_group.parent = parent + # Restore the actions + for obj in asset_group.children_recursive: + if obj.name in actions: + obj.animation_data.action = actions[obj.name] + # Restore the old data, but reset memebers, as they don't exist anymore # This avoids a crash, because the memory addresses of those members # are not valid anymore From 372c74b40674ad254f5665e2b9c0e62234101746 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 19 Jan 2024 18:00:44 +0100 Subject: [PATCH 12/25] use correct variable in queue loop --- openpype/plugins/publish/collect_anatomy_instance_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/plugins/publish/collect_anatomy_instance_data.py b/openpype/plugins/publish/collect_anatomy_instance_data.py index 34df49ea5b..8cc1d2b5e3 100644 --- a/openpype/plugins/publish/collect_anatomy_instance_data.py +++ b/openpype/plugins/publish/collect_anatomy_instance_data.py @@ -412,7 +412,7 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): hierarchy_queue = collections.deque() hierarchy_queue.append(hierarchy_context) while hierarchy_queue: - item = hierarchy_context.popleft() + item = hierarchy_queue.popleft() if asset_name in item: return item[asset_name].get("tasks") or {} From 4d1907b94bcd01b916a7ddb70834232ff70af778 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 19 Jan 2024 18:00:59 +0100 Subject: [PATCH 13/25] create copy of hierarchy context before any manipulation --- openpype/plugins/publish/collect_anatomy_instance_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/plugins/publish/collect_anatomy_instance_data.py b/openpype/plugins/publish/collect_anatomy_instance_data.py index 8cc1d2b5e3..b1b7ecd138 100644 --- a/openpype/plugins/publish/collect_anatomy_instance_data.py +++ b/openpype/plugins/publish/collect_anatomy_instance_data.py @@ -410,7 +410,7 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): """ hierarchy_queue = collections.deque() - hierarchy_queue.append(hierarchy_context) + hierarchy_queue.append(copy.deepcopy(hierarchy_context)) while hierarchy_queue: item = hierarchy_queue.popleft() if asset_name in item: From 9a6f518a51bd34ca99c747eb3795b858235a6ce5 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 19 Jan 2024 18:01:15 +0100 Subject: [PATCH 14/25] do not store 'hierarchyContext' to variable --- openpype/plugins/publish/extract_hierarchy_to_ayon.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/plugins/publish/extract_hierarchy_to_ayon.py b/openpype/plugins/publish/extract_hierarchy_to_ayon.py index b601a3fc29..9e84daca30 100644 --- a/openpype/plugins/publish/extract_hierarchy_to_ayon.py +++ b/openpype/plugins/publish/extract_hierarchy_to_ayon.py @@ -30,8 +30,7 @@ class ExtractHierarchyToAYON(pyblish.api.ContextPlugin): if not AYON_SERVER_ENABLED: return - hierarchy_context = context.data.get("hierarchyContext") - if not hierarchy_context: + if not context.data.get("hierarchyContext"): self.log.debug("Skipping ExtractHierarchyToAYON") return From e0f6497f95006f1190c4a619b566f54386dabf54 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Sat, 20 Jan 2024 03:25:30 +0000 Subject: [PATCH 15/25] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index 043b6fbebb..5bb4b4fb0a 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.18.5-nightly.1" +__version__ = "3.18.5-nightly.2" From c3af397348029bf3337262d1fb9f5a469292eb35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 20 Jan 2024 03:26:05 +0000 Subject: [PATCH 16/25] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 1177b9e4fe..e831bf3dc1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.18.5-nightly.2 - 3.18.5-nightly.1 - 3.18.4 - 3.18.4-nightly.1 @@ -134,7 +135,6 @@ body: - 3.15.8-nightly.1 - 3.15.7 - 3.15.7-nightly.3 - - 3.15.7-nightly.2 validations: required: true - type: dropdown From c2ea9303a3a30f491d1984b06f7b91b388f786c1 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 22 Jan 2024 11:03:02 +0000 Subject: [PATCH 17/25] Collect non-categorized effects as well --- .../plugins/publish/collect_clip_effects.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py index 89dc66d73c..9c147e88d6 100644 --- a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py +++ b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py @@ -74,32 +74,32 @@ class CollectClipEffects(pyblish.api.InstancePlugin): x["name"]: x["effect_classes"] for x in self.effect_categories } - category_by_effect = {} + category_by_effect = {"": ""} for key, values in effect_categories.items(): for cls in values: category_by_effect[cls] = key effects_categorized = {k: {} for k in effect_categories.keys()} + effects_categorized[""] = {} for key, value in effects.items(): if key == "assignTo": continue # Some classes can have a number in them. Like Text2. - found_cls = None + found_cls = "" for cls in category_by_effect.keys(): if value["class"].startswith(cls): found_cls = cls - if found_cls is None: - continue - effects_categorized[category_by_effect[found_cls]][key] = value - if effects_categorized: - for key in effects_categorized.keys(): - effects_categorized[key]["assignTo"] = effects["assignTo"] - else: - effects_categorized[""] = effects + categories = list(effects_categorized.keys()) + for category in categories: + if not effects_categorized[category]: + effects_categorized.pop(category) + continue + + effects_categorized[category]["assignTo"] = effects["assignTo"] for category, effects in effects_categorized.items(): name = "".join(subset_split) From bfdfa78e57e8c4f3f551569c109ffa5f4c5ed474 Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Tue, 23 Jan 2024 10:48:20 +0000 Subject: [PATCH 18/25] Fix problem with independent window --- openpype/hosts/blender/api/capture.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/blender/api/capture.py b/openpype/hosts/blender/api/capture.py index 9922140cea..e16a865607 100644 --- a/openpype/hosts/blender/api/capture.py +++ b/openpype/hosts/blender/api/capture.py @@ -273,10 +273,9 @@ def _independent_window(): current_windows = set(bpy.context.window_manager.windows) with bpy.context.temp_override(**context): bpy.ops.wm.window_new() - window = list(set(bpy.context.window_manager.windows) - current_windows)[0] - context["window"] = window - try: - yield window - finally: - with bpy.context.temp_override(**context): + window = list(set(bpy.context.window_manager.windows) - current_windows)[0] + context["window"] = window + try: + yield window + finally: bpy.ops.wm.window_close() From a6556b4c2cb2c901b1df54460413e77ab278f888 Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Tue, 23 Jan 2024 10:51:36 +0000 Subject: [PATCH 19/25] Hound fix --- openpype/hosts/blender/api/capture.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/blender/api/capture.py b/openpype/hosts/blender/api/capture.py index e16a865607..e5e6041563 100644 --- a/openpype/hosts/blender/api/capture.py +++ b/openpype/hosts/blender/api/capture.py @@ -273,7 +273,8 @@ def _independent_window(): current_windows = set(bpy.context.window_manager.windows) with bpy.context.temp_override(**context): bpy.ops.wm.window_new() - window = list(set(bpy.context.window_manager.windows) - current_windows)[0] + window = list( + set(bpy.context.window_manager.windows) - current_windows)[0] context["window"] = window try: yield window From 8b9def5b9a281d6f3522af0fb5fe30fad346611c Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 23 Jan 2024 11:41:26 +0000 Subject: [PATCH 20/25] Add default settings. --- server_addon/hiero/server/settings/publish_plugins.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server_addon/hiero/server/settings/publish_plugins.py b/server_addon/hiero/server/settings/publish_plugins.py index 07778b8ebe..f3d1e21fe4 100644 --- a/server_addon/hiero/server/settings/publish_plugins.py +++ b/server_addon/hiero/server/settings/publish_plugins.py @@ -74,5 +74,8 @@ DEFAULT_PUBLISH_PLUGIN_SETTINGS = { "tags_addition": [ "review" ] + }, + "CollectClipEffectsModel": { + "effect_categories": [] } } From 1d2f97052a527fb379c57518ecae22c6bfe12ca0 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 23 Jan 2024 12:04:59 +0000 Subject: [PATCH 21/25] Add class attribute --- openpype/hosts/hiero/plugins/publish/collect_clip_effects.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py index 9c147e88d6..6647459e8e 100644 --- a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py +++ b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py @@ -9,6 +9,8 @@ class CollectClipEffects(pyblish.api.InstancePlugin): label = "Collect Clip Effects Instances" families = ["clip"] + effect_categories = [] + def process(self, instance): family = "effect" effects = {} From d3276c70dfa8a59a2487e7a6d2feb16c58164652 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 23 Jan 2024 12:05:05 +0000 Subject: [PATCH 22/25] Fix version --- server_addon/hiero/server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/hiero/server/version.py b/server_addon/hiero/server/version.py index 3ced3581bb..b3f4756216 100644 --- a/server_addon/hiero/server/version.py +++ b/server_addon/hiero/server/version.py @@ -1 +1 @@ -__version__ = "0.2.1" +__version__ = "0.1.2" From f69c63042f73bfaae4898fbd4ada583f648de5da Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 23 Jan 2024 14:34:44 +0000 Subject: [PATCH 23/25] Update openpype/hosts/hiero/plugins/publish/collect_clip_effects.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jakub Ježek --- openpype/hosts/hiero/plugins/publish/collect_clip_effects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py index 6647459e8e..d7f646ebc9 100644 --- a/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py +++ b/openpype/hosts/hiero/plugins/publish/collect_clip_effects.py @@ -90,7 +90,7 @@ class CollectClipEffects(pyblish.api.InstancePlugin): # Some classes can have a number in them. Like Text2. found_cls = "" for cls in category_by_effect.keys(): - if value["class"].startswith(cls): + if cls in value["class"]: found_cls = cls effects_categorized[category_by_effect[found_cls]][key] = value From 97c465c20f57aff7a87e3604ed30849a6feec09d Mon Sep 17 00:00:00 2001 From: Ynbot Date: Wed, 24 Jan 2024 03:25:59 +0000 Subject: [PATCH 24/25] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index 5bb4b4fb0a..674ea2cb8a 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.18.5-nightly.2" +__version__ = "3.18.5-nightly.3" From c8e00d4aa4cfc81d967c8d607bd409af9659b068 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 24 Jan 2024 03:26:36 +0000 Subject: [PATCH 25/25] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e831bf3dc1..1816ffe515 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.18.5-nightly.3 - 3.18.5-nightly.2 - 3.18.5-nightly.1 - 3.18.4 @@ -134,7 +135,6 @@ body: - 3.15.8-nightly.2 - 3.15.8-nightly.1 - 3.15.7 - - 3.15.7-nightly.3 validations: required: true - type: dropdown