mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #2448 from BigRoy/fix_set_frame_range_loaders
Fix "Set Frame Range" loaders to retrieve the correct data from the version
This commit is contained in:
commit
23327757e5
16 changed files with 43 additions and 72 deletions
|
|
@ -176,7 +176,7 @@ def update_frame_range(comp, representations):
|
|||
versions = list(versions)
|
||||
|
||||
versions = [v for v in versions
|
||||
if v["data"].get("startFrame", None) is not None]
|
||||
if v["data"].get("frameStart", None) is not None]
|
||||
|
||||
if not versions:
|
||||
log.warning("No versions loaded to match frame range to.\n")
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ class SetFrameRangeLoader(api.Loader):
|
|||
version = context["version"]
|
||||
version_data = version.get("data", {})
|
||||
|
||||
start = version_data.get("startFrame", None)
|
||||
end = version_data.get("endFrame", None)
|
||||
start = version_data.get("frameStart", None)
|
||||
end = version_data.get("frameEnd", None)
|
||||
|
||||
if start is None or end is None:
|
||||
print(
|
||||
|
|
@ -67,8 +67,8 @@ class SetFrameRangeWithHandlesLoader(api.Loader):
|
|||
version = context["version"]
|
||||
version_data = version.get("data", {})
|
||||
|
||||
start = version_data.get("startFrame", None)
|
||||
end = version_data.get("endFrame", None)
|
||||
start = version_data.get("frameStart", None)
|
||||
end = version_data.get("frameEnd", None)
|
||||
|
||||
if start is None or end is None:
|
||||
print(
|
||||
|
|
@ -78,9 +78,8 @@ class SetFrameRangeWithHandlesLoader(api.Loader):
|
|||
return
|
||||
|
||||
# Include handles
|
||||
handles = version_data.get("handles", 0)
|
||||
start -= handles
|
||||
end += handles
|
||||
start -= version_data.get("handleStart", 0)
|
||||
end += version_data.get("handleEnd", 0)
|
||||
|
||||
hou.playbar.setFrameRange(start, end)
|
||||
hou.playbar.setPlaybackRange(start, end)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class ValidateAbcPrimitiveToDetail(pyblish.api.InstancePlugin):
|
|||
cls.log.debug("Checking with path attribute: %s" % path_attr)
|
||||
|
||||
# Check if the primitive attribute exists
|
||||
frame = instance.data.get("startFrame", 0)
|
||||
frame = instance.data.get("frameStart", 0)
|
||||
geo = output.geometryAtFrame(frame)
|
||||
|
||||
# If there are no primitives on the start frame then it might be
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class ValidateAlembicInputNode(pyblish.api.InstancePlugin):
|
|||
cls.log.warning("No geometry output node found, skipping check..")
|
||||
return
|
||||
|
||||
frame = instance.data.get("startFrame", 0)
|
||||
frame = instance.data.get("frameStart", 0)
|
||||
geo = node.geometryAtFrame(frame)
|
||||
|
||||
invalid = False
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
|
|||
cls.log.debug("Checking for attribute: %s" % path_attr)
|
||||
|
||||
# Check if the primitive attribute exists
|
||||
frame = instance.data.get("startFrame", 0)
|
||||
frame = instance.data.get("frameStart", 0)
|
||||
geo = output.geometryAtFrame(frame)
|
||||
|
||||
# If there are no primitives on the current frame then we can't
|
||||
|
|
|
|||
|
|
@ -355,7 +355,8 @@ def collect_animation_data(fps=False):
|
|||
data = OrderedDict()
|
||||
data["frameStart"] = start
|
||||
data["frameEnd"] = end
|
||||
data["handles"] = 0
|
||||
data["handleStart"] = 0
|
||||
data["handleEnd"] = 0
|
||||
data["step"] = 1.0
|
||||
|
||||
if fps:
|
||||
|
|
|
|||
|
|
@ -72,9 +72,8 @@ class SetFrameRangeWithHandlesLoader(api.Loader):
|
|||
return
|
||||
|
||||
# Include handles
|
||||
handles = version_data.get("handles", 0)
|
||||
start -= handles
|
||||
end += handles
|
||||
start -= version_data.get("handleStart", 0)
|
||||
end += version_data.get("handleEnd", 0)
|
||||
|
||||
cmds.playbackOptions(minTime=start,
|
||||
maxTime=end,
|
||||
|
|
|
|||
|
|
@ -38,12 +38,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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -21,17 +21,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)
|
||||
|
|
@ -61,10 +53,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:
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -168,12 +168,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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ class HoudiniSubmitRenderDeadline(pyblish.api.InstancePlugin):
|
|||
|
||||
# StartFrame to EndFrame by byFrameStep
|
||||
frames = "{start}-{end}x{step}".format(
|
||||
start=int(instance.data["startFrame"]),
|
||||
end=int(instance.data["endFrame"]),
|
||||
start=int(instance.data["frameStart"]),
|
||||
end=int(instance.data["frameEnd"]),
|
||||
step=int(instance.data["byFrameStep"]),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -316,8 +316,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
import speedcopy
|
||||
|
||||
self.log.info("Preparing to copy ...")
|
||||
start = instance.data.get("startFrame")
|
||||
end = instance.data.get("endFrame")
|
||||
start = instance.data.get("frameStart")
|
||||
end = instance.data.get("frameEnd")
|
||||
|
||||
# get latest version of subset
|
||||
# this will stop if subset wasn't published yet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue