Maya: Refactor handles to correctly extract handles with the frame range in export using handleStart and handleEnd as input

This commit is contained in:
Roy Nieterau 2022-01-05 13:38:19 +01:00
parent 7621f02a47
commit 7bf02646bc
8 changed files with 27 additions and 54 deletions

View file

@ -297,7 +297,8 @@ def collect_animation_data():
data = OrderedDict()
data["frameStart"] = start
data["frameEnd"] = end
data["handles"] = 0
data["handleStart"] = 0
data["handleEnd"] = 0
data["step"] = 1.0
data["fps"] = fps

View file

@ -35,12 +35,8 @@ class ExtractAnimation(openpype.api.Extractor):
fullPath=True) or []
# Collect the start and end including handles
start = instance.data["frameStart"]
end = instance.data["frameEnd"]
handles = instance.data.get("handles", 0) or 0
if handles:
start -= handles
end += handles
start = instance.data["frameStartHandle"]
end = instance.data["frameEndHandle"]
self.log.info("Extracting animation..")
dirname = self.staging_dir(instance)

View file

@ -38,13 +38,9 @@ class ExtractAssStandin(openpype.api.Extractor):
self.log.info("Extracting ass sequence")
# Collect the start and end including handles
start = instance.data.get("frameStart", 1)
end = instance.data.get("frameEnd", 1)
handles = instance.data.get("handles", 0)
start = instance.data.get("frameStartHandle", 1)
end = instance.data.get("frameEndHandle", 1)
step = instance.data.get("step", 0)
if handles:
start -= handles
end += handles
exported_files = cmds.arnoldExportAss(filename=file_path,
selected=True,

View file

@ -23,17 +23,9 @@ class ExtractCameraAlembic(openpype.api.Extractor):
def process(self, instance):
# get settings
framerange = [instance.data.get("frameStart", 1),
instance.data.get("frameEnd", 1)]
handle_start = instance.data.get("handleStart", 0)
handle_end = instance.data.get("handleEnd", 0)
# TODO: deprecated attribute "handles"
if handle_start is None:
handle_start = instance.data.get("handles", 0)
handle_end = instance.data.get("handles", 0)
# Collect the start and end including handles
start = instance.data["frameStartHandle"]
end = instance.data["frameEndHandle"]
step = instance.data.get("step", 1.0)
bake_to_worldspace = instance.data("bakeToWorldSpace", True)
@ -63,10 +55,7 @@ class ExtractCameraAlembic(openpype.api.Extractor):
job_str = ' -selection -dataFormat "ogawa" '
job_str += ' -attrPrefix cb'
job_str += ' -frameRange {0} {1} '.format(framerange[0]
- handle_start,
framerange[1]
+ handle_end)
job_str += ' -frameRange {0} {1} '.format(start, end)
job_str += ' -step {0} '.format(step)
if bake_to_worldspace:

View file

@ -118,19 +118,9 @@ class ExtractCameraMayaScene(openpype.api.Extractor):
# no preset found
pass
framerange = [instance.data.get("frameStart", 1),
instance.data.get("frameEnd", 1)]
handle_start = instance.data.get("handleStart", 0)
handle_end = instance.data.get("handleEnd", 0)
# TODO: deprecated attribute "handles"
if handle_start is None:
handle_start = instance.data.get("handles", 0)
handle_end = instance.data.get("handles", 0)
range_with_handles = [framerange[0] - handle_start,
framerange[1] + handle_end]
# Collect the start and end including handles
start = instance.data["frameStartHandle"]
end = instance.data["frameEndHandle"]
step = instance.data.get("step", 1.0)
bake_to_worldspace = instance.data("bakeToWorldSpace", True)
@ -165,7 +155,7 @@ class ExtractCameraMayaScene(openpype.api.Extractor):
"Performing camera bakes: {}".format(transform))
baked = lib.bake_to_world_space(
transform,
frame_range=range_with_handles,
frame_range=[start, end],
step=step
)
baked_shapes = cmds.ls(baked,

View file

@ -166,12 +166,8 @@ class ExtractFBX(openpype.api.Extractor):
self.log.info("Export options: {0}".format(options))
# Collect the start and end including handles
start = instance.data["frameStart"]
end = instance.data["frameEnd"]
handles = instance.data.get("handles", 0)
if handles:
start -= handles
end += handles
start = instance.data["frameStartHandle"]
end = instance.data["frameEndHandle"]
options['bakeComplexStart'] = start
options['bakeComplexEnd'] = end

View file

@ -28,14 +28,19 @@ class ExtractVRayProxy(openpype.api.Extractor):
if not anim_on:
# Remove animation information because it is not required for
# non-animated subsets
instance.data.pop("frameStart", None)
instance.data.pop("frameEnd", None)
keys = ["frameStart", "frameEnd",
"handleStart", "handleEnd",
"frameStartHandle", "frameEndHandle",
# Backwards compatibility
"handles"]
for key in keys:
instance.data.pop(key, None)
start_frame = 1
end_frame = 1
else:
start_frame = instance.data["frameStart"]
end_frame = instance.data["frameEnd"]
start_frame = instance.data["frameStartHandle"]
end_frame = instance.data["frameEndHandle"]
vertex_colors = instance.data.get("vertexColors", False)

View file

@ -29,8 +29,8 @@ class ExtractYetiCache(openpype.api.Extractor):
data_file = os.path.join(dirname, "yeti.fursettings")
# Collect information for writing cache
start_frame = instance.data.get("frameStart")
end_frame = instance.data.get("frameEnd")
start_frame = instance.data.get("frameStartHandle")
end_frame = instance.data.get("frameEndHandle")
preroll = instance.data.get("preroll")
if preroll > 0:
start_frame -= preroll