viewer not popup in the max2024 but will popup in max 2023

This commit is contained in:
Kayla Man 2023-06-24 17:17:42 +08:00
parent 5abbceeace
commit 0d590cb572
3 changed files with 18 additions and 6 deletions

View file

@ -2,7 +2,7 @@ import os
import pyblish.api
from pymxs import runtime as rt
from openpype.pipeline import publish
from openpype.hosts.max.api.lib import viewport_camera
from openpype.hosts.max.api.lib import viewport_camera, get_max_version
class ExtractReviewAnimation(publish.Extractor):
@ -90,6 +90,12 @@ class ExtractReviewAnimation(publish.Extractor):
enabled = instance.data.get(key)
if enabled:
job_args.append(f"{key}:{enabled}")
if get_max_version() == 2024:
# hardcoded for current stage
auto_play_option = "autoPlay:false"
job_args.append(auto_play_option)
job_str = " ".join(job_args)
self.log.debug(job_str)

View file

@ -3,7 +3,7 @@ import tempfile
import pyblish.api
from pymxs import runtime as rt
from openpype.pipeline import publish
from openpype.hosts.max.api.lib import viewport_camera
from openpype.hosts.max.api.lib import viewport_camera, get_max_version
class ExtractThumbnail(publish.Extractor):
@ -26,7 +26,7 @@ class ExtractThumbnail(publish.Extractor):
fps = int(instance.data["fps"])
frame = int(instance.data["frameStart"])
instance.context.data["cleanupFullPaths"].append(tmp_staging)
filename = "{name}_thumbnail..jpg".format(**instance.data)
filename = "{name}_thumbnail..png".format(**instance.data)
filepath = os.path.join(tmp_staging, filename)
filepath = filepath.replace("\\", "/")
thumbnail = self.get_filename(instance.name, frame)
@ -80,6 +80,11 @@ class ExtractThumbnail(publish.Extractor):
enabled = instance.data.get(key)
if enabled:
job_args.append(f"{key}:{enabled}")
if get_max_version() == 2024:
# hardcoded for current stage
auto_play_option = "autoPlay:false"
job_args.append(auto_play_option)
job_str = " ".join(job_args)
self.log.debug(job_str)

View file

@ -28,9 +28,10 @@ class ValidateAnimationTimeline(pyblish.api.InstancePlugin):
frame_end_handle = frame_range["frameEnd"] + int(
frame_range["handleEnd"]
)
if rt.animationRange != rt.interval(frame_start_handle,
frame_end_handle):
raise PublishValidationError("Incorrect animation timeline"
if rt.animationRange.start != frame_start_handle or (
rt.animationRange.end != frame_end_handle
):
raise PublishValidationError("Incorrect animation timeline "
"set for preview animation.. "
"\nYou can use repair action to "
"the correct animation timeline")