Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize output data from Maya USD animation export #115

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions client/ayon_maya/plugins/publish/extract_maya_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ def filter_members(self, members):
# Can be overridden by inherited classes
return members

def override_options(self, options: dict) -> dict:
# Can be overridden by inherited classes
return options

def process(self, instance):
if not self.is_active(instance.data):
return
Expand Down Expand Up @@ -343,6 +347,8 @@ def parse_attr_str(attr_str):
)
del options[key]

options = self.override_options(options)

self.log.debug('Exporting USD: {} / {}'.format(file_path, members))
with maintained_time():
with maintained_selection():
Expand Down Expand Up @@ -417,6 +423,14 @@ def filter_members(self, members):
members = cmds.ls(cmds.sets(out_set, query=True), long=True)
return members

def override_options(self, options: dict) -> dict:
options = options.copy()
options["exportUVs"] = False
options["exportColorSets"] = False
options["exportMaterials"] = False
options["exportAssignedMaterials"] = False
Comment on lines +430 to +431
Copy link
Member

@moonyuet moonyuet Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested out with these two options and also do some research on the mayaUSD. It seems that these two options haven't been exposed to Python as it errors out in maya 2025.1 during extraction.
image

image

Suggested change
options["exportMaterials"] = False
options["exportAssignedMaterials"] = False

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd. But they are in the list here: https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/commands/Readme.md#mayausdexportcommand

Can you check which maya-usd addon version you're using?

Copy link
Member

@moonyuet moonyuet Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am at 0.28.0 not the latest 0.30.0. That could be the reason. I would download the latest version and try it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - yes. Seems added in 0.29.0 -> https://github.com/Autodesk/maya-usd/blob/v0.29.0/doc/CHANGELOG.md

Will take it into consideration. 👍

return options


class ExtractMayaUsdModel(ExtractMayaUsd):
"""Extractor for Maya USD Asset data for model family
Expand Down