🔀 Merge remote-tracking branch 'origin/develop' into maya_new_publisher

This commit is contained in:
Ondrej Samohel 2023-06-30 17:02:21 +02:00
commit 90f5fa852e
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 34 additions and 17 deletions

View file

@ -64,15 +64,30 @@ class CollectNewInstances(pyblish.api.InstancePlugin):
instance.data["setMembers"] = members
# TODO: This might make more sense as a separate collector
# Collect frameStartHandle and frameEndHandle if frames present
if "frameStart" in instance.data:
handle_start = instance.data.get("handleStart", 0)
frame_start_handle = instance.data["frameStart"] - handle_start
instance.data["frameStartHandle"] = frame_start_handle
if "frameEnd" in instance.data:
handle_end = instance.data.get("handleEnd", 0)
frame_end_handle = instance.data["frameEnd"] + handle_end
instance.data["frameEndHandle"] = frame_end_handle
# Convert frame values to integers
for attr_name in (
"handleStart", "handleEnd", "frameStart", "frameEnd",
):
value = instance.data.get(attr_name)
if value is not None:
instance.data[attr_name] = int(value)
# Append start frame and end frame to label if present
if "frameStart" in instance.data and "frameEnd" in instance.data:
# Take handles from context if not set locally on the instance
for key in ["handleStart", "handleEnd"]:
if key not in instance.data:
value = instance.context.data[key]
if value is not None:
value = int(value)
instance.data[key] = value
instance.data["frameStartHandle"] = int(
instance.data["frameStart"] - instance.data["handleStart"]
)
instance.data["frameEndHandle"] = int(
instance.data["frameEnd"] + instance.data["handleEnd"]
)
def get_all_parents(self, nodes):
"""Get all parents by using string operations (optimization)

View file

@ -17,10 +17,12 @@ class CollectMayaSceneTime(pyblish.api.InstancePlugin):
def process(self, instance):
instance.data.update({
"frameStart": cmds.playbackOptions(query=True, minTime=True),
"frameEnd": cmds.playbackOptions(query=True, maxTime=True),
"frameStartHandle": cmds.playbackOptions(query=True,
animationStartTime=True),
"frameEndHandle": cmds.playbackOptions(query=True,
animationEndTime=True)
"frameStart": int(
cmds.playbackOptions(query=True, minTime=True)),
"frameEnd": int(
cmds.playbackOptions(query=True, maxTime=True)),
"frameStartHandle": int(
cmds.playbackOptions(query=True, animationStartTime=True)),
"frameEndHandle": int(
cmds.playbackOptions(query=True, animationEndTime=True))
})

View file

@ -261,8 +261,8 @@ class ExtractPlayblast(publish.Extractor):
"ext": capture_preset["Codec"]["compression"],
"files": collected_files,
"stagingDir": stagingdir,
"frameStart": start,
"frameEnd": end,
"frameStart": int(start),
"frameEnd": int(end),
"fps": fps,
"tags": tags,
"camera_name": camera_node_name