diff --git a/client/ayon_maya/plugins/create/create_maya_usd.py b/client/ayon_maya/plugins/create/create_maya_usd.py index 34f3be11..b8bb9cf0 100644 --- a/client/ayon_maya/plugins/create/create_maya_usd.py +++ b/client/ayon_maya/plugins/create/create_maya_usd.py @@ -19,6 +19,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) @@ -71,16 +73,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", @@ -232,3 +236,24 @@ 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" + product_base_type = "model" + icon = "cube" + 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 + + return attr_defs 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