From 5d46873046b68efc1a2ee3098fcde57b3f97101e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 27 Dec 2024 12:00:22 +0100 Subject: [PATCH 1/5] Expose Maya USD "model" product type creator --- .../plugins/create/create_maya_usd.py | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/client/ayon_maya/plugins/create/create_maya_usd.py b/client/ayon_maya/plugins/create/create_maya_usd.py index f9e7c38f..e5a6891f 100644 --- a/client/ayon_maya/plugins/create/create_maya_usd.py +++ b/client/ayon_maya/plugins/create/create_maya_usd.py @@ -18,6 +18,8 @@ class CreateMayaUsd(plugin.MayaCreator): description = "Create Maya USD Export" cache = {} + allow_animation = True + def register_callbacks(self): self.create_context.add_value_changed_callback(self.on_values_changed) @@ -70,16 +72,18 @@ def get_attr_defs_for_instance(self, instance): self.cache["jobContextItems"] = job_context_items - defs = [ - BoolDef("exportAnimationData", - label="Export Animation Data", - tooltip="When disabled no frame range is exported and " - "only the start frame is used to define the " - "static export frame.", - default=True) - ] - defs.extend(lib.collect_animation_defs( - create_context=self.create_context)) + defs = [] + if self.allow_animation: + defs.append( + BoolDef("exportAnimationData", + label="Export Animation Data", + tooltip="When disabled no frame range is exported and " + "only the start frame is used to define the " + "static export frame.", + default=True) + ) + defs.extend(lib.collect_animation_defs( + create_context=self.create_context)) defs.extend([ EnumDef("defaultUSDFormat", label="File format", @@ -242,3 +246,21 @@ def create(self, product_name, instance_data, pre_create_data): cmds.select(root, replace=True, noExpand=True) super().create(product_name, instance_data, pre_create_data) + + +class CreateMayaUsdModel(CreateMayaUsd): + identifier = "io.ayon.creators.maya.mayausd.model" + label = "Maya USD: Model" + product_type = "model" + icon = "cubes" + description = "Create Model with Maya USD Export" + + allow_animation = False + + def get_pre_create_attr_defs(self): + attr_defs = super().get_pre_create_attr_defs() + + # Enable by default + for attr_def in attr_defs: + if attr_def.key == "createAssetTemplateHierarchy": + attr_def.default = True From 99e267494cff1d483f3529843e2ee96240378fcf Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 27 Dec 2024 12:25:15 +0100 Subject: [PATCH 2/5] Fix attribute definitions --- client/ayon_maya/plugins/create/create_maya_usd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/ayon_maya/plugins/create/create_maya_usd.py b/client/ayon_maya/plugins/create/create_maya_usd.py index e5a6891f..bdd6164e 100644 --- a/client/ayon_maya/plugins/create/create_maya_usd.py +++ b/client/ayon_maya/plugins/create/create_maya_usd.py @@ -264,3 +264,5 @@ def get_pre_create_attr_defs(self): for attr_def in attr_defs: if attr_def.key == "createAssetTemplateHierarchy": attr_def.default = True + + return attr_defs From 55295f4ae9b80e3f96db2c26c1d11caff34c51db Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 27 Dec 2024 12:26:08 +0100 Subject: [PATCH 3/5] Match icon with model creator --- client/ayon_maya/plugins/create/create_maya_usd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_maya/plugins/create/create_maya_usd.py b/client/ayon_maya/plugins/create/create_maya_usd.py index bdd6164e..8bc7f542 100644 --- a/client/ayon_maya/plugins/create/create_maya_usd.py +++ b/client/ayon_maya/plugins/create/create_maya_usd.py @@ -252,7 +252,7 @@ class CreateMayaUsdModel(CreateMayaUsd): identifier = "io.ayon.creators.maya.mayausd.model" label = "Maya USD: Model" product_type = "model" - icon = "cubes" + icon = "cube" description = "Create Model with Maya USD Export" allow_animation = False From a31597e1ca686e340cdd206b0ff3f9602839e084 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 27 Dec 2024 13:05:19 +0100 Subject: [PATCH 4/5] Fix Extract Maya USD failing on `frameStartHandle` not existing --- client/ayon_maya/plugins/publish/collect_model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/ayon_maya/plugins/publish/collect_model.py b/client/ayon_maya/plugins/publish/collect_model.py index 13e5a609..80f31056 100644 --- a/client/ayon_maya/plugins/publish/collect_model.py +++ b/client/ayon_maya/plugins/publish/collect_model.py @@ -27,3 +27,9 @@ def process(self, instance): frame = cmds.currentTime(query=True) instance.data["frameStart"] = frame instance.data["frameEnd"] = frame + + # Explicitly set no handles at all + instance.data["handleStart"] = 0 + instance.data["handleEnd"] = 0 + instance.data["frameStartHandle"] = frame + instance.data["frameEndHandle"] = frame From 6e25af2a2dedd066432110b19767ef2f6adb7ea2 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 17 Dec 2025 21:58:54 +0100 Subject: [PATCH 5/5] Update client/ayon_maya/plugins/create/create_maya_usd.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_maya/plugins/create/create_maya_usd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_maya/plugins/create/create_maya_usd.py b/client/ayon_maya/plugins/create/create_maya_usd.py index 2858836f..b8bb9cf0 100644 --- a/client/ayon_maya/plugins/create/create_maya_usd.py +++ b/client/ayon_maya/plugins/create/create_maya_usd.py @@ -242,6 +242,7 @@ class CreateMayaUsdModel(CreateMayaUsd): identifier = "io.ayon.creators.maya.mayausd.model" label = "Maya USD: Model" product_type = "model" + product_base_type = "model" icon = "cube" description = "Create Model with Maya USD Export"