Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Preparation for farm rendering #22

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 32 additions & 1 deletion client/ayon_tvpaint/plugins/publish/collect_workfile_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pyblish.api

from ayon_core.pipeline import PublishError
from ayon_tvpaint.api.lib import (
execute_george,
execute_george_through_file,
Expand Down Expand Up @@ -166,6 +167,34 @@ def process(self, context):
result = execute_george("tv_markout")
mark_out_frame, mark_out_state, _ = result.split(" ")

current_scene_id = execute_george("tv_scenecurrentid")
scene_index = 0
while True:
scene_id = execute_george(f"tv_sceneenumid {scene_index}")
if scene_id == "none":
raise PublishError(
"Current scene was not found in workfile."
)

if scene_id == current_scene_id:
break
scene_index += 1

current_clip_id = execute_george("tv_clipcurrentid")
clip_index = 0
while True:
clip_id = execute_george(
f"tv_clipenumid {current_scene_id} {clip_index}"
)
if clip_id == "none":
raise PublishError(
"Current clip was not found in scene."
)

if clip_id == current_clip_id:
break
clip_index += 1

scene_data = {
"currentFile": workfile_path,
"sceneWidth": width,
Expand All @@ -178,7 +207,9 @@ def process(self, context):
"sceneMarkOut": int(mark_out_frame),
"sceneMarkOutState": mark_out_state == "set",
"sceneStartFrame": int(execute_george("tv_startframe")),
"sceneBgColor": self._get_bg_color()
"sceneBgColor": self._get_bg_color(),
"sceneSceneIdx": scene_index,
"sceneClipIdx": clip_index,
}
self.log.debug(
"Scene data: {}".format(json.dumps(scene_data, indent=4))
Expand Down
3 changes: 3 additions & 0 deletions client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ExtractConvertToEXR(pyblish.api.InstancePlugin):
exr_compression = "ZIP"

def process(self, instance):
if instance.data.get("farm"):
return

repres = instance.data.get("representations")
if not repres:
return
Expand Down
5 changes: 4 additions & 1 deletion client/ayon_tvpaint/plugins/publish/extract_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class ExtractSequence(pyblish.api.InstancePlugin):
review_bg = [255, 255, 255, 1.0]

def process(self, instance):
if instance.data.get("farm"):
return

self.log.info(
"* Processing instance \"{}\"".format(instance.data["label"])
)
Expand Down Expand Up @@ -380,7 +383,7 @@ def render(
else:
self.log.info((
"Source for thumbnail has mode \"{}\" (Expected: RGBA)."
" Can't use thubmanail background color."
" Can't use thumbnail background color."
).format(source_img.mode))
source_img.save(thumbnail_filepath)

Expand Down
Loading