Skip to content

Commit

Permalink
Merge pull request #22 from ynput/enhancement/preparation-for-farm-re…
Browse files Browse the repository at this point in the history
…ndering

Chore: Preparation for farm rendering
  • Loading branch information
iLLiCiTiT authored Jan 10, 2025
2 parents 3405163 + 8e9dab4 commit acabaf1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
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

0 comments on commit acabaf1

Please sign in to comment.