Merge branch 'develop' into enhancement/AY-1229_Anatomy-can-use-template-categories

This commit is contained in:
Jakub Trllo 2024-03-18 13:59:29 +01:00
commit 36daddd4ce
15 changed files with 107 additions and 73 deletions

View file

@ -31,23 +31,26 @@ def viewport_layout_and_camera(camera, layout="layout_1"):
layout (str): layout to use in viewport, defaults to `layout_1`
Use None to not change viewport layout during context.
"""
needs_maximise = 0
# Set to first active non extended viewport
rt.viewport.activeViewportEx(1)
original_camera = rt.viewport.getCamera()
original_layout = rt.viewport.getLayout()
if not original_camera:
# if there is no original camera
# use the current camera as original
original_camera = rt.getNodeByName(camera)
original_type = rt.viewport.getType()
review_camera = rt.getNodeByName(camera)
try:
if layout is not None:
layout = rt.Name(layout)
if rt.viewport.getLayout() != layout:
rt.viewport.setLayout(layout)
if rt.viewport.getLayout() != rt.name(layout):
rt.execute("max tool maximize")
needs_maximise = 1
rt.viewport.setCamera(review_camera)
yield
finally:
rt.viewport.setLayout(original_layout)
rt.viewport.setCamera(original_camera)
if needs_maximise == 1:
rt.execute("max tool maximize")
if original_type == rt.Name("view_camera"):
rt.viewport.setCamera(original_camera)
else:
rt.viewport.setType(original_type)
@contextlib.contextmanager

View file

@ -9,7 +9,7 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin):
order = pyblish.api.IntegratorOrder + 0.9
label = "Increment Workfile Version"
hosts = ["max"]
families = ["workfile"]
families = ["maxrender", "workfile"]
def process(self, context):
path = context.data["currentFile"]

View file

@ -2,7 +2,7 @@ import pyblish.api
from ayon_core.pipeline import registered_host
class SaveCurrentScene(pyblish.api.ContextPlugin):
class SaveCurrentScene(pyblish.api.InstancePlugin):
"""Save current scene"""
label = "Save current file"
@ -10,13 +10,15 @@ class SaveCurrentScene(pyblish.api.ContextPlugin):
hosts = ["max"]
families = ["maxrender", "workfile"]
def process(self, context):
def process(self, instance):
host = registered_host()
current_file = host.get_current_workfile()
assert context.data["currentFile"] == current_file
assert instance.context.data["currentFile"] == current_file
if instance.data["productType"] == "maxrender":
host.save_workfile(current_file)
if host.workfile_has_unsaved_changes():
elif host.workfile_has_unsaved_changes():
self.log.info(f"Saving current file: {current_file}")
host.save_workfile(current_file)
else:

View file

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
import pyblish.api
from ayon_core.pipeline import PublishValidationError
from pymxs import runtime as rt
class ValidateExtendedViewport(pyblish.api.ContextPlugin):
"""Validate if the first viewport is an extended viewport."""
order = pyblish.api.ValidatorOrder
families = ["review"]
hosts = ["max"]
label = "Validate Extended Viewport"
def process(self, context):
try:
rt.viewport.activeViewportEx(1)
except RuntimeError:
raise PublishValidationError(
"Please make sure one viewport is not an extended viewport",
description = (
"Please make sure at least one viewport is not an "
"extended viewport but a 3dsmax supported viewport "
"i.e camera/persp/orthographic view.\n\n"
"To rectify it, please go to view in the top menubar, "
"go to Views -> Viewports Configuration -> Layout and "
"right click on one of the panels to change it."
))

View file

@ -172,7 +172,7 @@ class CollectUpstreamInputs(pyblish.api.InstancePlugin):
"""Collects inputs from nodes in renderlayer, incl. shaders + camera"""
# Get the renderlayer
renderlayer = instance.data.get("renderlayer")
renderlayer = instance.data.get("setMembers")
if renderlayer == "defaultRenderLayer":
# Assume all loaded containers in the scene are inputs

View file

@ -3,7 +3,7 @@ import collections
from ayon_core.lib.attribute_definitions import BoolDef
from ayon_core.pipeline import (
get_representation_context,
register_host,
registered_host,
)
from ayon_core.hosts.tvpaint.api import plugin
from ayon_core.hosts.tvpaint.api.lib import (
@ -176,7 +176,7 @@ class LoadImage(plugin.Loader):
return
representation = container["representation"]
members = self.get_members_from_container(container)
host = register_host()
host = registered_host()
current_containers = host.get_containers()
pop_idx = None
for idx, cur_con in enumerate(current_containers):

@ -1 +1 @@
Subproject commit 6d2793170ed57187842f683a943593973abcc337
Subproject commit 04b35dbf5fc42d905281fc30d3a22b139c1855e5

View file

@ -157,12 +157,6 @@ from .ayon_info import (
is_in_tests,
)
from .connections import (
requests_get,
requests_post
)
terminal = Terminal
__all__ = [
@ -278,7 +272,4 @@ __all__ = [
"is_staging_enabled",
"is_dev_mode_enabled",
"is_in_tests",
"requests_get",
"requests_post"
]

View file

@ -1,38 +0,0 @@
import requests
import os
def requests_post(*args, **kwargs):
"""Wrap request post method.
Disabling SSL certificate validation if ``DONT_VERIFY_SSL`` environment
variable is found. This is useful when Deadline server is
running with self-signed certificates and its certificate is not
added to trusted certificates on client machines.
Warning:
Disabling SSL certificate validation is defeating one line
of defense SSL is providing, and it is not recommended.
"""
if "verify" not in kwargs:
kwargs["verify"] = not os.getenv("OPENPYPE_DONT_VERIFY_SSL", True)
return requests.post(*args, **kwargs)
def requests_get(*args, **kwargs):
"""Wrap request get method.
Disabling SSL certificate validation if ``DONT_VERIFY_SSL`` environment
variable is found. This is useful when Deadline server is
running with self-signed certificates and its certificate is not
added to trusted certificates on client machines.
Warning:
Disabling SSL certificate validation is defeating one line
of defense SSL is providing, and it is not recommended.
"""
if "verify" not in kwargs:
kwargs["verify"] = not os.getenv("OPENPYPE_DONT_VERIFY_SSL", True)
return requests.get(*args, **kwargs)

View file

@ -29,6 +29,10 @@ from ayon_core.pipeline.publish.lib import (
JSONDecodeError = getattr(json.decoder, "JSONDecodeError", ValueError)
# TODO both 'requests_post' and 'requests_get' should not set 'verify' based
# on environment variable. This should be done in a more controlled way,
# e.g. each deadline url could have checkbox to enabled/disable
# ssl verification.
def requests_post(*args, **kwargs):
"""Wrap request post method.

View file

@ -1,9 +1,10 @@
import os
import requests
import six
import sys
from ayon_core.lib import requests_get, Logger
import requests
import six
from ayon_core.lib import Logger
from ayon_core.modules import AYONAddon, IPluginPaths
@ -56,6 +57,8 @@ class DeadlineModule(AYONAddon, IPluginPaths):
RuntimeError: If deadline webservice is unreachable.
"""
from .abstract_submit_deadline import requests_get
if not log:
log = Logger.get_logger(__name__)

View file

@ -112,9 +112,13 @@ class CollectAudio(pyblish.api.ContextPlugin):
Returns:
collections.defaultdict[str, List[Dict[Str, Any]]]: Representations
related to audio products by folder path.
"""
"""
output = collections.defaultdict(list)
# Skip the queries if audio product name is not defined
if not self.audio_product_name:
return output
# Query folder entities
folder_entities = ayon_api.get_folders(
project_name,

View file

@ -1067,6 +1067,38 @@ PixmapButton:disabled {
font-size: 13pt;
}
#PublisherVerticalScrollArea QScrollBar {
background: transparent;
margin: 0;
border: none;
}
#PublisherVerticalScrollArea QScrollBar:horizontal {
height: 10px;
margin: 0;
}
#PublisherVerticalScrollArea QScrollBar:vertical {
width: 10px;
margin: 0;
}
#PublisherVerticalScrollArea QScrollBar::handle {
background: {color:bg-scroll-handle};
border-radius: 4px;
margin: 1px;
}
#PublisherVerticalScrollArea QScrollBar::handle:horizontal {
min-width: 20px;
min-height: 8px;
}
#PublisherVerticalScrollArea QScrollBar::handle:vertical {
min-height: 20px;
min-width: 8px;
}
ValidationArtistMessage QLabel {
font-size: 20pt;
font-weight: bold;

View file

@ -56,6 +56,8 @@ class VerticalScrollArea(QtWidgets.QScrollArea):
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.setLayoutDirection(QtCore.Qt.RightToLeft)
self.setObjectName("PublisherVerticalScrollArea")
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
# Background of scrollbar will be transparent
scrollbar_bg = self.verticalScrollBar().parent()
@ -500,7 +502,9 @@ class ValidationErrorsView(QtWidgets.QWidget):
errors_scroll.setWidget(errors_widget)
errors_layout = QtWidgets.QVBoxLayout(errors_widget)
errors_layout.setContentsMargins(0, 0, 0, 0)
# Add 5 margin to left so the is not directly on the edge of the
# scroll widget
errors_layout.setContentsMargins(5, 0, 0, 0)
layout = QtWidgets.QVBoxLayout(self)
layout.addWidget(errors_scroll, 1)

View file

@ -355,7 +355,7 @@ class RedshiftSettingsModel(BaseSettingsModel):
)
additional_options: list[AdditionalOptionsModel] = SettingsField(
default_factory=list,
title="Additional Vray Options",
title="Additional Redshift Options",
description=(
"Add additional options - put attribute and value, like "
"reflectionMaxTraceDepth and 3"