mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
This is preparation for new version of pydantic which will require to customize the field for AYON purposes and raw pydantic Field could not be used.
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
from ayon_server.settings import BaseSettingsModel, SettingsField
|
|
|
|
|
|
class ScriptsmenuSubmodel(BaseSettingsModel):
|
|
"""Item Definition"""
|
|
_isGroup = True
|
|
type: str = SettingsField(title="Type")
|
|
command: str = SettingsField(title="Command")
|
|
sourcetype: str = SettingsField(title="Source Type")
|
|
title: str = SettingsField(title="Title")
|
|
tooltip: str = SettingsField(title="Tooltip")
|
|
tags: list[str] = SettingsField(default_factory=list, title="A list of tags")
|
|
|
|
|
|
class ScriptsmenuModel(BaseSettingsModel):
|
|
_isGroup = True
|
|
|
|
name: str = SettingsField(title="Menu Name")
|
|
definition: list[ScriptsmenuSubmodel] = SettingsField(
|
|
default_factory=list,
|
|
title="Menu Definition",
|
|
description="Scriptmenu Items Definition"
|
|
)
|
|
|
|
|
|
DEFAULT_SCRIPTSMENU_SETTINGS = {
|
|
"name": "Custom Tools",
|
|
"definition": [
|
|
{
|
|
"type": "action",
|
|
"command": "import openpype.hosts.maya.api.commands as op_cmds; op_cmds.edit_shader_definitions()",
|
|
"sourcetype": "python",
|
|
"title": "Edit shader name definitions",
|
|
"tooltip": "Edit shader name definitions used in validation and renaming.",
|
|
"tags": [
|
|
"pipeline",
|
|
"shader"
|
|
]
|
|
}
|
|
]
|
|
}
|