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

Commit

Permalink
Merge pull request #1037 from pypeclub/bugfix/3.0_tvpaint_thumbnail_e…
Browse files Browse the repository at this point in the history
…xtract_fix

TVPaint thumbnail extract fix
  • Loading branch information
mkolar authored Feb 19, 2021
2 parents d8ca6f6 + d510291 commit 82249dc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pype/hosts/tvpaint/plugins/publish/extract_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ExtractSequence(pyblish.api.Extractor):
"flc": ".fli",
"gif": ".gif",
"ilbm": ".iff",
"jpg": ".jpg",
"jpeg": ".jpg",
"pcx": ".pcx",
"png": ".png",
Expand All @@ -36,6 +37,7 @@ class ExtractSequence(pyblish.api.Extractor):
"bmp",
"dpx",
"ilbm",
"jpg",
"jpeg",
"png",
"sun",
Expand Down Expand Up @@ -170,10 +172,14 @@ def process(self, instance):
if not thumbnail_fullpath:
return

thumbnail_ext = os.path.splitext(
thumbnail_fullpath
)[1].replace(".", "")
# Create thumbnail representation
thumbnail_repre = {
"name": "thumbnail",
"ext": ext,
"ext": thumbnail_ext,
"outputName": "thumb",
"files": os.path.basename(thumbnail_fullpath),
"stagingDir": output_dir,
"tags": ["thumbnail"]
Expand Down Expand Up @@ -306,11 +312,11 @@ def render(
if thumbnail_filename:
basename, ext = os.path.splitext(thumbnail_filename)
if not ext:
ext = ".png"
ext = ".jpg"
thumbnail_fullpath = "/".join([output_dir, basename + ext])
all_output_files[thumbnail_filename] = thumbnail_fullpath
# Force save mode to png for thumbnail
george_script_lines.append("tv_SaveMode \"PNG\"")
george_script_lines.append("tv_SaveMode \"JPG\"")
# Go to frame
george_script_lines.append("tv_layerImage {}".format(first_frame))
# Store image to output
Expand Down

0 comments on commit 82249dc

Please sign in to comment.