mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
[Automated] Merged develop into main
This commit is contained in:
commit
c385cafdfa
2 changed files with 0 additions and 69 deletions
|
|
@ -26,7 +26,6 @@ from .workio import (
|
|||
)
|
||||
|
||||
from .lib import (
|
||||
export_alembic,
|
||||
lsattr,
|
||||
lsattrs,
|
||||
read,
|
||||
|
|
@ -58,7 +57,6 @@ __all__ = [
|
|||
"work_root",
|
||||
|
||||
# Utility functions
|
||||
"export_alembic",
|
||||
"lsattr",
|
||||
"lsattrs",
|
||||
"read",
|
||||
|
|
|
|||
|
|
@ -289,73 +289,6 @@ def pairwise(iterable):
|
|||
return zip(a, a)
|
||||
|
||||
|
||||
def export_alembic(nodes,
|
||||
file,
|
||||
frame_range=None,
|
||||
write_uv=True,
|
||||
write_visibility=True,
|
||||
attribute_prefix=None):
|
||||
"""Wrap native MEL command with limited set of arguments
|
||||
|
||||
Arguments:
|
||||
nodes (list): Long names of nodes to cache
|
||||
|
||||
file (str): Absolute path to output destination
|
||||
|
||||
frame_range (tuple, optional): Start- and end-frame of cache,
|
||||
default to current animation range.
|
||||
|
||||
write_uv (bool, optional): Whether or not to include UVs,
|
||||
default to True
|
||||
|
||||
write_visibility (bool, optional): Turn on to store the visibility
|
||||
state of objects in the Alembic file. Otherwise, all objects are
|
||||
considered visible, default to True
|
||||
|
||||
attribute_prefix (str, optional): Include all user-defined
|
||||
attributes with this prefix.
|
||||
|
||||
"""
|
||||
|
||||
if frame_range is None:
|
||||
frame_range = (
|
||||
cmds.playbackOptions(query=True, ast=True),
|
||||
cmds.playbackOptions(query=True, aet=True)
|
||||
)
|
||||
|
||||
options = [
|
||||
("file", file),
|
||||
("frameRange", "%s %s" % frame_range),
|
||||
] + [("root", mesh) for mesh in nodes]
|
||||
|
||||
if isinstance(attribute_prefix, string_types):
|
||||
# Include all attributes prefixed with "mb"
|
||||
# TODO(marcus): This would be a good candidate for
|
||||
# external registration, so that the developer
|
||||
# doesn't have to edit this function to modify
|
||||
# the behavior of Alembic export.
|
||||
options.append(("attrPrefix", str(attribute_prefix)))
|
||||
|
||||
if write_uv:
|
||||
options.append(("uvWrite", ""))
|
||||
|
||||
if write_visibility:
|
||||
options.append(("writeVisibility", ""))
|
||||
|
||||
# Generate MEL command
|
||||
mel_args = list()
|
||||
for key, value in options:
|
||||
mel_args.append("-{0} {1}".format(key, value))
|
||||
|
||||
mel_args_string = " ".join(mel_args)
|
||||
mel_cmd = "AbcExport -j \"{0}\"".format(mel_args_string)
|
||||
|
||||
# For debuggability, put the string passed to MEL in the Script editor.
|
||||
print("mel.eval('%s')" % mel_cmd)
|
||||
|
||||
return mel.eval(mel_cmd)
|
||||
|
||||
|
||||
def collect_animation_data(fps=False):
|
||||
"""Get the basic animation data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue