Merge branch 'develop' into enhancement/OP-7075_Validate-Camera-Attributes

This commit is contained in:
Libor Batek 2024-02-21 12:19:13 +01:00 committed by GitHub
commit 6ec4e4e95c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
155 changed files with 1462 additions and 2120 deletions

View file

@ -92,8 +92,9 @@ class ApplicationsAddon(BaseServerAddon):
settings_model = ApplicationsAddonSettings
async def get_default_settings(self):
applications_path = os.path.join(self.addon_dir, "applications.json")
tools_path = os.path.join(self.addon_dir, "tools.json")
server_dir = os.path.join(self.addon_dir, "server")
applications_path = os.path.join(server_dir, "applications.json")
tools_path = os.path.join(server_dir, "tools.json")
default_values = copy.deepcopy(DEFAULT_VALUES)
with open(applications_path, "r") as stream:
default_values.update(json.load(stream))

View file

@ -23,6 +23,13 @@ def image_format_enum():
]
def renderers_enum():
return [
{"value": "CYCLES", "label": "Cycles"},
{"value": "BLENDER_EEVEE", "label": "Eevee"},
]
def aov_list_enum():
return [
{"value": "empty", "label": "< none >"},
@ -30,18 +37,52 @@ def aov_list_enum():
{"value": "z", "label": "Z"},
{"value": "mist", "label": "Mist"},
{"value": "normal", "label": "Normal"},
{"value": "diffuse_light", "label": "Diffuse Light"},
{"value": "position", "label": "Position (Cycles Only)"},
{"value": "vector", "label": "Vector (Cycles Only)"},
{"value": "uv", "label": "UV (Cycles Only)"},
{"value": "denoising", "label": "Denoising Data (Cycles Only)"},
{"value": "object_index", "label": "Object Index (Cycles Only)"},
{"value": "material_index", "label": "Material Index (Cycles Only)"},
{"value": "sample_count", "label": "Sample Count (Cycles Only)"},
{"value": "diffuse_light", "label": "Diffuse Light/Direct"},
{
"value": "diffuse_indirect",
"label": "Diffuse Indirect (Cycles Only)"
},
{"value": "diffuse_color", "label": "Diffuse Color"},
{"value": "specular_light", "label": "Specular Light"},
{"value": "specular_color", "label": "Specular Color"},
{"value": "volume_light", "label": "Volume Light"},
{"value": "specular_light", "label": "Specular (Glossy) Light/Direct"},
{
"value": "specular_indirect",
"label": "Specular (Glossy) Indirect (Cycles Only)"
},
{"value": "specular_color", "label": "Specular (Glossy) Color"},
{
"value": "transmission_light",
"label": "Transmission Light/Direct (Cycles Only)"
},
{
"value": "transmission_indirect",
"label": "Transmission Indirect (Cycles Only)"
},
{
"value": "transmission_color",
"label": "Transmission Color (Cycles Only)"
},
{"value": "volume_light", "label": "Volume Light/Direct"},
{"value": "volume_indirect", "label": "Volume Indirect (Cycles Only)"},
{"value": "emission", "label": "Emission"},
{"value": "environment", "label": "Environment"},
{"value": "shadow", "label": "Shadow"},
{"value": "shadow", "label": "Shadow/Shadow Catcher"},
{"value": "ao", "label": "Ambient Occlusion"},
{"value": "denoising", "label": "Denoising"},
{"value": "volume_direct", "label": "Direct Volumetric Scattering"},
{"value": "volume_indirect", "label": "Indirect Volumetric Scattering"}
{"value": "bloom", "label": "Bloom (Eevee Only)"},
{"value": "transparent", "label": "Transparent (Eevee Only)"},
{"value": "cryptomatte_object", "label": "Cryptomatte Object"},
{"value": "cryptomatte_material", "label": "Cryptomatte Material"},
{"value": "cryptomatte_asset", "label": "Cryptomatte Asset"},
{
"value": "cryptomatte_accurate",
"label": "Cryptomatte Accurate Mode (Eevee Only)"
},
]
@ -81,6 +122,14 @@ class RenderSettingsModel(BaseSettingsModel):
multilayer_exr: bool = SettingsField(
title="Multilayer (EXR)"
)
renderer: str = SettingsField(
"CYCLES",
title="Renderer",
enum_resolver=renderers_enum
)
compositing: bool = SettingsField(
title="Enable Compositing"
)
aov_list: list[str] = SettingsField(
default_factory=list,
enum_resolver=aov_list_enum,
@ -102,6 +151,8 @@ DEFAULT_RENDER_SETTINGS = {
"aov_separator": "underscore",
"image_format": "exr",
"multilayer_exr": True,
"aov_list": [],
"renderer": "CYCLES",
"compositing": True,
"aov_list": ["combined"],
"custom_passes": []
}

View file

@ -1 +1 @@
__version__ = "0.1.5"
__version__ = "0.1.6"

View file

@ -40,6 +40,11 @@ IGNORED_HOSTS = [
IGNORED_MODULES = []
PACKAGE_PY_TEMPLATE = """name = "{addon_name}"
version = "{addon_version}"
plugin_for = ["ayon_server"]
"""
class ZipFileLongPaths(zipfile.ZipFile):
"""Allows longer paths in zip files.
@ -144,18 +149,12 @@ def create_addon_zip(
output_dir: Path,
addon_name: str,
addon_version: str,
keep_source: bool
keep_source: bool,
):
zip_filepath = output_dir / f"{addon_name}-{addon_version}.zip"
addon_output_dir = output_dir / addon_name / addon_version
with ZipFileLongPaths(zip_filepath, "w", zipfile.ZIP_DEFLATED) as zipf:
zipf.writestr(
"manifest.json",
json.dumps({
"addon_name": addon_name,
"addon_version": addon_version
})
)
# Add client code content to zip
src_root = os.path.normpath(str(addon_output_dir.absolute()))
src_root_offset = len(src_root) + 1
@ -167,9 +166,10 @@ def create_addon_zip(
for filename in filenames:
src_path = os.path.join(root, filename)
if rel_root:
dst_path = os.path.join("addon", rel_root, filename)
dst_path = os.path.join(rel_root, filename)
else:
dst_path = os.path.join("addon", filename)
dst_path = filename
zipf.write(src_path, dst_path)
if not keep_source:
@ -180,9 +180,8 @@ def create_addon_package(
addon_dir: Path,
output_dir: Path,
create_zip: bool,
keep_source: bool
keep_source: bool,
):
server_dir = addon_dir / "server"
addon_version = get_addon_version(addon_dir)
addon_output_dir = output_dir / addon_dir.name / addon_version
@ -191,18 +190,21 @@ def create_addon_package(
addon_output_dir.mkdir(parents=True)
# Copy server content
src_root = os.path.normpath(str(server_dir.absolute()))
src_root_offset = len(src_root) + 1
for root, _, filenames in os.walk(str(server_dir)):
dst_root = addon_output_dir
if root != src_root:
rel_root = root[src_root_offset:]
dst_root = dst_root / rel_root
package_py = addon_output_dir / "package.py"
addon_name = addon_dir.name
if addon_name == "royal_render":
addon_name = "royalrender"
package_py_content = PACKAGE_PY_TEMPLATE.format(
addon_name=addon_name, addon_version=addon_version
)
dst_root.mkdir(parents=True, exist_ok=True)
for filename in filenames:
src_path = os.path.join(root, filename)
shutil.copy(src_path, str(dst_root))
with open(package_py, "w+") as pkg_py:
pkg_py.write(package_py_content)
server_dir = addon_dir / "server"
shutil.copytree(
server_dir, addon_output_dir / "server", dirs_exist_ok=True
)
if create_zip:
create_addon_zip(

View file

@ -1,72 +1,88 @@
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.types import ColorRGB_float
from ayon_server.types import ColorRGB_float, ColorRGBA_uint8
class ColorsSetting(BaseSettingsModel):
model: ColorRGB_float = SettingsField(
(0.82, 0.52, 0.12),
title="Model:"
)
rig: ColorRGB_float = SettingsField(
(0.23, 0.89, 0.92),
title="Rig:"
)
pointcache: ColorRGB_float = SettingsField(
(0.37, 0.82, 0.12),
title="Pointcache:"
)
animation: ColorRGB_float = SettingsField(
(0.37, 0.82, 0.12),
title="Animation:"
)
ass: ColorRGB_float = SettingsField(
(0.98, 0.53, 0.21),
title="Arnold StandIn:"
)
camera: ColorRGB_float = SettingsField(
(0.53, 0.45, 0.96),
title="Camera:"
)
fbx: ColorRGB_float = SettingsField(
(0.84, 0.65, 1.0),
title="FBX:"
)
mayaAscii: ColorRGB_float = SettingsField(
(0.26, 0.68, 1.0),
title="Maya Ascii:"
)
mayaScene: ColorRGB_float = SettingsField(
(0.26, 0.68, 1.0),
title="Maya Scene:"
)
setdress: ColorRGB_float = SettingsField(
(1.0, 0.98, 0.35),
title="Set Dress:"
)
layout: ColorRGB_float = SettingsField(
(1.0, 0.98, 0.35),
title="Layout:"
)
vdbcache: ColorRGB_float = SettingsField(
(0.98, 0.21, 0.0),
title="VDB Cache:"
)
vrayproxy: ColorRGB_float = SettingsField(
(1.0, 0.59, 0.05),
title="VRay Proxy:"
)
vrayscene_layer: ColorRGB_float = SettingsField(
(1.0, 0.59, 0.05),
title="VRay Scene:"
)
yeticache: ColorRGB_float = SettingsField(
(0.39, 0.81, 0.86),
title="Yeti Cache:"
)
yetiRig: ColorRGB_float = SettingsField(
(0.0, 0.80, 0.49),
title="Yeti Rig:"
)
model: ColorRGBA_uint8 = SettingsField(
(209, 132, 30, 1.0), title="Model:")
rig: ColorRGBA_uint8 = SettingsField(
(59, 226, 235, 1.0), title="Rig:")
pointcache: ColorRGBA_uint8 = SettingsField(
(94, 209, 30, 1.0), title="Pointcache:")
animation: ColorRGBA_uint8 = SettingsField(
(94, 209, 30, 1.0), title="Animation:")
ass: ColorRGBA_uint8 = SettingsField(
(249, 135, 53, 1.0), title="Arnold StandIn:")
camera: ColorRGBA_uint8 = SettingsField(
(136, 114, 244, 1.0), title="Camera:")
fbx: ColorRGBA_uint8 = SettingsField(
(215, 166, 255, 1.0), title="FBX:")
mayaAscii: ColorRGBA_uint8 = SettingsField(
(67, 174, 255, 1.0), title="Maya Ascii:")
mayaScene: ColorRGBA_uint8 = SettingsField(
(67, 174, 255, 1.0), title="Maya Scene:")
setdress: ColorRGBA_uint8 = SettingsField(
(255, 250, 90, 1.0), title="Set Dress:")
layout: ColorRGBA_uint8 = SettingsField((
255, 250, 90, 1.0), title="Layout:")
vdbcache: ColorRGBA_uint8 = SettingsField(
(249, 54, 0, 1.0), title="VDB Cache:")
vrayproxy: ColorRGBA_uint8 = SettingsField(
(255, 150, 12, 1.0), title="VRay Proxy:")
vrayscene_layer: ColorRGBA_uint8 = SettingsField(
(255, 150, 12, 1.0), title="VRay Scene:")
yeticache: ColorRGBA_uint8 = SettingsField(
(99, 206, 220, 1.0), title="Yeti Cache:")
yetiRig: ColorRGBA_uint8 = SettingsField(
(0, 205, 125, 1.0), title="Yeti Rig:")
# model: ColorRGB_float = SettingsField(
# (0.82, 0.52, 0.12), title="Model:"
# )
# rig: ColorRGB_float = SettingsField(
# (0.23, 0.89, 0.92), title="Rig:"
# )
# pointcache: ColorRGB_float = SettingsField(
# (0.37, 0.82, 0.12), title="Pointcache:"
# )
# animation: ColorRGB_float = SettingsField(
# (0.37, 0.82, 0.12), title="Animation:"
# )
# ass: ColorRGB_float = SettingsField(
# (0.98, 0.53, 0.21), title="Arnold StandIn:"
# )
# camera: ColorRGB_float = SettingsField(
# (0.53, 0.45, 0.96), title="Camera:"
# )
# fbx: ColorRGB_float = SettingsField(
# (0.84, 0.65, 1.0), title="FBX:"
# )
# mayaAscii: ColorRGB_float = SettingsField(
# (0.26, 0.68, 1.0), title="Maya Ascii:"
# )
# mayaScene: ColorRGB_float = SettingsField(
# (0.26, 0.68, 1.0), title="Maya Scene:"
# )
# setdress: ColorRGB_float = SettingsField(
# (1.0, 0.98, 0.35), title="Set Dress:"
# )
# layout: ColorRGB_float = SettingsField(
# (1.0, 0.98, 0.35), title="Layout:"
# )
# vdbcache: ColorRGB_float = SettingsField(
# (0.98, 0.21, 0.0), title="VDB Cache:"
# )
# vrayproxy: ColorRGB_float = SettingsField(
# (1.0, 0.59, 0.05), title="VRay Proxy:"
# )
# vrayscene_layer: ColorRGB_float = SettingsField(
# (1.0, 0.59, 0.05), title="VRay Scene:"
# )
# yeticache: ColorRGB_float = SettingsField(
# (0.39, 0.81, 0.86), title="Yeti Cache:"
# )
# yetiRig: ColorRGB_float = SettingsField(
# (0.0, 0.80, 0.49), title="Yeti Rig:"
# )
class ReferenceLoaderModel(BaseSettingsModel):
@ -99,22 +115,38 @@ class LoadersModel(BaseSettingsModel):
DEFAULT_LOADERS_SETTING = {
"colors": {
"model": [0.82, 0.52, 0.12],
"rig": [0.23, 0.89, 0.92],
"pointcache": [0.37, 0.82, 0.12],
"animation": [0.37, 0.82, 0.12],
"ass": [0.98, 0.53, 0.21],
"camera":[0.53, 0.45, 0.96],
"fbx": [0.84, 0.65, 1.0],
"mayaAscii": [0.26, 0.68, 1.0],
"mayaScene": [0.26, 0.68, 1.0],
"setdress": [1.0, 0.98, 0.35],
"layout": [1.0, 0.98, 0.35],
"vdbcache": [0.98, 0.21, 0.0],
"vrayproxy": [1.0, 0.59, 0.05],
"vrayscene_layer": [1.0, 0.59, 0.05],
"yeticache": [0.39, 0.81, 0.86],
"yetiRig": [0.0, 0.80, 0.49],
"model": [209, 132, 30, 1.0],
"rig": [59, 226, 235, 1.0],
"pointcache": [94, 209, 30, 1.0],
"animation": [94, 209, 30, 1.0],
"ass": [249, 135, 53, 1.0],
"camera": [136, 114, 244, 1.0],
"fbx": [215, 166, 255, 1.0],
"mayaAscii": [67, 174, 255, 1.0],
"mayaScene": [67, 174, 255, 1.0],
"setdress": [255, 250, 90, 1.0],
"layout": [255, 250, 90, 1.0],
"vdbcache": [249, 54, 0, 1.0],
"vrayproxy": [255, 150, 12, 1.0],
"vrayscene_layer": [255, 150, 12, 1.0],
"yeticache": [99, 206, 220, 1.0],
"yetiRig": [0, 205, 125, 1.0]
# "model": [0.82, 0.52, 0.12],
# "rig": [0.23, 0.89, 0.92],
# "pointcache": [0.37, 0.82, 0.12],
# "animation": [0.37, 0.82, 0.12],
# "ass": [0.98, 0.53, 0.21],
# "camera":[0.53, 0.45, 0.96],
# "fbx": [0.84, 0.65, 1.0],
# "mayaAscii": [0.26, 0.68, 1.0],
# "mayaScene": [0.26, 0.68, 1.0],
# "setdress": [1.0, 0.98, 0.35],
# "layout": [1.0, 0.98, 0.35],
# "vdbcache": [0.98, 0.21, 0.0],
# "vrayproxy": [1.0, 0.59, 0.05],
# "vrayscene_layer": [1.0, 0.59, 0.05],
# "yeticache": [0.39, 0.81, 0.86],
# "yetiRig": [0.0, 0.80, 0.49],
},
"reference_loader": {
"namespace": "{folder[name]}_{product[name]}_##_",

View file

@ -6,7 +6,7 @@ from ayon_server.settings import (
ensure_unique_names,
task_types_enum,
)
from ayon_server.types import ColorRGB_float
from ayon_server.types import ColorRGBA_uint8, ColorRGB_float
def hardware_falloff_enum():
@ -54,18 +54,27 @@ class DisplayOptionsSetting(BaseSettingsModel):
override_display: bool = SettingsField(
True, title="Override display options"
)
background: ColorRGB_float = SettingsField(
(0.5, 0.5, 0.5), title="Background Color"
background: ColorRGBA_uint8 = SettingsField(
(125, 125, 125, 1.0), title="Background Color"
)
# background: ColorRGB_float = SettingsField(
# (0.5, 0.5, 0.5), title="Background Color"
# )
displayGradient: bool = SettingsField(
True, title="Display background gradient"
)
backgroundTop: ColorRGB_float = SettingsField(
(0.5, 0.5, 0.5), title="Background Top"
backgroundTop: ColorRGBA_uint8 = SettingsField(
(125, 125, 125, 1.0), title="Background Top"
)
backgroundBottom: ColorRGB_float = SettingsField(
(0.5, 0.5, 0.5), title="Background Bottom"
backgroundBottom: ColorRGBA_uint8 = SettingsField(
(125, 125, 125, 1.0), title="Background Bottom"
)
# backgroundTop: ColorRGB_float = SettingsField(
# (0.5, 0.5, 0.5), title="Background Top"
# )
# backgroundBottom: ColorRGB_float = SettingsField(
# (0.5, 0.5, 0.5), title="Background Bottom"
# )
class GenericSetting(BaseSettingsModel):
@ -282,21 +291,12 @@ DEFAULT_PLAYBLAST_SETTING = {
},
"DisplayOptions": {
"override_display": True,
"background": [
0.5,
0.5,
0.5
],
"backgroundBottom": [
0.5,
0.5,
0.5
],
"backgroundTop": [
0.5,
0.5,
0.5
],
"background": [125, 125, 125, 1.0],
"backgroundBottom": [125, 125, 125, 1.0],
"backgroundTop": [125, 125, 125, 1.0],
# "background": [0.5, 0.5, 0.5],
# "backgroundBottom": [0.5, 0.5, 0.5],
# "backgroundTop": [0.5, 0.5, 0.5],
"displayGradient": True
},
"Generic": {

View file

@ -1,5 +1,5 @@
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.types import ColorRGB_uint8
from ayon_server.types import ColorRGBA_uint8, ColorRGB_uint8
class CollectRenderInstancesModel(BaseSettingsModel):
@ -10,10 +10,12 @@ class CollectRenderInstancesModel(BaseSettingsModel):
class ExtractSequenceModel(BaseSettingsModel):
"""Review BG color is used for whole scene review and for thumbnails."""
# TODO Use alpha color
review_bg: ColorRGB_uint8 = SettingsField(
(255, 255, 255),
review_bg: ColorRGBA_uint8 = SettingsField(
(255, 255, 255, 1.0),
title="Review BG color")
# review_bg: ColorRGB_uint8 = SettingsField(
# (255, 255, 255),
# title="Review BG color")
class ValidatePluginModel(BaseSettingsModel):
@ -100,7 +102,8 @@ DEFAULT_PUBLISH_SETTINGS = {
"ignore_render_pass_transparency": False
},
"ExtractSequence": {
"review_bg": [255, 255, 255]
# "review_bg": [255, 255, 255]
"review_bg": [255, 255, 255, 1.0]
},
"ValidateProjectSettings": {
"enabled": True,