Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

TVPaint frame range definition #1424

Merged
merged 24 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
589aa0c
set always mark in to 0 and mark out to mark in + duration - 1
iLLiCiTiT Apr 28, 2021
f00e18d
set frameStart and frameEnd on instance to context frameStart and fra…
iLLiCiTiT Apr 28, 2021
5bb4280
validate only duration in validate marks and repair does not change M…
iLLiCiTiT Apr 28, 2021
44bc83b
changed label of validator
iLLiCiTiT Apr 28, 2021
49e70b7
added small docstring
iLLiCiTiT Apr 28, 2021
8530ad7
pass mark in/out to render methods
iLLiCiTiT Apr 28, 2021
c314d60
use proper mark in/out
iLLiCiTiT Apr 28, 2021
1917504
don't use frame start/end
iLLiCiTiT Apr 28, 2021
55c3e37
add frameStart and frameEnd only if representation is sequence
iLLiCiTiT Apr 28, 2021
d79bb82
skipe representation creation if nothing was rendered
iLLiCiTiT Apr 28, 2021
5cfa9c6
fix return value
iLLiCiTiT Apr 28, 2021
c0951d9
add more check for rendered output
iLLiCiTiT Apr 28, 2021
45ec2ea
skip layers without content in mark in/out range
iLLiCiTiT Apr 28, 2021
4516c69
formatting changes
iLLiCiTiT Apr 28, 2021
d0eab71
fixed keys used for frame start/end
iLLiCiTiT Apr 28, 2021
6e1d3fd
added frame collector which happens after avalon context collector
iLLiCiTiT Apr 28, 2021
217106d
rendered frames are renamed to right sequence frames
iLLiCiTiT Apr 28, 2021
74f763d
use bigger value of mark out of frame end to prepare template
iLLiCiTiT Apr 28, 2021
2d2fb57
added docstring to new collector
iLLiCiTiT Apr 28, 2021
8edd552
render methods do not rename output filenames only render mark in->out
iLLiCiTiT Apr 29, 2021
f213372
prepare and check all frames before rendering
iLLiCiTiT Apr 29, 2021
3806166
rendered frames are renamed to proper sequence frames in single method
iLLiCiTiT Apr 29, 2021
17406ac
fix used frames
iLLiCiTiT Apr 29, 2021
09b86bd
added prefix to temp directory
iLLiCiTiT Apr 29, 2021
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
31 changes: 13 additions & 18 deletions pype/hosts/tvpaint/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,19 @@ def set_context_settings(asset):
frame_start = asset["data"].get("frameStart")
frame_end = asset["data"].get("frameEnd")

if frame_start and frame_end:
handles = asset["data"].get("handles") or 0
handle_start = asset["data"].get("handleStart")
if handle_start is None:
handle_start = handles
if frame_start is None or frame_end is None:
print("Frame range was not found!")
return

handle_end = asset["data"].get("handleEnd")
if handle_end is None:
handle_end = handles
handles = asset["data"].get("handles") or 0
handle_start = asset["data"].get("handleStart")
handle_end = asset["data"].get("handleEnd")
if handle_start is None or handle_end is None:
handle_start = handle_end = handles

frame_start -= int(handle_start)
frame_end += int(handle_end)
# Always start from 0 Mark In and set only Mark Out
mark_in = 0
mark_out = mark_in + (frame_end - frame_start) + handle_start + handle_end

avalon.tvpaint.lib.execute_george(
"tv_markin {} set".format(frame_start - 1)
)
avalon.tvpaint.lib.execute_george(
"tv_markout {} set".format(frame_end - 1)
)
else:
print("Frame range was not found!")
avalon.tvpaint.lib.execute_george("tv_markin {} set".format(mark_in))
avalon.tvpaint.lib.execute_george("tv_markout {} set".format(mark_out))
37 changes: 37 additions & 0 deletions pype/plugins/tvpaint/publish/collect_instance_frames.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import pyblish.api


class CollectOutputFrameRange(pyblish.api.ContextPlugin):
"""Collect frame start/end from context.

When instances are collected context does not contain `frameStart` and
`frameEnd` keys yet. They are collected in global plugin
`CollectAvalonEntities`.
"""
label = "Collect output frame range"
order = pyblish.api.CollectorOrder
hosts = ["tvpaint"]

def process(self, context):
for instance in context:
frame_start = instance.data.get("frameStart")
frame_end = instance.data.get("frameEnd")
if frame_start is not None and frame_end is not None:
self.log.debug(
"Instance {} already has set frames {}-{}".format(
str(instance), frame_start, frame_end
)
)
return

frame_start = context.data.get("frameStart")
frame_end = context.data.get("frameEnd")

instance.data["frameStart"] = frame_start
instance.data["frameEnd"] = frame_end

self.log.info(
"Set frames {}-{} on instance {} ".format(
frame_start, frame_end, str(instance)
)
)
3 changes: 0 additions & 3 deletions pype/plugins/tvpaint/publish/collect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ def process(self, context):

instance.data["publish"] = any_visible

instance.data["frameStart"] = context.data["sceneMarkIn"] + 1
instance.data["frameEnd"] = context.data["sceneMarkOut"] + 1

self.log.debug("Created instance: {}\n{}".format(
instance, json.dumps(instance.data, indent=4)
))
Expand Down
Loading