Skip to content
45 changes: 35 additions & 10 deletions client/ayon_maya/plugins/create/create_maya_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions client/ayon_maya/plugins/publish/collect_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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