mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
add AYON settings support and finalize the settings
This commit is contained in:
parent
db26cdd6e3
commit
1e4005f445
4 changed files with 102 additions and 2 deletions
|
|
@ -35,9 +35,9 @@ class CreateReview(plugin.MaxCreator):
|
|||
cls.visual_style = settings.get("visual_style", cls.visual_style)
|
||||
cls.viewport_preset = settings.get(
|
||||
"viewport_preset", cls.viewport_preset)
|
||||
cls.vp_texture = settings.get("vp_texture", cls.vp_texture)
|
||||
cls.anti_aliasing = settings.get(
|
||||
"anti_aliasing", cls.anti_aliasing)
|
||||
cls.vp_texture = settings.get("vp_texture", cls.vp_texture)
|
||||
|
||||
def create(self, subset_name, instance_data, pre_create_data):
|
||||
# Transfer settings from pre create to instance
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ from .imageio import ImageIOSettings
|
|||
from .render_settings import (
|
||||
RenderSettingsModel, DEFAULT_RENDER_SETTINGS
|
||||
)
|
||||
from .preview_animation import (
|
||||
PreviewAnimationModel, DEFAULT_PREVIEW_ANIMATION_SETTINGS
|
||||
)
|
||||
from .publishers import (
|
||||
PublishersModel, DEFAULT_PUBLISH_SETTINGS
|
||||
)
|
||||
|
|
@ -29,6 +32,10 @@ class MaxSettings(BaseSettingsModel):
|
|||
default_factory=RenderSettingsModel,
|
||||
title="Render Settings"
|
||||
)
|
||||
PreviewAnimation: PreviewAnimationModel = Field(
|
||||
default_factory=PreviewAnimationModel,
|
||||
title="Preview Animation"
|
||||
)
|
||||
PointCloud: PointCloudSettings = Field(
|
||||
default_factory=PointCloudSettings,
|
||||
title="Point Cloud"
|
||||
|
|
@ -40,6 +47,7 @@ class MaxSettings(BaseSettingsModel):
|
|||
|
||||
DEFAULT_VALUES = {
|
||||
"RenderSettings": DEFAULT_RENDER_SETTINGS,
|
||||
"PreviewAnimation": DEFAULT_PREVIEW_ANIMATION_SETTINGS,
|
||||
"PointCloud": {
|
||||
"attribute": [
|
||||
{"name": "Age", "value": "age"},
|
||||
|
|
|
|||
92
server_addon/max/server/settings/preview_animation.py
Normal file
92
server_addon/max/server/settings/preview_animation.py
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
from pydantic import Field
|
||||
|
||||
from ayon_server.settings import BaseSettingsModel
|
||||
|
||||
|
||||
def image_format_enum():
|
||||
"""Return enumerator for image output formats."""
|
||||
return [
|
||||
{"label": "exr", "value": "exr"},
|
||||
{"label": "jpg", "value": "jpg"},
|
||||
{"label": "png", "value": "png"},
|
||||
{"label": "tga", "value": "tga"}
|
||||
]
|
||||
|
||||
|
||||
def visual_style_enum():
|
||||
"""Return enumerator for viewport visual style."""
|
||||
return [
|
||||
{"label": "Realistic", "value": "Realistic"},
|
||||
{"label": "Shaded", "value": "Shaded"},
|
||||
{"label": "Facets", "value": "Facets"},
|
||||
{"label": "ConsistentColors",
|
||||
"value": "ConsistentColors"},
|
||||
{"label": "Wireframe", "value": "Wireframe"},
|
||||
{"label": "BoundingBox", "value": "BoundingBox"},
|
||||
{"label": "Ink", "value": "Ink"},
|
||||
{"label": "ColorInk", "value": "ColorInk"},
|
||||
{"label": "Acrylic", "value": "Acrylic"},
|
||||
{"label": "Tech", "value": "Tech"},
|
||||
{"label": "Graphite", "value": "Graphite"},
|
||||
{"label": "ColorPencil", "value": "ColorPencil"},
|
||||
{"label": "Pastel", "value": "Pastel"},
|
||||
{"label": "Clay", "value": "Clay"},
|
||||
{"label": "ModelAssist", "value": "ModelAssist"}
|
||||
]
|
||||
|
||||
def visual_preset_enum():
|
||||
"""Return enumerator for viewport visual preset."""
|
||||
return [
|
||||
{"label": "Quality", "value": "Quality"},
|
||||
{"label": "Standard", "value": "Standard"},
|
||||
{"label": "Performance", "value": "Performance"},
|
||||
{"label": "DXMode", "value": "DXMode"},
|
||||
{"label": "Customize", "value": "Customize"},
|
||||
]
|
||||
|
||||
|
||||
def anti_aliasing_enum():
|
||||
"""Return enumerator for viewport anti-aliasing."""
|
||||
return [
|
||||
{"label": "None", "value": "None"},
|
||||
{"label": "2X", "value": "2X"},
|
||||
{"label": "4X", "value": "4X"},
|
||||
{"label": "8X", "value": "8X"}
|
||||
]
|
||||
|
||||
|
||||
class PreviewAnimationModel(BaseSettingsModel):
|
||||
review_width: int = Field(1920, title="Review Width")
|
||||
review_height: int = Field(1080, title="Review Height")
|
||||
percentSize: float = Field(100.0, title="Percent of Output")
|
||||
keep_images: bool = Field(False, title="Keep Image Sequences")
|
||||
image_format: str = Field(
|
||||
enum_resolver=image_format_enum,
|
||||
title="Image Format Options"
|
||||
)
|
||||
visual_style: str = Field(
|
||||
enum_resolver=visual_style_enum,
|
||||
title="Preference"
|
||||
)
|
||||
viewport_preset: str = Field(
|
||||
enum_resolver=visual_preset_enum,
|
||||
title="Pre-View Preset"
|
||||
)
|
||||
anti_aliasing: str = Field(
|
||||
enum_resolver=anti_aliasing_enum,
|
||||
title="Anti-aliasing Quality"
|
||||
)
|
||||
vp_texture: bool = Field(True, title="Viewport Texture")
|
||||
|
||||
|
||||
DEFAULT_PREVIEW_ANIMATION_SETTINGS = {
|
||||
"review_width": 1920,
|
||||
"review_height": 1080,
|
||||
"percentSize": 100.0,
|
||||
"keep_images": False,
|
||||
"image_format": "png",
|
||||
"visual_style": "Realistic",
|
||||
"viewport_preset": "Quality",
|
||||
"anti_aliasing": "None",
|
||||
"vp_texture": True
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.1.0"
|
||||
__version__ = "0.1.1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue