Merge branch 'develop' into chore/fix-settings-label-for-maya-render-settings

This commit is contained in:
Kayla Man 2024-01-29 15:52:59 +08:00 committed by GitHub
commit dbcf615453
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
172 changed files with 3370 additions and 3892 deletions

View file

@ -35,6 +35,12 @@ body:
label: Version
description: What version are you running? Look to OpenPype Tray
options:
- 3.18.6-nightly.1
- 3.18.5
- 3.18.5-nightly.3
- 3.18.5-nightly.2
- 3.18.5-nightly.1
- 3.18.4
- 3.18.4-nightly.1
- 3.18.3
- 3.18.3-nightly.2
@ -129,12 +135,6 @@ body:
- 3.15.8
- 3.15.8-nightly.3
- 3.15.8-nightly.2
- 3.15.8-nightly.1
- 3.15.7
- 3.15.7-nightly.3
- 3.15.7-nightly.2
- 3.15.7-nightly.1
- 3.15.6
validations:
required: true
- type: dropdown

View file

@ -1,6 +1,366 @@
# Changelog
## [3.18.5](https://github.com/ynput/OpenPype/tree/3.18.5)
[Full Changelog](https://github.com/ynput/OpenPype/compare/3.18.4...3.18.5)
### **🚀 Enhancements**
<details>
<summary>Chore: Add addons dir only if exists <a href="https://github.com/ynput/OpenPype/pull/6140">#6140</a></summary>
Do not add addons directory path for addons discovery if does not exists.
___
</details>
<details>
<summary>Hiero: Effect Categories - OP-7397 <a href="https://github.com/ynput/OpenPype/pull/6143">#6143</a></summary>
This PR introduces `Effect Categories` for the Hiero settings. This allows studios to split effect stacks into meaningful subsets.
___
</details>
<details>
<summary>Nuke: Render Workfile Attributes <a href="https://github.com/ynput/OpenPype/pull/6146">#6146</a></summary>
`Workfile Dependency` default value can now be controlled from project settings.`Use Published Workfile` makes using published workfiles for rendering optional.
___
</details>
### **🐛 Bug fixes**
<details>
<summary>Maya: Attributes are locked after publishing if they are locked in Camera Family <a href="https://github.com/ynput/OpenPype/pull/6073">#6073</a></summary>
This PR is to make sure unlock attributes only during the bake context, make sure attributes are relocked after to preserve the lock state of the original node being baked.
___
</details>
<details>
<summary>Missing nuke family Windows arguments <a href="https://github.com/ynput/OpenPype/pull/6131">#6131</a></summary>
Default Windows arguments for launching the Nuke family was missing.
___
</details>
<details>
<summary>AYON: Fix the bug on the limit group not being set correctly in Maya Deadline Setting <a href="https://github.com/ynput/OpenPype/pull/6139">#6139</a></summary>
This PR is to bug-fix the limit groups from maya deadline settings errored out when the user tries to edit the setting.
___
</details>
<details>
<summary>Chore: Transcoding extensions add missing '.tif' extension <a href="https://github.com/ynput/OpenPype/pull/6142">#6142</a></summary>
Image extensions in transcoding helper was missing `.tif` extension and had `.tiff` twice.
___
</details>
<details>
<summary>Blender: Use the new API for override context <a href="https://github.com/ynput/OpenPype/pull/6145">#6145</a></summary>
Blender 4.0 disabled the old API to override context. This API updates the code to use the new API.
___
</details>
<details>
<summary>BugFix: Include Model in FBX Loader in Houdini <a href="https://github.com/ynput/OpenPype/pull/6150">#6150</a></summary>
A quick bugfig where we can't load fbx exported from blender. The bug was reported here.
___
</details>
<details>
<summary>Blender: Restore actions to objects after update <a href="https://github.com/ynput/OpenPype/pull/6153">#6153</a></summary>
Restore the actions assigned to objects after updating assets from blend files.
___
</details>
<details>
<summary>Chore: Collect template data with hierarchy context <a href="https://github.com/ynput/OpenPype/pull/6154">#6154</a></summary>
Fixed queue loop where is used wrong variable to pop items from queue.
___
</details>
<details>
<summary>OP-6382 - Thumbnail Integration Problem <a href="https://github.com/ynput/OpenPype/pull/6156">#6156</a></summary>
This ticket alerted to 3 different cases of integration issues;
- [x] Using the Tray Publisher with the same image format (extension) for representation and review representation.
- [x] Clash on publish file path from output definitions in `ExtractOIIOTranscode`.
- [x] Clash on publish file from thumbnail in `ExtractThumbnail`There might be an issue with this fix, if a studio does not use the `{output}` token in their `render` anatomy template. But thinking if they have customized it, they will be responsible to maintain these edge cases.
___
</details>
<details>
<summary>Max: Bugfix saving camera scene errored out when creating render instance with multi-camera option turned off <a href="https://github.com/ynput/OpenPype/pull/6163">#6163</a></summary>
This PR is to make sure the integrator of saving camera scene turned off and the render submitted successfully when multi-camera options being turned off in 3dsmax
___
</details>
<details>
<summary>Chore: Fix duplicated project name on create project structure <a href="https://github.com/ynput/OpenPype/pull/6166">#6166</a></summary>
Small fix in project folders. It is not used same variable name to change values which breaks values on any next loop.
___
</details>
### **Merged pull requests**
<details>
<summary>Maya: Remove duplicate plugin <a href="https://github.com/ynput/OpenPype/pull/6157">#6157</a></summary>
The two plugins below are doing the same work, so we can remove the one focused solely on lookdev.https://github.com/ynput/OpenPype/blob/develop/openpype/hosts/maya/plugins/publish/validate_look_members_unique.pyhttps://github.com/ynput/OpenPype/blob/develop/openpype/hosts/maya/plugins/publish/validate_node_ids_unique.py
___
</details>
<details>
<summary>Publish report viewer: Report items sorting <a href="https://github.com/ynput/OpenPype/pull/6092">#6092</a></summary>
Proposal of items sorting in Publish report viewer tool. Items are sorted by report creation time. Creation time is also added to publish report data when saved from publisher tool.
___
</details>
<details>
<summary>Maya: Extended error message <a href="https://github.com/ynput/OpenPype/pull/6161">#6161</a></summary>
Added more details to message
___
</details>
<details>
<summary>Fusion: Added settings for Fusion creators to legacy OP <a href="https://github.com/ynput/OpenPype/pull/6162">#6162</a></summary>
Added missing OP variant of setting for new Fusion creator.
___
</details>
## [3.18.4](https://github.com/ynput/OpenPype/tree/3.18.4)
[Full Changelog](https://github.com/ynput/OpenPype/compare/3.18.3...3.18.4)
### **🚀 Enhancements**
<details>
<summary>multiple render camera supports for 3dsmax <a href="https://github.com/ynput/OpenPype/pull/5124">#5124</a></summary>
Supports for rendering with multiple cameras in 3dsmax
- [x] Add Batch Render Layers functions
- [x] Rewrite lib.rendersetting and lib.renderproduct
- [x] Add multi-camera options in creator.
- [x] Collector with batch render-layer when multi-camera enabled.
- [x] Add instance plugin for saving scene files with different cameras respectively by using subprocess
- [x] Refactor submit_max_deadline
- [x] Check with metadata.json in submit publish job
___
</details>
<details>
<summary>Fusion: new creator for image product type <a href="https://github.com/ynput/OpenPype/pull/6057">#6057</a></summary>
In many DCC `render` product type is expected to be sequence of files. This PR adds new explicit creator for `image` product type which is focused on single frame image. Workflows for both product types might be a bit different, this gives artists more granularity to choose better workflow.
___
</details>
### **🐛 Bug fixes**
<details>
<summary>Maya: Account and ignore free image planes. <a href="https://github.com/ynput/OpenPype/pull/5993">#5993</a></summary>
Free image planes do not have the `->` path separator, so we need to account for that.
___
</details>
<details>
<summary>Blender: Fix long names for instances <a href="https://github.com/ynput/OpenPype/pull/6070">#6070</a></summary>
Changed naming for instances to use only final part of the `folderPath`.
___
</details>
<details>
<summary>Traypublisher & Chore: Instance version on follow workfile version <a href="https://github.com/ynput/OpenPype/pull/6117">#6117</a></summary>
If `follow_workfile_version` is enabled but context does not have filled workfile version, a version on instance is used instead.
___
</details>
<details>
<summary>Substance Painter: Thumbnail errors with PBR Texture Set <a href="https://github.com/ynput/OpenPype/pull/6127">#6127</a></summary>
When publishing with PBR Metallic Roughness as Output Template, Emissive Map errors out because of the missing channel in the material and the map can't be generated in Substance Painter. This PR is to make sure `imagestance.data["publish"] = False` so that the related "empty" texture instance would be skipped to generate the output.
___
</details>
<details>
<summary>Transcoding: Fix reading image sequences through oiiotool <a href="https://github.com/ynput/OpenPype/pull/6129">#6129</a></summary>
When transcoding image sequences, the second image onwards includes the invalid xml line of `Reading path/to/file.exr` of the oiiotool output.This is most likely not the best solution, but it fixes the issue and illustrates the problem.Error:
```
ERROR:pyblish.plugin:Traceback (most recent call last):
File "C:\Users\tokejepsen\AppData\Local\Ynput\AYON\dependency_packages\ayon_2310271602_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
runner(*args)
File "C:\Users\tokejepsen\OpenPype\openpype\plugins\publish\extract_color_transcode.py", line 152, in process
File "C:\Users\tokejepsen\OpenPype\openpype\lib\transcoding.py", line 1136, in convert_colorspace
input_info = get_oiio_info_for_input(input_path, logger=logger)
File "C:\Users\tokejepsen\OpenPype\openpype\lib\transcoding.py", line 124, in get_oiio_info_for_input
output.append(parse_oiio_xml_output(xml_text, logger=logger))
File "C:\Users\tokejepsen\OpenPype\openpype\lib\transcoding.py", line 276, in parse_oiio_xml_output
tree = xml.etree.ElementTree.fromstring(xml_string)
File "xml\etree\ElementTree.py", line 1347, in XML
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0
Traceback (most recent call last):
File "C:\Users\tokejepsen\AppData\Local\Ynput\AYON\dependency_packages\ayon_2310271602_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
runner(*args)
File "<string>", line 152, in process
File "C:\Users\tokejepsen\OpenPype\openpype\lib\transcoding.py", line 1136, in convert_colorspace
input_info = get_oiio_info_for_input(input_path, logger=logger)
File "C:\Users\tokejepsen\OpenPype\openpype\lib\transcoding.py", line 124, in get_oiio_info_for_input
output.append(parse_oiio_xml_output(xml_text, logger=logger))
File "C:\Users\tokejepsen\OpenPype\openpype\lib\transcoding.py", line 276, in parse_oiio_xml_output
tree = xml.etree.ElementTree.fromstring(xml_string)
File "xml\etree\ElementTree.py", line 1347, in XML
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0
```
___
</details>
<details>
<summary>AYON: Remove 'IntegrateHeroVersion' conversion <a href="https://github.com/ynput/OpenPype/pull/6130">#6130</a></summary>
Remove settings conversion for `IntegrateHeroVersion`.
___
</details>
<details>
<summary>Chore tools: Make sure style object is not garbage collected <a href="https://github.com/ynput/OpenPype/pull/6136">#6136</a></summary>
Minor fix in tool utils to make sure style C++ object is not garbage collected when not stored into variable.
___
</details>
## [3.18.3](https://github.com/ynput/OpenPype/tree/3.18.3)

View file

@ -127,8 +127,9 @@ def isolate_objects(window, objects):
context = create_blender_context(selected=objects, window=window)
bpy.ops.view3d.view_axis(context, type="FRONT")
bpy.ops.view3d.localview(context)
with bpy.context.temp_override(**context):
bpy.ops.view3d.view_axis(type="FRONT")
bpy.ops.view3d.localview()
deselect_all()
@ -270,10 +271,12 @@ def _independent_window():
"""Create capture-window context."""
context = create_blender_context()
current_windows = set(bpy.context.window_manager.windows)
bpy.ops.wm.window_new(context)
window = list(set(bpy.context.window_manager.windows) - current_windows)[0]
context["window"] = window
try:
yield window
finally:
bpy.ops.wm.window_close(context)
with bpy.context.temp_override(**context):
bpy.ops.wm.window_new()
window = list(
set(bpy.context.window_manager.windows) - current_windows)[0]
context["window"] = window
try:
yield window
finally:
bpy.ops.wm.window_close()

View file

@ -67,7 +67,8 @@ class AudioLoader(plugin.AssetLoader):
oc = bpy.context.copy()
oc["area"] = window_manager.windows[-1].screen.areas[0]
bpy.ops.sequencer.sound_strip_add(oc, filepath=libpath, frame_start=1)
with bpy.context.temp_override(**oc):
bpy.ops.sequencer.sound_strip_add(filepath=libpath, frame_start=1)
window_manager.windows[-1].screen.areas[0].type = old_type
@ -156,17 +157,18 @@ class AudioLoader(plugin.AssetLoader):
oc = bpy.context.copy()
oc["area"] = window_manager.windows[-1].screen.areas[0]
# We deselect all sequencer strips, and then select the one we
# need to remove.
bpy.ops.sequencer.select_all(oc, action='DESELECT')
scene = bpy.context.scene
scene.sequence_editor.sequences_all[old_audio].select = True
with bpy.context.temp_override(**oc):
# We deselect all sequencer strips, and then select the one we
# need to remove.
bpy.ops.sequencer.select_all(action='DESELECT')
scene = bpy.context.scene
scene.sequence_editor.sequences_all[old_audio].select = True
bpy.ops.sequencer.delete(oc)
bpy.data.sounds.remove(bpy.data.sounds[old_audio])
bpy.ops.sequencer.delete()
bpy.data.sounds.remove(bpy.data.sounds[old_audio])
bpy.ops.sequencer.sound_strip_add(
oc, filepath=str(libpath), frame_start=1)
bpy.ops.sequencer.sound_strip_add(
filepath=str(libpath), frame_start=1)
window_manager.windows[-1].screen.areas[0].type = old_type
@ -205,12 +207,13 @@ class AudioLoader(plugin.AssetLoader):
oc = bpy.context.copy()
oc["area"] = window_manager.windows[-1].screen.areas[0]
# We deselect all sequencer strips, and then select the one we
# need to remove.
bpy.ops.sequencer.select_all(oc, action='DESELECT')
bpy.context.scene.sequence_editor.sequences_all[audio].select = True
bpy.ops.sequencer.delete(oc)
with bpy.context.temp_override(**oc):
# We deselect all sequencer strips, and then select the one we
# need to remove.
bpy.ops.sequencer.select_all(action='DESELECT')
scene = bpy.context.scene
scene.sequence_editor.sequences_all[audio].select = True
bpy.ops.sequencer.delete()
window_manager.windows[-1].screen.areas[0].type = old_type

View file

@ -102,7 +102,6 @@ class BlendLoader(plugin.AssetLoader):
# Link all the container children to the collection
for obj in container.children_recursive:
print(obj)
bpy.context.scene.collection.objects.link(obj)
# Remove the library from the blend file
@ -194,8 +193,20 @@ class BlendLoader(plugin.AssetLoader):
transform = asset_group.matrix_basis.copy()
old_data = dict(asset_group.get(AVALON_PROPERTY))
old_members = old_data.get("members", [])
parent = asset_group.parent
actions = {}
objects_with_anim = [
obj for obj in asset_group.children_recursive
if obj.animation_data]
for obj in objects_with_anim:
# Check if the object has an action and, if so, add it to a dict
# so we can restore it later. Save and restore the action only
# if it wasn't originally loaded from the current asset.
if obj.animation_data.action not in old_members:
actions[obj.name] = obj.animation_data.action
self.exec_remove(container)
asset_group, members = self._process_data(libpath, group_name)
@ -206,6 +217,13 @@ class BlendLoader(plugin.AssetLoader):
asset_group.matrix_basis = transform
asset_group.parent = parent
# Restore the actions
for obj in asset_group.children_recursive:
if obj.name in actions:
if not obj.animation_data:
obj.animation_data_create()
obj.animation_data.action = actions[obj.name]
# Restore the old data, but reset memebers, as they don't exist anymore
# This avoids a crash, because the memory addresses of those members
# are not valid anymore

View file

@ -55,13 +55,13 @@ class ExtractAnimationABC(
context = plugin.create_blender_context(
active=asset_group, selected=selected)
# We export the abc
bpy.ops.wm.alembic_export(
context,
filepath=filepath,
selected=True,
flatten=False
)
with bpy.context.temp_override(**context):
# We export the abc
bpy.ops.wm.alembic_export(
filepath=filepath,
selected=True,
flatten=False
)
plugin.deselect_all()

View file

@ -50,19 +50,19 @@ class ExtractCamera(publish.Extractor, publish.OptionalPyblishPluginMixin):
scale_length = bpy.context.scene.unit_settings.scale_length
bpy.context.scene.unit_settings.scale_length = 0.01
# We export the fbx
bpy.ops.export_scene.fbx(
context,
filepath=filepath,
use_active_collection=False,
use_selection=True,
bake_anim_use_nla_strips=False,
bake_anim_use_all_actions=False,
add_leaf_bones=False,
armature_nodetype='ROOT',
object_types={'CAMERA'},
bake_anim_simplify_factor=0.0
)
with bpy.context.temp_override(**context):
# We export the fbx
bpy.ops.export_scene.fbx(
filepath=filepath,
use_active_collection=False,
use_selection=True,
bake_anim_use_nla_strips=False,
bake_anim_use_all_actions=False,
add_leaf_bones=False,
armature_nodetype='ROOT',
object_types={'CAMERA'},
bake_anim_simplify_factor=0.0
)
bpy.context.scene.unit_settings.scale_length = scale_length

View file

@ -57,15 +57,15 @@ class ExtractFBX(publish.Extractor, publish.OptionalPyblishPluginMixin):
scale_length = bpy.context.scene.unit_settings.scale_length
bpy.context.scene.unit_settings.scale_length = 0.01
# We export the fbx
bpy.ops.export_scene.fbx(
context,
filepath=filepath,
use_active_collection=False,
use_selection=True,
mesh_smooth_type='FACE',
add_leaf_bones=False
)
with bpy.context.temp_override(**context):
# We export the fbx
bpy.ops.export_scene.fbx(
filepath=filepath,
use_active_collection=False,
use_selection=True,
mesh_smooth_type='FACE',
add_leaf_bones=False
)
bpy.context.scene.unit_settings.scale_length = scale_length

View file

@ -153,17 +153,20 @@ class ExtractAnimationFBX(
override = plugin.create_blender_context(
active=root, selected=[root, armature])
bpy.ops.export_scene.fbx(
override,
filepath=filepath,
use_active_collection=False,
use_selection=True,
bake_anim_use_nla_strips=False,
bake_anim_use_all_actions=False,
add_leaf_bones=False,
armature_nodetype='ROOT',
object_types={'EMPTY', 'ARMATURE'}
)
with bpy.context.temp_override(**override):
# We export the fbx
bpy.ops.export_scene.fbx(
filepath=filepath,
use_active_collection=False,
use_selection=True,
bake_anim_use_nla_strips=False,
bake_anim_use_all_actions=False,
add_leaf_bones=False,
armature_nodetype='ROOT',
object_types={'EMPTY', 'ARMATURE'}
)
armature.name = armature_name
asset_group.name = asset_group_name
root.select_set(True)

View file

@ -80,17 +80,18 @@ class ExtractLayout(publish.Extractor, publish.OptionalPyblishPluginMixin):
override = plugin.create_blender_context(
active=asset, selected=[asset, obj])
bpy.ops.export_scene.fbx(
override,
filepath=filepath,
use_active_collection=False,
use_selection=True,
bake_anim_use_nla_strips=False,
bake_anim_use_all_actions=False,
add_leaf_bones=False,
armature_nodetype='ROOT',
object_types={'EMPTY', 'ARMATURE'}
)
with bpy.context.temp_override(**override):
# We export the fbx
bpy.ops.export_scene.fbx(
filepath=filepath,
use_active_collection=False,
use_selection=True,
bake_anim_use_nla_strips=False,
bake_anim_use_all_actions=False,
add_leaf_bones=False,
armature_nodetype='ROOT',
object_types={'EMPTY', 'ARMATURE'}
)
obj.name = armature_name
asset.name = asset_group_name
asset.select_set(False)

View file

@ -8,55 +8,6 @@ from openpype.hosts.fusion.api.action import SelectInvalidAction
from openpype.hosts.fusion.api import comp_lock_and_undo_chunk
def get_tool_resolution(tool, frame):
"""Return the 2D input resolution to a Fusion tool
If the current tool hasn't been rendered its input resolution
hasn't been saved. To combat this, add an expression in
the comments field to read the resolution
Args
tool (Fusion Tool): The tool to query input resolution
frame (int): The frame to query the resolution on.
Returns:
tuple: width, height as 2-tuple of integers
"""
comp = tool.Composition
# False undo removes the undo-stack from the undo list
with comp_lock_and_undo_chunk(comp, "Read resolution", False):
# Save old comment
old_comment = ""
has_expression = False
if tool["Comments"][frame] != "":
if tool["Comments"].GetExpression() is not None:
has_expression = True
old_comment = tool["Comments"].GetExpression()
tool["Comments"].SetExpression(None)
else:
old_comment = tool["Comments"][frame]
tool["Comments"][frame] = ""
# Get input width
tool["Comments"].SetExpression("self.Input.OriginalWidth")
width = int(tool["Comments"][frame])
# Get input height
tool["Comments"].SetExpression("self.Input.OriginalHeight")
height = int(tool["Comments"][frame])
# Reset old comment
tool["Comments"].SetExpression(None)
if has_expression:
tool["Comments"].SetExpression(old_comment)
else:
tool["Comments"][frame] = old_comment
return width, height
class ValidateSaverResolution(
pyblish.api.InstancePlugin, OptionalPyblishPluginMixin
):
@ -87,19 +38,79 @@ class ValidateSaverResolution(
@classmethod
def get_invalid(cls, instance):
resolution = cls.get_resolution(instance)
saver = instance.data["tool"]
try:
resolution = cls.get_resolution(instance)
except PublishValidationError:
resolution = None
expected_resolution = cls.get_expected_resolution(instance)
if resolution != expected_resolution:
saver = instance.data["tool"]
return [saver]
@classmethod
def get_resolution(cls, instance):
saver = instance.data["tool"]
first_frame = instance.data["frameStartHandle"]
return get_tool_resolution(saver, frame=first_frame)
return cls.get_tool_resolution(saver, frame=first_frame)
@classmethod
def get_expected_resolution(cls, instance):
data = instance.data["assetEntity"]["data"]
return data["resolutionWidth"], data["resolutionHeight"]
@classmethod
def get_tool_resolution(cls, tool, frame):
"""Return the 2D input resolution to a Fusion tool
If the current tool hasn't been rendered its input resolution
hasn't been saved. To combat this, add an expression in
the comments field to read the resolution
Args
tool (Fusion Tool): The tool to query input resolution
frame (int): The frame to query the resolution on.
Returns:
tuple: width, height as 2-tuple of integers
"""
comp = tool.Composition
# False undo removes the undo-stack from the undo list
with comp_lock_and_undo_chunk(comp, "Read resolution", False):
# Save old comment
old_comment = ""
has_expression = False
if tool["Comments"][frame] not in ["", None]:
if tool["Comments"].GetExpression() is not None:
has_expression = True
old_comment = tool["Comments"].GetExpression()
tool["Comments"].SetExpression(None)
else:
old_comment = tool["Comments"][frame]
tool["Comments"][frame] = ""
# Get input width
tool["Comments"].SetExpression("self.Input.OriginalWidth")
if tool["Comments"][frame] is None:
raise PublishValidationError(
"Cannot get resolution info for frame '{}'.\n\n "
"Please check that saver has connected input.".format(
frame
)
)
width = int(tool["Comments"][frame])
# Get input height
tool["Comments"].SetExpression("self.Input.OriginalHeight")
height = int(tool["Comments"][frame])
# Reset old comment
tool["Comments"].SetExpression(None)
if has_expression:
tool["Comments"].SetExpression(old_comment)
else:
tool["Comments"][frame] = old_comment
return width, height

View file

@ -9,6 +9,8 @@ class CollectClipEffects(pyblish.api.InstancePlugin):
label = "Collect Clip Effects Instances"
families = ["clip"]
effect_categories = []
def process(self, instance):
family = "effect"
effects = {}
@ -70,29 +72,62 @@ class CollectClipEffects(pyblish.api.InstancePlugin):
subset_split.insert(0, "effect")
name = "".join(subset_split)
effect_categories = {
x["name"]: x["effect_classes"] for x in self.effect_categories
}
# create new instance and inherit data
data = {}
for key, value in instance.data.items():
if "clipEffectItems" in key:
category_by_effect = {"": ""}
for key, values in effect_categories.items():
for cls in values:
category_by_effect[cls] = key
effects_categorized = {k: {} for k in effect_categories.keys()}
effects_categorized[""] = {}
for key, value in effects.items():
if key == "assignTo":
continue
data[key] = value
# change names
data["subset"] = name
data["family"] = family
data["families"] = [family]
data["name"] = data["subset"] + "_" + data["asset"]
data["label"] = "{} - {}".format(
data['asset'], data["subset"]
)
data["effects"] = effects
# Some classes can have a number in them. Like Text2.
found_cls = ""
for cls in category_by_effect.keys():
if cls in value["class"]:
found_cls = cls
# create new instance
_instance = instance.context.create_instance(**data)
self.log.info("Created instance `{}`".format(_instance))
self.log.debug("instance.data `{}`".format(_instance.data))
effects_categorized[category_by_effect[found_cls]][key] = value
categories = list(effects_categorized.keys())
for category in categories:
if not effects_categorized[category]:
effects_categorized.pop(category)
continue
effects_categorized[category]["assignTo"] = effects["assignTo"]
for category, effects in effects_categorized.items():
name = "".join(subset_split)
name += category.capitalize()
# create new instance and inherit data
data = {}
for key, value in instance.data.items():
if "clipEffectItems" in key:
continue
data[key] = value
# change names
data["subset"] = name
data["family"] = family
data["families"] = [family]
data["name"] = data["subset"] + "_" + data["asset"]
data["label"] = "{} - {}".format(
data['asset'], data["subset"]
)
data["effects"] = effects
# create new instance
_instance = instance.context.create_instance(**data)
self.log.info("Created instance `{}`".format(_instance))
self.log.debug("instance.data `{}`".format(_instance.data))
def test_overlap(self, effect_t_in, effect_t_out):
covering_exp = bool(

View file

@ -16,8 +16,9 @@ class FbxLoader(load.LoaderPlugin):
order = -10
families = ["staticMesh", "fbx"]
representations = ["fbx"]
families = ["*"]
representations = ["*"]
extensions = {"fbx"}
def load(self, context, name=None, namespace=None, data=None):

View file

@ -21,6 +21,11 @@ class SaveScenesForCamera(pyblish.api.InstancePlugin):
families = ["maxrender"]
def process(self, instance):
if not instance.data.get("multiCamera"):
self.log.debug(
"Multi Camera disabled. "
"Skipping to save scene files for cameras")
return
current_folder = rt.maxFilePath
current_filename = rt.maxFileName
current_filepath = os.path.join(current_folder, current_filename)

View file

@ -2778,9 +2778,37 @@ def bake_to_world_space(nodes,
list: The newly created and baked node names.
"""
@contextlib.contextmanager
def _unlock_attr(attr):
"""Unlock attribute during context if it is locked"""
if not cmds.getAttr(attr, lock=True):
# If not locked, do nothing
yield
return
try:
cmds.setAttr(attr, lock=False)
yield
finally:
cmds.setAttr(attr, lock=True)
def _get_attrs(node):
"""Workaround for buggy shape attribute listing with listAttr"""
"""Workaround for buggy shape attribute listing with listAttr
This will only return keyable settable attributes that have an
incoming connections (those that have a reason to be baked).
Technically this *may* fail to return attributes driven by complex
expressions for which maya makes no connections, e.g. doing actual
`setAttr` calls in expressions.
Arguments:
node (str): The node to list attributes for.
Returns:
list: Keyable attributes with incoming connections.
The attribute may be locked.
"""
attrs = cmds.listAttr(node,
write=True,
scalar=True,
@ -2805,14 +2833,14 @@ def bake_to_world_space(nodes,
return valid_attrs
transform_attrs = set(["t", "r", "s",
"tx", "ty", "tz",
"rx", "ry", "rz",
"sx", "sy", "sz"])
transform_attrs = {"t", "r", "s",
"tx", "ty", "tz",
"rx", "ry", "rz",
"sx", "sy", "sz"}
world_space_nodes = []
with delete_after() as delete_bin:
with ExitStack() as stack:
delete_bin = stack.enter_context(delete_after())
# Create the duplicate nodes that are in world-space connected to
# the originals
for node in nodes:
@ -2824,23 +2852,26 @@ def bake_to_world_space(nodes,
name=new_name,
renameChildren=True)[0] # noqa
# Connect all attributes on the node except for transform
# attributes
attrs = _get_attrs(node)
attrs = set(attrs) - transform_attrs if attrs else []
# Parent new node to world
if cmds.listRelatives(new_node, parent=True):
new_node = cmds.parent(new_node, world=True)[0]
# Temporarily unlock and passthrough connect all attributes
# so we can bake them over time
# Skip transform attributes because we will constrain them later
attrs = set(_get_attrs(node)) - transform_attrs
for attr in attrs:
orig_node_attr = '{0}.{1}'.format(node, attr)
new_node_attr = '{0}.{1}'.format(new_node, attr)
# unlock to avoid connection errors
cmds.setAttr(new_node_attr, lock=False)
orig_node_attr = "{}.{}".format(node, attr)
new_node_attr = "{}.{}".format(new_node, attr)
# unlock during context to avoid connection errors
stack.enter_context(_unlock_attr(new_node_attr))
cmds.connectAttr(orig_node_attr,
new_node_attr,
force=True)
# If shapes are also baked then connect those keyable attributes
# If shapes are also baked then also temporarily unlock and
# passthrough connect all shape attributes for baking
if shape:
children_shapes = cmds.listRelatives(new_node,
children=True,
@ -2855,25 +2886,19 @@ def bake_to_world_space(nodes,
children_shapes):
attrs = _get_attrs(orig_shape)
for attr in attrs:
orig_node_attr = '{0}.{1}'.format(orig_shape, attr)
new_node_attr = '{0}.{1}'.format(new_shape, attr)
# unlock to avoid connection errors
cmds.setAttr(new_node_attr, lock=False)
orig_node_attr = "{}.{}".format(orig_shape, attr)
new_node_attr = "{}.{}".format(new_shape, attr)
# unlock during context to avoid connection errors
stack.enter_context(_unlock_attr(new_node_attr))
cmds.connectAttr(orig_node_attr,
new_node_attr,
force=True)
# Parent to world
if cmds.listRelatives(new_node, parent=True):
new_node = cmds.parent(new_node, world=True)[0]
# Unlock transform attributes so constraint can be created
# Constraint transforms
for attr in transform_attrs:
cmds.setAttr('{0}.{1}'.format(new_node, attr), lock=False)
# Constraints
transform_attr = "{}.{}".format(new_node, attr)
stack.enter_context(_unlock_attr(transform_attr))
delete_bin.extend(cmds.parentConstraint(node, new_node, mo=False))
delete_bin.extend(cmds.scaleConstraint(node, new_node, mo=False))

View file

@ -265,13 +265,16 @@ def transfer_image_planes(source_cameras, target_cameras,
try:
for source_camera, target_camera in zip(source_cameras,
target_cameras):
image_planes = cmds.listConnections(source_camera,
image_plane_plug = "{}.imagePlane".format(source_camera)
image_planes = cmds.listConnections(image_plane_plug,
source=True,
destination=False,
type="imagePlane") or []
# Split of the parent path they are attached - we want
# the image plane node name.
# the image plane node name if attached to a camera.
# TODO: Does this still mean the image plane name is unique?
image_planes = [x.split("->", 1)[1] for x in image_planes]
image_planes = [x.split("->", 1)[-1] for x in image_planes]
if not image_planes:
continue
@ -282,7 +285,7 @@ def transfer_image_planes(source_cameras, target_cameras,
if source_camera == target_camera:
continue
_attach_image_plane(target_camera, image_plane)
else: # explicitly dettaching image planes
else: # explicitly detach image planes
cmds.imagePlane(image_plane, edit=True, detach=True)
originals[source_camera].append(image_plane)
yield

View file

@ -1,77 +0,0 @@
from collections import defaultdict
import pyblish.api
import openpype.hosts.maya.api.action
from openpype.pipeline.publish import (
PublishValidationError, ValidatePipelineOrder)
class ValidateUniqueRelationshipMembers(pyblish.api.InstancePlugin):
"""Validate the relational nodes of the look data to ensure every node is
unique.
This ensures the all member ids are unique. Every node id must be from
a single node in the scene.
That means there's only ever one of a specific node inside the look to be
published. For example if you'd have a loaded 3x the same tree and by
accident you're trying to publish them all together in a single look that
would be invalid, because they are the same tree. It should be included
inside the look instance only once.
"""
order = ValidatePipelineOrder
label = 'Look members unique'
hosts = ['maya']
families = ['look']
actions = [openpype.hosts.maya.api.action.SelectInvalidAction,
openpype.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
def process(self, instance):
"""Process all meshes"""
invalid = self.get_invalid(instance)
if invalid:
raise PublishValidationError(
("Members found without non-unique IDs: "
"{0}").format(invalid))
@staticmethod
def get_invalid(instance):
"""
Check all the relationship members of the objectSets
Example of the lookData relationships:
{"uuid": 59b2bb27bda2cb2776206dd8:79ab0a63ffdf,
"members":[{"uuid": 59b2bb27bda2cb2776206dd8:1b158cc7496e,
"name": |model_GRP|body_GES|body_GESShape}
...,
...]}
Args:
instance:
Returns:
"""
# Get all members from the sets
id_nodes = defaultdict(set)
relationships = instance.data["lookData"]["relationships"]
for relationship in relationships.values():
for member in relationship['members']:
node_id = member["uuid"]
node = member["name"]
id_nodes[node_id].add(node)
# Check if any id has more than 1 node
invalid = []
for nodes in id_nodes.values():
if len(nodes) > 1:
invalid.extend(nodes)
return invalid

View file

@ -44,4 +44,8 @@ class ValidateSceneSetWorkspace(pyblish.api.ContextPlugin):
if not is_subdir(scene_name, root_dir):
raise PublishValidationError(
"Maya workspace is not set correctly.")
"Maya workspace is not set correctly.\n\n"
f"Current workfile `{scene_name}` is not inside the "
"current Maya project root directory `{root_dir}`.\n\n"
"Please use Workfile app to re-save."
)

View file

@ -216,6 +216,11 @@ class CollectSettingsSimpleInstances(pyblish.api.InstancePlugin):
instance.data["thumbnailSource"] = first_filepath
review_representation["tags"].append("review")
# Adding "review" to representation name since it can clash with main
# representation if they share the same extension.
review_representation["outputName"] = "review"
self.log.debug("Representation {} was marked for review. {}".format(
review_representation["name"], review_path
))

View file

@ -6,13 +6,13 @@ 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 or Muster server are
running with self-signed certificates and their certificate is not
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.
of defense SSL is providing, and it is not recommended.
"""
if "verify" not in kwargs:
@ -24,13 +24,13 @@ 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 or Muster server are
running with self-signed certificates and their certificate is not
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.
of defense SSL is providing, and it is not recommended.
"""
if "verify" not in kwargs:

View file

@ -44,17 +44,17 @@ XML_CHAR_REF_REGEX_HEX = re.compile(r"&#x?[0-9a-fA-F]+;")
ARRAY_TYPE_REGEX = re.compile(r"^(int|float|string)\[\d+\]$")
IMAGE_EXTENSIONS = {
".ani", ".anim", ".apng", ".art", ".bmp", ".bpg", ".bsave", ".cal",
".cin", ".cpc", ".cpt", ".dds", ".dpx", ".ecw", ".exr", ".fits",
".flic", ".flif", ".fpx", ".gif", ".hdri", ".hevc", ".icer",
".icns", ".ico", ".cur", ".ics", ".ilbm", ".jbig", ".jbig2",
".jng", ".jpeg", ".jpeg-ls", ".jpeg", ".2000", ".jpg", ".xr",
".jpeg", ".xt", ".jpeg-hdr", ".kra", ".mng", ".miff", ".nrrd",
".ora", ".pam", ".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".pgf",
".pictor", ".png", ".psd", ".psb", ".psp", ".qtvr", ".ras",
".rgbe", ".logluv", ".tiff", ".sgi", ".tga", ".tiff", ".tiff/ep",
".tiff/it", ".ufo", ".ufp", ".wbmp", ".webp", ".xbm", ".xcf",
".xpm", ".xwd"
".ani", ".anim", ".apng", ".art", ".bmp", ".bpg", ".bsave",
".cal", ".cin", ".cpc", ".cpt", ".dds", ".dpx", ".ecw", ".exr",
".fits", ".flic", ".flif", ".fpx", ".gif", ".hdri", ".hevc",
".icer", ".icns", ".ico", ".cur", ".ics", ".ilbm", ".jbig", ".jbig2",
".jng", ".jpeg", ".jpeg-ls", ".jpeg-hdr", ".2000", ".jpg",
".kra", ".logluv", ".mng", ".miff", ".nrrd", ".ora",
".pam", ".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".pgf",
".pictor", ".png", ".psd", ".psb", ".psp", ".qtvr",
".ras", ".rgbe", ".sgi", ".tga",
".tif", ".tiff", ".tiff/ep", ".tiff/it", ".ufo", ".ufp",
".wbmp", ".webp", ".xr", ".xt", ".xbm", ".xcf", ".xpm", ".xwd"
}
VIDEO_EXTENSIONS = {

View file

@ -542,7 +542,8 @@ def _load_modules():
module_dirs.insert(0, current_dir)
addons_dir = os.path.join(os.path.dirname(current_dir), "addons")
module_dirs.append(addons_dir)
if os.path.exists(addons_dir):
module_dirs.append(addons_dir)
ignored_host_names = set(IGNORED_HOSTS_IN_AYON)
ignored_current_dir_filenames = set(IGNORED_DEFAULT_FILENAMES)
@ -1332,7 +1333,6 @@ class TrayModulesManager(ModulesManager):
"user",
"ftrack",
"kitsu",
"muster",
"launcher_tool",
"avalon",
"clockify",

View file

@ -34,8 +34,8 @@ 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 or Muster server are
running with self-signed certificates and their certificate is not
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:
@ -55,8 +55,8 @@ 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 or Muster server are
running with self-signed certificates and their certificate is not
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:

View file

@ -47,6 +47,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
env_allowed_keys = []
env_search_replace_values = {}
workfile_dependency = True
use_published_workfile = True
@classmethod
def get_attribute_defs(cls):
@ -85,8 +86,13 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
),
BoolDef(
"workfile_dependency",
default=True,
default=cls.workfile_dependency,
label="Workfile Dependency"
),
BoolDef(
"use_published_workfile",
default=cls.use_published_workfile,
label="Use Published Workfile"
)
]
@ -125,20 +131,11 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
render_path = instance.data['path']
script_path = context.data["currentFile"]
for item_ in context:
if "workfile" in item_.data["family"]:
template_data = item_.data.get("anatomyData")
rep = item_.data.get("representations")[0].get("name")
template_data["representation"] = rep
template_data["ext"] = rep
template_data["comment"] = None
anatomy_filled = context.data["anatomy"].format(template_data)
template_filled = anatomy_filled["publish"]["path"]
script_path = os.path.normpath(template_filled)
self.log.info(
"Using published scene for render {}".format(script_path)
)
use_published_workfile = instance.data["attributeValues"].get(
"use_published_workfile", self.use_published_workfile
)
if use_published_workfile:
script_path = self._get_published_workfile_path(context)
# only add main rendering job if target is not frames_farm
r_job_response_json = None
@ -197,6 +194,44 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
families.insert(0, "prerender")
instance.data["families"] = families
def _get_published_workfile_path(self, context):
"""This method is temporary while the class is not inherited from
AbstractSubmitDeadline"""
for instance in context:
if (
instance.data["family"] != "workfile"
# Disabled instances won't be integrated
or instance.data("publish") is False
):
continue
template_data = instance.data["anatomyData"]
# Expect workfile instance has only one representation
representation = instance.data["representations"][0]
# Get workfile extension
repre_file = representation["files"]
self.log.info(repre_file)
ext = os.path.splitext(repre_file)[1].lstrip(".")
# Fill template data
template_data["representation"] = representation["name"]
template_data["ext"] = ext
template_data["comment"] = None
anatomy = context.data["anatomy"]
# WARNING Hardcoded template name 'publish' > may not be used
template_obj = anatomy.templates_obj["publish"]["path"]
template_filled = template_obj.format(template_data)
script_path = os.path.normpath(template_filled)
self.log.info(
"Using published scene for render {}".format(
script_path
)
)
return script_path
return None
def payload_submit(
self,
instance,

View file

@ -99,10 +99,6 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin,
def _submit_deadline_post_job(self, instance, job):
"""Submit publish job to Deadline.
Deadline specific code separated from :meth:`process` for sake of
more universal code. Muster post job is sent directly by Muster
submitter, so this type of code isn't necessary for it.
Returns:
(str): deadline_publish_job_id
"""

View file

@ -59,21 +59,15 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
publish.ColormanagedPyblishPluginMixin):
"""Process Job submitted on farm.
These jobs are dependent on a deadline or muster job
These jobs are dependent on a deadline job
submission prior to this plug-in.
- In case of Deadline, it creates dependent job on farm publishing
rendered image sequence.
- In case of Muster, there is no need for such thing as dependent job,
post action will be executed and rendered sequence will be published.
It creates dependent job on farm publishing rendered image sequence.
Options in instance.data:
- deadlineSubmissionJob (dict, Required): The returned .json
data from the job submission to deadline.
- musterSubmissionJob (dict, Required): same as deadline.
- outputDir (str, Required): The output directory where the metadata
file should be generated. It's assumed that this will also be
final folder containing the output files.
@ -161,10 +155,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
def _submit_deadline_post_job(self, instance, job, instances):
"""Submit publish job to Deadline.
Deadline specific code separated from :meth:`process` for sake of
more universal code. Muster post job is sent directly by Muster
submitter, so this type of code isn't necessary for it.
Returns:
(str): deadline_publish_job_id
"""
@ -586,9 +576,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
render_job = instance.data.pop("deadlineSubmissionJob", None)
if not render_job and instance.data.get("tileRendering") is False:
raise AssertionError(("Cannot continue without valid Deadline "
"or Muster submission."))
raise AssertionError(("Cannot continue without valid "
"Deadline submission."))
if not render_job:
import getpass

View file

@ -1,6 +0,0 @@
from .muster import MusterModule
__all__ = (
"MusterModule",
)

View file

@ -1,147 +0,0 @@
import os
import json
import appdirs
import requests
from openpype.modules import OpenPypeModule, ITrayModule
class MusterModule(OpenPypeModule, ITrayModule):
"""
Module handling Muster Render credentials. This will display dialog
asking for user credentials for Muster if not already specified.
"""
cred_folder_path = os.path.normpath(
appdirs.user_data_dir('pype-app', 'pype')
)
cred_filename = 'muster_cred.json'
name = "muster"
def initialize(self, modules_settings):
muster_settings = modules_settings[self.name]
self.enabled = muster_settings["enabled"]
self.muster_url = muster_settings["MUSTER_REST_URL"]
self.cred_path = os.path.join(
self.cred_folder_path, self.cred_filename
)
# Tray attributes
self.widget_login = None
self.action_show_login = None
self.rest_api_obj = None
def get_global_environments(self):
return {
"MUSTER_REST_URL": self.muster_url
}
def tray_init(self):
from .widget_login import MusterLogin
self.widget_login = MusterLogin(self)
def tray_start(self):
"""Show login dialog if credentials not found."""
# This should be start of module in tray
cred = self.load_credentials()
if not cred:
self.show_login()
def tray_exit(self):
"""Nothing special for Muster."""
return
# Definition of Tray menu
def tray_menu(self, parent):
"""Add **change credentials** option to tray menu."""
from qtpy import QtWidgets
# Menu for Tray App
menu = QtWidgets.QMenu('Muster', parent)
menu.setProperty('submenu', 'on')
# Actions
self.action_show_login = QtWidgets.QAction(
"Change login", menu
)
menu.addAction(self.action_show_login)
self.action_show_login.triggered.connect(self.show_login)
parent.addMenu(menu)
def load_credentials(self):
"""
Get credentials from JSON file
"""
credentials = {}
try:
file = open(self.cred_path, 'r')
credentials = json.load(file)
except Exception:
file = open(self.cred_path, 'w+')
file.close()
return credentials
def get_auth_token(self, username, password):
"""
Authenticate user with Muster and get authToken from server.
"""
if not self.muster_url:
raise AttributeError("Muster REST API url not set")
params = {
'username': username,
'password': password
}
api_entry = '/api/login'
response = self._requests_post(
self.muster_url + api_entry, params=params)
if response.status_code != 200:
self.log.error(
'Cannot log into Muster: {}'.format(response.status_code))
raise Exception('Cannot login into Muster.')
try:
token = response.json()['ResponseData']['authToken']
except ValueError as e:
self.log.error('Invalid response from Muster server {}'.format(e))
raise Exception('Invalid response from Muster while logging in.')
self.save_credentials(token)
def save_credentials(self, token):
"""Save credentials to JSON file."""
with open(self.cred_path, "w") as f:
json.dump({'token': token}, f)
def show_login(self):
"""
Show dialog to enter credentials
"""
if self.widget_login:
self.widget_login.show()
# Webserver module implementation
def webserver_initialization(self, server_manager):
"""Add routes for Muster login."""
if self.tray_initialized:
from .rest_api import MusterModuleRestApi
self.rest_api_obj = MusterModuleRestApi(self, server_manager)
def _requests_post(self, *args, **kwargs):
""" Wrapper for requests, disabling SSL certificate validation if
DONT_VERIFY_SSL environment variable is found. This is useful when
Deadline or Muster server are running with self-signed certificates
and their 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'] = False if os.getenv("OPENPYPE_DONT_VERIFY_SSL", True) else True # noqa
return requests.post(*args, **kwargs)

View file

@ -1,555 +0,0 @@
import os
import json
import getpass
import platform
import appdirs
from maya import cmds
import pyblish.api
from openpype.lib import requests_post
from openpype.hosts.maya.api import lib
from openpype.hosts.maya.api.lib_rendersettings import RenderSettings
from openpype.pipeline import legacy_io
from openpype.settings import get_system_settings
# mapping between Maya renderer names and Muster template ids
def _get_template_id(renderer):
"""
Return muster template ID based on renderer name.
:param renderer: renderer name
:type renderer: str
:returns: muster template id
:rtype: int
"""
# TODO: Use settings from context?
templates = get_system_settings()["modules"]["muster"]["templates_mapping"]
if not templates:
raise RuntimeError(("Muster template mapping missing in "
"pype-settings"))
try:
template_id = templates[renderer]
except KeyError:
raise RuntimeError("Unmapped renderer - missing template id")
return template_id
def _get_script():
"""Get path to the image sequence script"""
try:
from openpype.scripts import publish_filesequence
except Exception:
raise RuntimeError("Expected module 'publish_deadline'"
"to be available")
module_path = publish_filesequence.__file__
if module_path.endswith(".pyc"):
module_path = module_path[:-len(".pyc")] + ".py"
return module_path
def get_renderer_variables(renderlayer=None):
"""Retrieve the extension which has been set in the VRay settings
Will return None if the current renderer is not VRay
For Maya 2016.5 and up the renderSetup creates renderSetupLayer node which
start with `rs`. Use the actual node name, do NOT use the `nice name`
Args:
renderlayer (str): the node name of the renderlayer.
Returns:
dict
"""
renderer = lib.get_renderer(renderlayer or lib.get_current_renderlayer())
padding = cmds.getAttr(RenderSettings.get_padding_attr(renderer))
filename_0 = cmds.renderSettings(fullPath=True, firstImageName=True)[0]
if renderer == "vray":
# Maya's renderSettings function does not return V-Ray file extension
# so we get the extension from vraySettings
extension = cmds.getAttr("vraySettings.imageFormatStr")
# When V-Ray image format has not been switched once from default .png
# the getAttr command above returns None. As such we explicitly set
# it to `.png`
if extension is None:
extension = "png"
filename_prefix = "<Scene>/<Scene>_<Layer>/<Layer>"
else:
# Get the extension, getAttr defaultRenderGlobals.imageFormat
# returns an index number.
filename_base = os.path.basename(filename_0)
extension = os.path.splitext(filename_base)[-1].strip(".")
filename_prefix = "<Scene>/<RenderLayer>/<RenderLayer>"
return {"ext": extension,
"filename_prefix": filename_prefix,
"padding": padding,
"filename_0": filename_0}
def preview_fname(folder, scene, layer, padding, ext):
"""Return output file path with #### for padding.
Deadline requires the path to be formatted with # in place of numbers.
For example `/path/to/render.####.png`
Args:
folder (str): The root output folder (image path)
scene (str): The scene name
layer (str): The layer name to be rendered
padding (int): The padding length
ext(str): The output file extension
Returns:
str
"""
# Following hardcoded "<Scene>/<Scene>_<Layer>/<Layer>"
output = "{scene}/{layer}/{layer}.{number}.{ext}".format(
scene=scene,
layer=layer,
number="#" * padding,
ext=ext
)
return os.path.join(folder, output)
class MayaSubmitMuster(pyblish.api.InstancePlugin):
"""Submit available render layers to Muster
Renders are submitted to a Muster via HTTP API as
supplied via the environment variable ``MUSTER_REST_URL``.
Also needed is ``MUSTER_USER`` and ``MUSTER_PASSWORD``.
"""
label = "Submit to Muster"
order = pyblish.api.IntegratorOrder + 0.1
hosts = ["maya"]
families = ["renderlayer"]
icon = "satellite-dish"
if not os.environ.get("MUSTER_REST_URL"):
optional = False
active = False
else:
optional = True
_token = None
def _load_credentials(self):
"""
Load Muster credentials from file and set `MUSTER_USER`,
`MUSTER_PASSWORD`, `MUSTER_REST_URL` is loaded from settings.
.. todo::
Show login dialog if access token is invalid or missing.
"""
app_dir = os.path.normpath(
appdirs.user_data_dir('pype-app', 'pype')
)
file_name = 'muster_cred.json'
fpath = os.path.join(app_dir, file_name)
file = open(fpath, 'r')
muster_json = json.load(file)
self._token = muster_json.get('token', None)
if not self._token:
raise RuntimeError("Invalid access token for Muster")
file.close()
self.MUSTER_REST_URL = os.environ.get("MUSTER_REST_URL")
if not self.MUSTER_REST_URL:
raise AttributeError("Muster REST API url not set")
def _get_templates(self):
"""
Get Muster templates from server.
"""
params = {
"authToken": self._token,
"select": "name"
}
api_entry = '/api/templates/list'
response = requests_post(
self.MUSTER_REST_URL + api_entry, params=params)
if response.status_code != 200:
self.log.error(
'Cannot get templates from Muster: {}'.format(
response.status_code))
raise Exception('Cannot get templates from Muster.')
try:
response_templates = response.json()["ResponseData"]["templates"]
except ValueError as e:
self.log.error(
'Muster server returned unexpected data {}'.format(e)
)
raise Exception('Muster server returned unexpected data')
templates = {}
for t in response_templates:
templates[t.get("name")] = t.get("id")
self._templates = templates
def _resolve_template(self, renderer):
"""
Returns template ID based on renderer string.
:param renderer: Name of renderer to match against template names
:type renderer: str
:returns: ID of template
:rtype: int
:raises: Exception if template ID isn't found
"""
self.log.debug("Trying to find template for [{}]".format(renderer))
mapped = _get_template_id(renderer)
self.log.debug("got id [{}]".format(mapped))
return self._templates.get(mapped)
def _submit(self, payload):
"""
Submit job to Muster
:param payload: json with job to submit
:type payload: str
:returns: response
:raises: Exception status is wrong
"""
params = {
"authToken": self._token,
"name": "submit"
}
api_entry = '/api/queue/actions'
response = requests_post(
self.MUSTER_REST_URL + api_entry, params=params, json=payload)
if response.status_code != 200:
self.log.error(
'Cannot submit job to Muster: {}'.format(response.text))
raise Exception('Cannot submit job to Muster.')
return response
def process(self, instance):
"""
Authenticate with Muster, collect all data, prepare path for post
render publish job and submit job to farm.
"""
# setup muster environment
self.MUSTER_REST_URL = os.environ.get("MUSTER_REST_URL")
if self.MUSTER_REST_URL is None:
self.log.error(
"\"MUSTER_REST_URL\" is not found. Skipping "
"[{}]".format(instance)
)
raise RuntimeError("MUSTER_REST_URL not set")
self._load_credentials()
# self._get_templates()
context = instance.context
workspace = context.data["workspaceDir"]
project_name = context.data["projectName"]
asset_name = context.data["asset"]
filepath = None
allInstances = []
for result in context.data["results"]:
if ((result["instance"] is not None) and
(result["instance"] not in allInstances)):
allInstances.append(result["instance"])
for inst in allInstances:
print(inst)
if inst.data['family'] == 'scene':
filepath = inst.data['destination_list'][0]
if not filepath:
filepath = context.data["currentFile"]
self.log.debug(filepath)
filename = os.path.basename(filepath)
comment = context.data.get("comment", "")
scene = os.path.splitext(filename)[0]
dirname = os.path.join(workspace, "renders")
renderlayer = instance.data['renderlayer'] # rs_beauty
renderlayer_name = instance.data['subset'] # beauty
renderglobals = instance.data["renderGlobals"]
# legacy_layers = renderlayer_globals["UseLegacyRenderLayers"]
# deadline_user = context.data.get("deadlineUser", getpass.getuser())
jobname = "%s - %s" % (filename, instance.name)
# Get the variables depending on the renderer
render_variables = get_renderer_variables(renderlayer)
output_filename_0 = preview_fname(folder=dirname,
scene=scene,
layer=renderlayer_name,
padding=render_variables["padding"],
ext=render_variables["ext"])
instance.data["outputDir"] = os.path.dirname(output_filename_0)
self.log.debug("output: {}".format(filepath))
# build path for metadata file
metadata_filename = "{}_metadata.json".format(instance.data["subset"])
output_dir = instance.data["outputDir"]
metadata_path = os.path.join(output_dir, metadata_filename)
pype_root = os.environ["OPENPYPE_SETUP_PATH"]
# we must provide either full path to executable or use musters own
# python named MPython.exe, residing directly in muster bin
# directory.
if platform.system().lower() == "windows":
# for muster, those backslashes must be escaped twice
muster_python = ("\"C:\\\\Program Files\\\\Virtual Vertex\\\\"
"Muster 9\\\\MPython.exe\"")
else:
# we need to run pype as different user then Muster dispatcher
# service is running (usually root).
muster_python = ("/usr/sbin/runuser -u {}"
" -- /usr/bin/python3".format(getpass.getuser()))
# build the path and argument. We are providing separate --pype
# argument with network path to pype as post job actions are run
# but dispatcher (Server) and not render clients. Render clients
# inherit environment from publisher including PATH, so there's
# no problem finding PYPE, but there is now way (as far as I know)
# to set environment dynamically for dispatcher. Therefore this hack.
args = [muster_python,
_get_script().replace('\\', '\\\\'),
"--paths",
metadata_path.replace('\\', '\\\\'),
"--pype",
pype_root.replace('\\', '\\\\')]
postjob_command = " ".join(args)
try:
# Ensure render folder exists
os.makedirs(dirname)
except OSError:
pass
env = self.clean_environment()
payload = {
"RequestData": {
"platform": 0,
"job": {
"jobName": jobname,
"templateId": _get_template_id(
instance.data["renderer"]),
"chunksInterleave": 2,
"chunksPriority": "0",
"chunksTimeoutValue": 320,
"department": "",
"dependIds": [""],
"dependLinkMode": 0,
"dependMode": 0,
"emergencyQueue": False,
"excludedPools": [""],
"includedPools": [renderglobals["Pool"]],
"packetSize": 4,
"packetType": 1,
"priority": 1,
"jobId": -1,
"startOn": 0,
"parentId": -1,
"project": project_name or scene,
"shot": asset_name or scene,
"camera": instance.data.get("cameras")[0],
"dependMode": 0,
"packetSize": 4,
"packetType": 1,
"priority": 1,
"maximumInstances": 0,
"assignedInstances": 0,
"attributes": {
"environmental_variables": {
"value": ", ".join("{!s}={!r}".format(k, v)
for (k, v) in env.items()),
"state": True,
"subst": False
},
"memo": {
"value": comment,
"state": True,
"subst": False
},
"frames_range": {
"value": "{start}-{end}".format(
start=int(instance.data["frameStart"]),
end=int(instance.data["frameEnd"])),
"state": True,
"subst": False
},
"job_file": {
"value": filepath,
"state": True,
"subst": True
},
"job_project": {
"value": workspace,
"state": True,
"subst": True
},
"output_folder": {
"value": dirname.replace("\\", "/"),
"state": True,
"subst": True
},
"post_job_action": {
"value": postjob_command,
"state": True,
"subst": True
},
"MAYADIGITS": {
"value": 1,
"state": True,
"subst": False
},
"ARNOLDMODE": {
"value": "0",
"state": True,
"subst": False
},
"ABORTRENDER": {
"value": "0",
"state": True,
"subst": True
},
"ARNOLDLICENSE": {
"value": "0",
"state": False,
"subst": False
},
"ADD_FLAGS": {
"value": "-rl {}".format(renderlayer),
"state": True,
"subst": True
}
}
}
}
}
self.preflight_check(instance)
self.log.debug("Submitting ...")
self.log.debug(json.dumps(payload, indent=4, sort_keys=True))
response = self._submit(payload)
# response = requests.post(url, json=payload)
if not response.ok:
raise Exception(response.text)
# Store output dir for unified publisher (filesequence)
instance.data["musterSubmissionJob"] = response.json()
def clean_environment(self):
"""
Clean and set environment variables for render job so render clients
work in more or less same environment as publishing machine.
.. warning:: This is not usable for **post job action** as this is
executed on dispatcher machine (server) and not render clients.
"""
keys = [
# This will trigger `userSetup.py` on the slave
# such that proper initialisation happens the same
# way as it does on a local machine.
# TODO(marcus): This won't work if the slaves don't
# have access to these paths, such as if slaves are
# running Linux and the submitter is on Windows.
"PYTHONPATH",
"PATH",
"MTOA_EXTENSIONS_PATH",
"MTOA_EXTENSIONS",
"DYLD_LIBRARY_PATH",
"MAYA_RENDER_DESC_PATH",
"MAYA_MODULE_PATH",
"ARNOLD_PLUGIN_PATH",
"FTRACK_API_KEY",
"FTRACK_API_USER",
"FTRACK_SERVER",
"PYBLISHPLUGINPATH",
# todo: This is a temporary fix for yeti variables
"PEREGRINEL_LICENSE",
"SOLIDANGLE_LICENSE",
"ARNOLD_LICENSE"
"MAYA_MODULE_PATH",
"TOOL_ENV"
]
environment = dict({key: os.environ[key] for key in keys
if key in os.environ}, **legacy_io.Session)
# self.log.debug("enviro: {}".format(pprint(environment)))
for path in os.environ:
if path.lower().startswith('pype_'):
environment[path] = os.environ[path]
environment["PATH"] = os.environ["PATH"]
# self.log.debug("enviro: {}".format(environment['OPENPYPE_SCRIPTS']))
clean_environment = {}
for key, value in environment.items():
clean_path = ""
self.log.debug("key: {}".format(key))
if "://" in value:
clean_path = value
else:
valid_paths = []
for path in value.split(os.pathsep):
if not path:
continue
try:
path.decode('UTF-8', 'strict')
valid_paths.append(os.path.normpath(path))
except UnicodeDecodeError:
print('path contains non UTF characters')
if valid_paths:
clean_path = os.pathsep.join(valid_paths)
clean_environment[key] = clean_path
return clean_environment
def preflight_check(self, instance):
"""Ensure the startFrame, endFrame and byFrameStep are integers"""
for key in ("frameStart", "frameEnd", "byFrameStep"):
value = instance.data[key]
if int(value) == value:
continue
self.log.warning(
"%f=%d was rounded off to nearest integer"
% (value, int(value))
)
# TODO: Remove hack to avoid this plug-in in new publisher
# This plug-in should actually be in dedicated module
if not os.environ.get("MUSTER_REST_URL"):
del MayaSubmitMuster

View file

@ -1,96 +0,0 @@
import os
import json
import appdirs
import pyblish.api
from openpype.lib import requests_get
from openpype.pipeline.publish import (
context_plugin_should_run,
RepairAction,
)
class ValidateMusterConnection(pyblish.api.ContextPlugin):
"""
Validate Muster REST API Service is running and we have valid auth token
"""
label = "Validate Muster REST API Service"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = ["renderlayer"]
token = None
if not os.environ.get("MUSTER_REST_URL"):
active = False
actions = [RepairAction]
def process(self, context):
# Workaround bug pyblish-base#250
if not context_plugin_should_run(self, context):
return
# test if we have environment set (redundant as this plugin shouldn'
# be active otherwise).
try:
MUSTER_REST_URL = os.environ["MUSTER_REST_URL"]
except KeyError:
self.log.error("Muster REST API url not found.")
raise ValueError("Muster REST API url not found.")
# Load credentials
try:
self._load_credentials()
except RuntimeError:
self.log.error("invalid or missing access token")
assert self._token is not None, "Invalid or missing token"
# We have token, lets do trivial query to web api to see if we can
# connect and access token is valid.
params = {
'authToken': self._token
}
api_entry = '/api/pools/list'
response = requests_get(
MUSTER_REST_URL + api_entry, params=params)
assert response.status_code == 200, "invalid response from server"
assert response.json()['ResponseData'], "invalid data in response"
def _load_credentials(self):
"""
Load Muster credentials from file and set `MUSTER_USER`,
`MUSTER_PASSWORD`, `MUSTER_REST_URL` is loaded from settings.
.. todo::
Show login dialog if access token is invalid or missing.
"""
app_dir = os.path.normpath(
appdirs.user_data_dir('pype-app', 'pype')
)
file_name = 'muster_cred.json'
fpath = os.path.join(app_dir, file_name)
file = open(fpath, 'r')
muster_json = json.load(file)
self._token = muster_json.get('token', None)
if not self._token:
raise RuntimeError("Invalid access token for Muster")
file.close()
self.MUSTER_REST_URL = os.environ.get("MUSTER_REST_URL")
if not self.MUSTER_REST_URL:
raise AttributeError("Muster REST API url not set")
@classmethod
def repair(cls, instance):
"""
Renew authentication token by logging into Muster
"""
api_url = "{}/muster/show_login".format(
os.environ["OPENPYPE_WEBSERVER_URL"])
cls.log.debug(api_url)
response = requests_get(api_url, timeout=1)
if response.status_code != 200:
cls.log.error('Cannot show login form to Muster')
raise Exception('Cannot show login form to Muster')

View file

@ -1,22 +0,0 @@
from aiohttp.web_response import Response
class MusterModuleRestApi:
def __init__(self, user_module, server_manager):
self.module = user_module
self.server_manager = server_manager
self.prefix = "/muster"
self.register()
def register(self):
self.server_manager.add_route(
"GET",
self.prefix + "/show_login",
self.show_login_widget
)
async def show_login_widget(self, request):
self.module.action_show_login.trigger()
return Response(status=200)

View file

@ -1,165 +0,0 @@
from qtpy import QtCore, QtGui, QtWidgets
from openpype import resources, style
class MusterLogin(QtWidgets.QWidget):
SIZE_W = 300
SIZE_H = 150
loginSignal = QtCore.Signal(object, object, object)
def __init__(self, module, parent=None):
super(MusterLogin, self).__init__(parent)
self.module = module
# Icon
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)
self.setWindowFlags(
QtCore.Qt.WindowCloseButtonHint |
QtCore.Qt.WindowMinimizeButtonHint
)
self._translate = QtCore.QCoreApplication.translate
# Font
self.font = QtGui.QFont()
self.font.setFamily("DejaVu Sans Condensed")
self.font.setPointSize(9)
self.font.setBold(True)
self.font.setWeight(50)
self.font.setKerning(True)
# Size setting
self.resize(self.SIZE_W, self.SIZE_H)
self.setMinimumSize(QtCore.QSize(self.SIZE_W, self.SIZE_H))
self.setMaximumSize(QtCore.QSize(self.SIZE_W+100, self.SIZE_H+100))
self.setStyleSheet(style.load_stylesheet())
self.setLayout(self._main())
self.setWindowTitle('Muster login')
def _main(self):
self.main = QtWidgets.QVBoxLayout()
self.main.setObjectName("main")
self.form = QtWidgets.QFormLayout()
self.form.setContentsMargins(10, 15, 10, 5)
self.form.setObjectName("form")
self.label_username = QtWidgets.QLabel("Username:")
self.label_username.setFont(self.font)
self.label_username.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.label_username.setTextFormat(QtCore.Qt.RichText)
self.input_username = QtWidgets.QLineEdit()
self.input_username.setEnabled(True)
self.input_username.setFrame(True)
self.input_username.setPlaceholderText(
self._translate("main", "e.g. John Smith")
)
self.label_password = QtWidgets.QLabel("Password:")
self.label_password.setFont(self.font)
self.label_password.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.label_password.setTextFormat(QtCore.Qt.RichText)
self.input_password = QtWidgets.QLineEdit()
self.input_password.setEchoMode(QtWidgets.QLineEdit.Password)
self.input_password.setEnabled(True)
self.input_password.setFrame(True)
self.input_password.setPlaceholderText(
self._translate("main", "e.g. ********")
)
self.error_label = QtWidgets.QLabel("")
self.error_label.setFont(self.font)
self.error_label.setStyleSheet('color: #FC6000')
self.error_label.setWordWrap(True)
self.error_label.hide()
self.form.addRow(self.label_username, self.input_username)
self.form.addRow(self.label_password, self.input_password)
self.form.addRow(self.error_label)
self.btn_group = QtWidgets.QHBoxLayout()
self.btn_group.addStretch(1)
self.btn_group.setObjectName("btn_group")
self.btn_ok = QtWidgets.QPushButton("Ok")
self.btn_ok.clicked.connect(self.click_ok)
self.btn_cancel = QtWidgets.QPushButton("Cancel")
QtWidgets.QShortcut(
QtGui.QKeySequence(
QtCore.Qt.Key_Escape), self).activated.connect(self.close)
self.btn_cancel.clicked.connect(self.close)
self.btn_group.addWidget(self.btn_ok)
self.btn_group.addWidget(self.btn_cancel)
self.main.addLayout(self.form)
self.main.addLayout(self.btn_group)
return self.main
def keyPressEvent(self, key_event):
if key_event.key() == QtCore.Qt.Key_Return:
if self.input_username.hasFocus():
self.input_password.setFocus()
elif self.input_password.hasFocus() or self.btn_ok.hasFocus():
self.click_ok()
elif self.btn_cancel.hasFocus():
self.close()
else:
super().keyPressEvent(key_event)
def setError(self, msg):
self.error_label.setText(msg)
self.error_label.show()
def invalid_input(self, entity):
entity.setStyleSheet("border: 1px solid red;")
def click_ok(self):
# all what should happen - validations and saving into appsdir
username = self.input_username.text()
password = self.input_password.text()
# TODO: more robust validation. Password can be empty in muster?
if not username:
self.setError("Username cannot be empty")
self.invalid_input(self.input_username)
try:
self.save_credentials(username, password)
except Exception as e:
self.setError(
"<b>Cannot get auth token:</b>\n<code>{}</code>".format(e))
else:
self._close_widget()
def save_credentials(self, username, password):
self.module.get_auth_token(username, password)
def showEvent(self, event):
super(MusterLogin, self).showEvent(event)
# Make btns same width
max_width = max(
self.btn_ok.sizeHint().width(),
self.btn_cancel.sizeHint().width()
)
self.btn_ok.setMinimumWidth(max_width)
self.btn_cancel.setMinimumWidth(max_width)
def closeEvent(self, event):
event.ignore()
self._close_widget()
def _close_widget(self):
self.hide()

View file

@ -28,13 +28,20 @@ def concatenate_splitted_paths(split_paths, anatomy):
# backward compatibility
if "__project_root__" in path_items:
for root, root_path in anatomy.roots.items():
if not os.path.exists(str(root_path)):
log.debug("Root {} path path {} not exist on \
computer!".format(root, root_path))
if not root_path or not os.path.exists(str(root_path)):
log.debug(
"Root {} path path {} not exist on computer!".format(
root, root_path
)
)
continue
clean_items = ["{{root[{}]}}".format(root),
r"{project[name]}"] + clean_items[1:]
output.append(os.path.normpath(os.path.sep.join(clean_items)))
root_items = [
"{{root[{}]}}".format(root),
"{project[name]}"
]
root_items.extend(clean_items[1:])
output.append(os.path.normpath(os.path.sep.join(root_items)))
continue
output.append(os.path.normpath(os.path.sep.join(clean_items)))

View file

@ -1971,7 +1971,6 @@ class PlaceholderCreateMixin(object):
if not placeholder.data.get("keep_placeholder", True):
self.delete_placeholder(placeholder)
def create_failed(self, placeholder, creator_data):
if hasattr(placeholder, "create_failed"):
placeholder.create_failed(creator_data)
@ -2036,7 +2035,7 @@ class CreatePlaceholderItem(PlaceholderItem):
self._failed_created_publish_instances = []
def get_errors(self):
if not self._failed_representations:
if not self._failed_created_publish_instances:
return []
message = (
"Failed to create {} instance using Creator {}"

View file

@ -410,9 +410,9 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin):
"""
hierarchy_queue = collections.deque()
hierarchy_queue.append(hierarchy_context)
hierarchy_queue.append(copy.deepcopy(hierarchy_context))
while hierarchy_queue:
item = hierarchy_context.popleft()
item = hierarchy_queue.popleft()
if asset_name in item:
return item[asset_name].get("tasks") or {}

View file

@ -19,7 +19,7 @@ class CollectFarmTarget(pyblish.api.InstancePlugin):
farm_name = ""
op_modules = context.data.get("openPypeModules")
for farm_renderer in ["deadline", "royalrender", "muster"]:
for farm_renderer in ["deadline", "royalrender"]:
op_module = op_modules.get(farm_renderer, False)
if op_module and op_module.enabled:

View file

@ -93,14 +93,6 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin):
assert ctx.get("user") == data.get("user"), ctx_err % "user"
assert ctx.get("version") == data.get("version"), ctx_err % "version"
# ftrack credentials are passed as environment variables by Deadline
# to publish job, but Muster doesn't pass them.
if data.get("ftrack") and not os.environ.get("FTRACK_API_USER"):
ftrack = data.get("ftrack")
os.environ["FTRACK_API_USER"] = ftrack["FTRACK_API_USER"]
os.environ["FTRACK_API_KEY"] = ftrack["FTRACK_API_KEY"]
os.environ["FTRACK_SERVER"] = ftrack["FTRACK_SERVER"]
# now we can just add instances from json file and we are done
any_staging_dir_persistent = False
for instance_data in data.get("instances"):

View file

@ -189,6 +189,13 @@ class ExtractOIIOTranscode(publish.Extractor):
if len(new_repre["files"]) == 1:
new_repre["files"] = new_repre["files"][0]
# If the source representation has "review" tag, but its not
# part of the output defintion tags, then both the
# representations will be transcoded in ExtractReview and
# their outputs will clash in integration.
if "review" in repre.get("tags", []):
added_review = True
new_representations.append(new_repre)
added_representations = True

View file

@ -30,8 +30,7 @@ class ExtractHierarchyToAYON(pyblish.api.ContextPlugin):
if not AYON_SERVER_ENABLED:
return
hierarchy_context = context.data.get("hierarchyContext")
if not hierarchy_context:
if not context.data.get("hierarchyContext"):
self.log.debug("Skipping ExtractHierarchyToAYON")
return

View file

@ -231,7 +231,10 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
"files": jpeg_file,
"stagingDir": dst_staging,
"thumbnail": True,
"tags": new_repre_tags
"tags": new_repre_tags,
# If source image is jpg then there can be clash when
# integrating to making the output name explicit.
"outputName": "thumbnail"
}
# adding representation

View file

@ -220,22 +220,6 @@ def _convert_deadline_system_settings(
output["modules"]["deadline"] = deadline_settings
def _convert_muster_system_settings(
ayon_settings, output, addon_versions, default_settings
):
enabled = addon_versions.get("muster") is not None
muster_settings = default_settings["modules"]["muster"]
muster_settings["enabled"] = enabled
if enabled:
ayon_muster = ayon_settings["muster"]
muster_settings["MUSTER_REST_URL"] = ayon_muster["MUSTER_REST_URL"]
muster_settings["templates_mapping"] = {
item["name"]: item["value"]
for item in ayon_muster["templates_mapping"]
}
output["modules"]["muster"] = muster_settings
def _convert_royalrender_system_settings(
ayon_settings, output, addon_versions, default_settings
):
@ -261,7 +245,6 @@ def _convert_modules_system(
_convert_timers_manager_system_settings,
_convert_clockify_system_settings,
_convert_deadline_system_settings,
_convert_muster_system_settings,
_convert_royalrender_system_settings,
):
func(ayon_settings, output, addon_versions, default_settings)
@ -1236,6 +1219,8 @@ def _convert_global_project_settings(ayon_settings, output, default_settings):
for profile in extract_oiio_transcode_profiles:
new_outputs = {}
name_counter = {}
if "product_names" in profile:
profile["subsets"] = profile.pop("product_names")
for profile_output in profile["outputs"]:
if "name" in profile_output:
name = profile_output.pop("name")

View file

@ -65,6 +65,8 @@
"group": "",
"department": "",
"use_gpu": true,
"workfile_dependency": true,
"use_published_workfile": true,
"env_allowed_keys": [],
"env_search_replace_values": {},
"limit_groups": {}

View file

@ -31,7 +31,8 @@
"reviewable",
"farm_rendering"
],
"image_format": "exr"
"image_format": "exr",
"default_frame_range_option": "asset_db"
},
"CreateImageSaver": {
"temp_rendering_path_template": "{workdir}/renders/fusion/{subset}/{subset}.{ext}",
@ -43,7 +44,8 @@
"reviewable",
"farm_rendering"
],
"image_format": "exr"
"image_format": "exr",
"default_frame": 0
}
},
"publish": {

View file

@ -164,23 +164,6 @@
"default": "http://127.0.0.1:8082"
}
},
"muster": {
"enabled": false,
"MUSTER_REST_URL": "http://127.0.0.1:9890",
"templates_mapping": {
"file_layers": 7,
"mentalray": 2,
"mentalray_sf": 6,
"redshift": 55,
"renderman": 29,
"software": 1,
"software_sf": 5,
"turtle": 10,
"vector": 4,
"vray": 37,
"ffmpeg": 48
}
},
"royalrender": {
"enabled": false,
"rr_paths": {

View file

@ -645,7 +645,7 @@ How output of the schema could look like on save:
},
"is_group": true,
"key": "templates_mapping",
"label": "Muster - Templates mapping",
"label": "Deadline - Templates mapping",
"is_file": true
}
```
@ -657,7 +657,7 @@ How output of the schema could look like on save:
"object_type": "text",
"is_group": true,
"key": "templates_mapping",
"label": "Muster - Templates mapping",
"label": "Deadline - Templates mapping",
"is_file": true
}
```

View file

@ -362,6 +362,16 @@
"key": "use_gpu",
"label": "Use GPU"
},
{
"type": "boolean",
"key": "workfile_dependency",
"label": "Workfile Dependency"
},
{
"type": "boolean",
"key": "use_published_workfile",
"label": "Use Published Workfile"
},
{
"type": "list",
"key": "env_allowed_keys",

View file

@ -116,6 +116,17 @@
{"tif": "tif"},
{"jpg": "jpg"}
]
},
{
"key": "default_frame_range_option",
"label": "Default frame range source",
"type": "enum",
"multiselect": false,
"enum_items": [
{"asset_db": "Current asset context"},
{"render_range": "From render in/out"},
{"comp_range": "From composition timeline"}
]
}
]
},
@ -165,6 +176,11 @@
{"tif": "tif"},
{"jpg": "jpg"}
]
},
{
"type": "number",
"key": "default_frame",
"label": "Default rendered frame"
}
]
}

View file

@ -207,37 +207,6 @@
}
]
},
{
"type": "dict",
"key": "muster",
"label": "Muster",
"require_restart": true,
"collapsible": true,
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "text",
"key": "MUSTER_REST_URL",
"label": "Muster Rest URL"
},
{
"type": "dict-modifiable",
"object_type": {
"type": "number",
"minimum": 0,
"maximum": 300
},
"is_group": true,
"key": "templates_mapping",
"label": "Templates mapping"
}
]
},
{
"type": "dict",
"key": "royalrender",

View file

@ -10,6 +10,7 @@ import inspect
from abc import ABCMeta, abstractmethod
import six
import arrow
import pyblish.api
from openpype import AYON_SERVER_ENABLED
@ -285,6 +286,8 @@ class PublishReportMaker:
def get_report(self, publish_plugins=None):
"""Report data with all details of current state."""
now = arrow.utcnow().to("local")
instances_details = {}
for instance in self._all_instances_by_id.values():
instances_details[instance.id] = self._extract_instance_data(
@ -334,7 +337,8 @@ class PublishReportMaker:
"context": self._extract_context_data(self._current_context),
"crashed_file_paths": crashed_file_paths,
"id": uuid.uuid4().hex,
"report_version": "1.0.0"
"created_at": now.isoformat(),
"report_version": "1.0.1",
}
def _extract_context_data(self, context):

View file

@ -26,14 +26,14 @@ class InstancesModel(QtGui.QStandardItemModel):
return self._items_by_id
def set_report(self, report_item):
self.clear()
root_item = self.invisibleRootItem()
if root_item.rowCount() > 0:
root_item.removeRows(0, root_item.rowCount())
self._items_by_id.clear()
self._plugin_items_by_id.clear()
if not report_item:
return
root_item = self.invisibleRootItem()
families = set(report_item.instance_items_by_family.keys())
families.remove(None)
all_families = list(sorted(families))
@ -125,14 +125,14 @@ class PluginsModel(QtGui.QStandardItemModel):
return self._items_by_id
def set_report(self, report_item):
self.clear()
root_item = self.invisibleRootItem()
if root_item.rowCount() > 0:
root_item.removeRows(0, root_item.rowCount())
self._items_by_id.clear()
self._plugin_items_by_id.clear()
if not report_item:
return
root_item = self.invisibleRootItem()
labels_iter = iter(self.order_label_mapping)
cur_order, cur_label = next(labels_iter)
cur_plugin_items = []

View file

@ -4,6 +4,7 @@ import six
import uuid
import appdirs
import arrow
from qtpy import QtWidgets, QtCore, QtGui
from openpype import style
@ -25,6 +26,7 @@ else:
ITEM_ID_ROLE = QtCore.Qt.UserRole + 1
ITEM_CREATED_AT_ROLE = QtCore.Qt.UserRole + 2
def get_reports_dir():
@ -47,47 +49,77 @@ class PublishReportItem:
"""Report item representing one file in report directory."""
def __init__(self, content):
item_id = content.get("id")
changed = False
if not item_id:
item_id = str(uuid.uuid4())
changed = True
content["id"] = item_id
changed = self._fix_content(content)
if not content.get("report_version"):
changed = True
content["report_version"] = "0.0.1"
report_path = os.path.join(get_reports_dir(), item_id)
report_path = os.path.join(get_reports_dir(), content["id"])
file_modified = None
if os.path.exists(report_path):
file_modified = os.path.getmtime(report_path)
created_at_obj = arrow.get(content["created_at"]).to("local")
created_at = created_at_obj.float_timestamp
self.content = content
self.report_path = report_path
self.file_modified = file_modified
self.created_at = float(created_at)
self._loaded_label = content.get("label")
self._changed = changed
self.publish_report = PublishReport(content)
@property
def version(self):
"""Publish report version.
Returns:
str: Publish report version.
"""
return self.content["report_version"]
@property
def id(self):
"""Publish report id.
Returns:
str: Publish report id.
"""
return self.content["id"]
def get_label(self):
"""Publish report label.
Returns:
str: Publish report label showed in UI.
"""
return self.content.get("label") or "Unfilled label"
def set_label(self, label):
"""Set publish report label.
Args:
label (str): New publish report label.
"""
if not label:
self.content.pop("label", None)
self.content["label"] = label
label = property(get_label, set_label)
@property
def loaded_label(self):
return self._loaded_label
def mark_as_changed(self):
"""Mark report as changed."""
self._changed = True
def save(self):
"""Save publish report to file."""
save = False
if (
self._changed
@ -109,6 +141,15 @@ class PublishReportItem:
@classmethod
def from_filepath(cls, filepath):
"""Create report item from file.
Args:
filepath (str): Path to report file. Content must be json.
Returns:
PublishReportItem: Report item.
"""
if not os.path.exists(filepath):
return None
@ -116,15 +157,25 @@ class PublishReportItem:
with open(filepath, "r") as stream:
content = json.load(stream)
return cls(content)
file_modified = os.path.getmtime(filepath)
changed = cls._fix_content(content, file_modified=file_modified)
obj = cls(content)
if changed:
obj.mark_as_changed()
return obj
except Exception:
return None
def remove_file(self):
"""Remove report file."""
if os.path.exists(self.report_path):
os.remove(self.report_path)
def update_file_content(self):
"""Update report content in file."""
if not os.path.exists(self.report_path):
return
@ -148,9 +199,57 @@ class PublishReportItem:
self.content = content
self.file_modified = file_modified
@classmethod
def _fix_content(cls, content, file_modified=None):
"""Fix content for backward compatibility of older report items.
Args:
content (dict[str, Any]): Report content.
file_modified (Optional[float]): File modification time.
Returns:
bool: True if content was changed, False otherwise.
"""
# Fix created_at key
changed = cls._fix_created_at(content, file_modified)
# NOTE backward compatibility for 'id' and 'report_version' is from
# 28.10.2022 https://github.com/ynput/OpenPype/pull/4040
# We can probably safely remove it
# Fix missing 'id'
item_id = content.get("id")
if not item_id:
item_id = str(uuid.uuid4())
changed = True
content["id"] = item_id
# Fix missing 'report_version'
if not content.get("report_version"):
changed = True
content["report_version"] = "0.0.1"
return changed
@classmethod
def _fix_created_at(cls, content, file_modified):
# Key 'create_at' was added in report version 1.0.1
created_at = content.get("created_at")
if created_at:
return False
# Auto fix 'created_at', use file modification time if it is not set
# or current time if modification could not be received.
if file_modified is not None:
created_at_obj = arrow.Arrow.fromtimestamp(file_modified)
else:
created_at_obj = arrow.utcnow()
content["created_at"] = created_at_obj.to("local").isoformat()
return True
class PublisherReportHandler:
"""Class handling storing publish report tool."""
"""Class handling storing publish report items."""
def __init__(self):
self._reports = None
@ -173,14 +272,23 @@ class PublisherReportHandler:
continue
filepath = os.path.join(report_dir, filename)
item = PublishReportItem.from_filepath(filepath)
reports.append(item)
reports_by_id[item.id] = item
if item is not None:
reports.append(item)
reports_by_id[item.id] = item
self._reports = reports
self._reports_by_id = reports_by_id
return reports
def remove_report_items(self, item_id):
def remove_report_item(self, item_id):
"""Remove report item by id.
Remove from cache and also remove the file with the content.
Args:
item_id (str): Report item id.
"""
item = self._reports_by_id.get(item_id)
if item:
try:
@ -191,9 +299,16 @@ class PublisherReportHandler:
class LoadedFilesModel(QtGui.QStandardItemModel):
header_labels = ("Reports", "Created")
def __init__(self, *args, **kwargs):
super(LoadedFilesModel, self).__init__(*args, **kwargs)
# Column count must be set before setting header data
self.setColumnCount(len(self.header_labels))
for col, label in enumerate(self.header_labels):
self.setHeaderData(col, QtCore.Qt.Horizontal, label)
self._items_by_id = {}
self._report_items_by_id = {}
@ -202,10 +317,14 @@ class LoadedFilesModel(QtGui.QStandardItemModel):
self._loading_registry = False
def refresh(self):
self._handler.reset()
root_item = self.invisibleRootItem()
if root_item.rowCount() > 0:
root_item.removeRows(0, root_item.rowCount())
self._items_by_id = {}
self._report_items_by_id = {}
self._handler.reset()
new_items = []
for report_item in self._handler.list_reports():
item = self._create_item(report_item)
@ -217,26 +336,26 @@ class LoadedFilesModel(QtGui.QStandardItemModel):
root_item = self.invisibleRootItem()
root_item.appendRows(new_items)
def headerData(self, section, orientation, role):
if role in (QtCore.Qt.DisplayRole, QtCore.Qt.EditRole):
if section == 0:
return "Exports"
if section == 1:
return "Modified"
return ""
super(LoadedFilesModel, self).headerData(section, orientation, role)
def data(self, index, role=None):
if role is None:
role = QtCore.Qt.DisplayRole
col = index.column()
if col == 1:
if role in (
QtCore.Qt.DisplayRole, QtCore.Qt.InitialSortOrderRole
):
role = ITEM_CREATED_AT_ROLE
if col != 0:
index = self.index(index.row(), 0, index.parent())
return super(LoadedFilesModel, self).data(index, role)
def setData(self, index, value, role):
def setData(self, index, value, role=None):
if role is None:
role = QtCore.Qt.EditRole
if role == QtCore.Qt.EditRole:
item_id = index.data(ITEM_ID_ROLE)
report_item = self._report_items_by_id.get(item_id)
@ -247,6 +366,12 @@ class LoadedFilesModel(QtGui.QStandardItemModel):
return super(LoadedFilesModel, self).setData(index, value, role)
def flags(self, index):
# Allow editable flag only for first column
if index.column() > 0:
return QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
return super(LoadedFilesModel, self).flags(index)
def _create_item(self, report_item):
if report_item.id in self._items_by_id:
return None
@ -254,6 +379,7 @@ class LoadedFilesModel(QtGui.QStandardItemModel):
item = QtGui.QStandardItem(report_item.label)
item.setColumnCount(self.columnCount())
item.setData(report_item.id, ITEM_ID_ROLE)
item.setData(report_item.created_at, ITEM_CREATED_AT_ROLE)
return item
@ -278,16 +404,16 @@ class LoadedFilesModel(QtGui.QStandardItemModel):
new_items = []
for normalized_path in filtered_paths:
try:
with open(normalized_path, "r") as stream:
data = json.load(stream)
report_item = PublishReportItem(data)
except Exception:
# TODO handle errors
report_item = PublishReportItem.from_filepath(normalized_path)
if report_item is None:
continue
label = data.get("label")
if not label:
# Skip already added report items
# QUESTION: Should we replace existing or skip the item?
if report_item.id in self._items_by_id:
continue
if not report_item.loaded_label:
report_item.label = (
os.path.splitext(os.path.basename(filepath))[0]
)
@ -306,15 +432,13 @@ class LoadedFilesModel(QtGui.QStandardItemModel):
root_item.appendRows(new_items)
def remove_item_by_id(self, item_id):
report_item = self._report_items_by_id.get(item_id)
if not report_item:
return
self._handler.remove_report_item(item_id)
self._handler.remove_report_items(item_id)
item = self._items_by_id.get(item_id)
parent = self.invisibleRootItem()
parent.removeRow(item.row())
self._report_items_by_id.pop(item_id, None)
item = self._items_by_id.pop(item_id, None)
if item is not None:
parent = self.invisibleRootItem()
parent.removeRow(item.row())
def get_report_by_id(self, item_id):
report_item = self._report_items_by_id.get(item_id)
@ -335,13 +459,18 @@ class LoadedFilesView(QtWidgets.QTreeView):
)
self.setIndentation(0)
self.setAlternatingRowColors(True)
self.setSortingEnabled(True)
model = LoadedFilesModel()
self.setModel(model)
proxy_model = QtCore.QSortFilterProxyModel()
proxy_model.setSourceModel(model)
self.setModel(proxy_model)
time_delegate = PrettyTimeDelegate()
self.setItemDelegateForColumn(1, time_delegate)
self.sortByColumn(1, QtCore.Qt.AscendingOrder)
remove_btn = IconButton(self)
remove_icon_path = resources.get_icon_path("delete")
loaded_remove_image = QtGui.QImage(remove_icon_path)
@ -356,6 +485,7 @@ class LoadedFilesView(QtWidgets.QTreeView):
)
self._model = model
self._proxy_model = proxy_model
self._time_delegate = time_delegate
self._remove_btn = remove_btn
@ -403,7 +533,8 @@ class LoadedFilesView(QtWidgets.QTreeView):
if index.isValid():
return
index = self._model.index(0, 0)
model = self.model()
index = model.index(0, 0)
if index.isValid():
self.setCurrentIndex(index)

View file

@ -334,7 +334,7 @@
},
"is_group": true,
"key": "templates_mapping",
"label": "Muster - Templates mapping",
"label": "Deadline - Templates mapping",
"is_file": true
}
```
@ -346,7 +346,7 @@
"object_type": "text",
"is_group": true,
"key": "templates_mapping",
"label": "Muster - Templates mapping",
"label": "Deadline - Templates mapping",
"is_file": true
}
```

View file

@ -91,7 +91,8 @@ def set_style_property(widget, property_name, property_value):
if cur_value == property_value:
return
widget.setProperty(property_name, property_value)
widget.style().polish(widget)
style = widget.style()
style.polish(widget)
def paint_image_with_color(image, color):

View file

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring Pype version."""
__version__ = "3.18.4-nightly.1"
__version__ = "3.18.6-nightly.1"

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "OpenPype"
version = "3.18.3" # OpenPype
version = "3.18.5" # OpenPype
description = "Open VFX and Animation pipeline with support."
authors = ["OpenPype Team <info@openpype.io>"]
license = "MIT License"

View file

@ -1,18 +1,16 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class CreateRenderPlugin(BaseSettingsModel):
mark_for_review: bool = Field(True, title="Review")
default_variants: list[str] = Field(
mark_for_review: bool = SettingsField(True, title="Review")
default_variants: list[str] = SettingsField(
default_factory=list,
title="Default Variants"
)
class AfterEffectsCreatorPlugins(BaseSettingsModel):
RenderCreator: CreateRenderPlugin = Field(
RenderCreator: CreateRenderPlugin = SettingsField(
title="Create Render",
default_factory=CreateRenderPlugin,
)

View file

@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -35,14 +35,14 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class AfterEffectsImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)

View file

@ -1,5 +1,4 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from .imageio import AfterEffectsImageIOModel
from .creator_plugins import AfterEffectsCreatorPlugins
@ -14,23 +13,23 @@ from .templated_workfile_build import TemplatedWorkfileBuildModel
class AfterEffectsSettings(BaseSettingsModel):
"""AfterEffects Project Settings."""
imageio: AfterEffectsImageIOModel = Field(
imageio: AfterEffectsImageIOModel = SettingsField(
default_factory=AfterEffectsImageIOModel,
title="OCIO config"
)
create: AfterEffectsCreatorPlugins = Field(
create: AfterEffectsCreatorPlugins = SettingsField(
default_factory=AfterEffectsCreatorPlugins,
title="Creator plugins"
)
publish: AfterEffectsPublishPlugins = Field(
publish: AfterEffectsPublishPlugins = SettingsField(
default_factory=AfterEffectsPublishPlugins,
title="Publish plugins"
)
workfile_builder: WorkfileBuilderPlugin = Field(
workfile_builder: WorkfileBuilderPlugin = SettingsField(
default_factory=WorkfileBuilderPlugin,
title="Workfile Builder"
)
templated_workfile_build: TemplatedWorkfileBuildModel = Field(
templated_workfile_build: TemplatedWorkfileBuildModel = SettingsField(
default_factory=TemplatedWorkfileBuildModel,
title="Templated Workfile Build Settings"
)

View file

@ -1,45 +1,43 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class CollectReviewPluginModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
enabled: bool = SettingsField(True, title="Enabled")
class ValidateSceneSettingsModel(BaseSettingsModel):
"""Validate naming of products and layers"""
# _isGroup = True
enabled: bool = Field(True, title="Enabled")
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
skip_resolution_check: list[str] = Field(
enabled: bool = SettingsField(True, title="Enabled")
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
skip_resolution_check: list[str] = SettingsField(
default_factory=list,
title="Skip Resolution Check for Tasks",
)
skip_timelines_check: list[str] = Field(
skip_timelines_check: list[str] = SettingsField(
default_factory=list,
title="Skip Timeline Check for Tasks",
)
class ValidateContainersModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
optional: bool = Field(True, title="Optional")
active: bool = Field(True, title="Active")
enabled: bool = SettingsField(True, title="Enabled")
optional: bool = SettingsField(True, title="Optional")
active: bool = SettingsField(True, title="Active")
class AfterEffectsPublishPlugins(BaseSettingsModel):
CollectReview: CollectReviewPluginModel = Field(
CollectReview: CollectReviewPluginModel = SettingsField(
default_factory=CollectReviewPluginModel,
title="Collect Review",
)
ValidateSceneSettings: ValidateSceneSettingsModel = Field(
ValidateSceneSettings: ValidateSceneSettingsModel = SettingsField(
default_factory=ValidateSceneSettingsModel,
title="Validate Scene Settings",
)
ValidateContainers: ValidateContainersModel = Field(
ValidateContainers: ValidateContainersModel = SettingsField(
default_factory=ValidateContainersModel,
title="Validate Containers",
)

View file

@ -1,33 +1,33 @@
from pydantic import Field
from ayon_server.settings import (
BaseSettingsModel,
task_types_enum,
SettingsField,
)
class TemplatedWorkfileProfileModel(BaseSettingsModel):
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
path: str = Field(
path: str = SettingsField(
title="Path to template"
)
keep_placeholder: bool = Field(
keep_placeholder: bool = SettingsField(
False,
title="Keep placeholders")
create_first_version: bool = Field(
create_first_version: bool = SettingsField(
True,
title="Create first version"
)
class TemplatedWorkfileBuildModel(BaseSettingsModel):
profiles: list[TemplatedWorkfileProfileModel] = Field(
profiles: list[TemplatedWorkfileProfileModel] = SettingsField(
default_factory=list
)

View file

@ -1,25 +1,27 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel, MultiplatformPathModel
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
MultiplatformPathModel,
)
class CustomBuilderTemplate(BaseSettingsModel):
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
)
template_path: MultiplatformPathModel = Field(
template_path: MultiplatformPathModel = SettingsField(
default_factory=MultiplatformPathModel
)
class WorkfileBuilderPlugin(BaseSettingsModel):
_title = "Workfile Builder"
create_first_version: bool = Field(
create_first_version: bool = SettingsField(
False,
title="Create first workfile"
)
custom_templates: list[CustomBuilderTemplate] = Field(
custom_templates: list[CustomBuilderTemplate] = SettingsField(
default_factory=list
)

View file

@ -307,9 +307,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--nukeassist"],
"darwin": [],
"linux": []
"linux": ["--nukeassist"]
},
"environment": "{}",
"use_python_2": false
@ -329,9 +329,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--nukeassist"],
"darwin": [],
"linux": []
"linux": ["--nukeassist"]
},
"environment": "{}",
"use_python_2": false
@ -351,9 +351,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--nukeassist"],
"darwin": [],
"linux": []
"linux": ["--nukeassist"]
},
"environment": "{}",
"use_python_2": false
@ -382,9 +382,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--nukex"],
"darwin": [],
"linux": []
"linux": ["--nukex"]
},
"environment": "{}",
"use_python_2": false
@ -404,9 +404,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--nukex"],
"darwin": [],
"linux": []
"linux": ["--nukex"]
},
"environment": "{}",
"use_python_2": false
@ -426,9 +426,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--nukex"],
"darwin": [],
"linux": []
"linux": ["--nukex"]
},
"environment": "{}",
"use_python_2": false
@ -457,9 +457,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--studio"],
"darwin": [],
"linux": []
"linux": ["--studio"]
},
"environment": "{}",
"use_python_2": false
@ -479,9 +479,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--studio"],
"darwin": [],
"linux": []
"linux": ["--studio"]
},
"environment": "{}",
"use_python_2": false
@ -501,9 +501,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--studio"],
"darwin": [],
"linux": []
"linux": ["--studio"]
},
"environment": "{}",
"use_python_2": false
@ -532,9 +532,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--hiero"],
"darwin": [],
"linux": []
"linux": ["--hiero"]
},
"environment": "{}",
"use_python_2": false
@ -554,9 +554,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--hiero"],
"darwin": [],
"linux": []
"linux": ["--hiero"]
},
"environment": "{}",
"use_python_2": false
@ -576,9 +576,9 @@
]
},
"arguments": {
"windows": [],
"windows": ["--hiero"],
"darwin": [],
"linux": []
"linux": ["--hiero"]
},
"environment": "{}",
"use_python_2": false

View file

@ -1,7 +1,11 @@
import json
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, ensure_unique_names
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
)
from ayon_server.exceptions import BadRequestException
@ -23,21 +27,23 @@ def validate_json_dict(value):
class MultiplatformStrList(BaseSettingsModel):
windows: list[str] = Field(default_factory=list, title="Windows")
linux: list[str] = Field(default_factory=list, title="Linux")
darwin: list[str] = Field(default_factory=list, title="MacOS")
windows: list[str] = SettingsField(default_factory=list, title="Windows")
linux: list[str] = SettingsField(default_factory=list, title="Linux")
darwin: list[str] = SettingsField(default_factory=list, title="MacOS")
class AppVariant(BaseSettingsModel):
name: str = Field("", title="Name")
label: str = Field("", title="Label")
executables: MultiplatformStrList = Field(
name: str = SettingsField("", title="Name")
label: str = SettingsField("", title="Label")
executables: MultiplatformStrList = SettingsField(
default_factory=MultiplatformStrList, title="Executables"
)
arguments: MultiplatformStrList = Field(
arguments: MultiplatformStrList = SettingsField(
default_factory=MultiplatformStrList, title="Arguments"
)
environment: str = Field("{}", title="Environment", widget="textarea")
environment: str = SettingsField(
"{}", title="Environment", widget="textarea"
)
@validator("environment")
def validate_json(cls, value):
@ -45,17 +51,19 @@ class AppVariant(BaseSettingsModel):
class AppVariantWithPython(AppVariant):
use_python_2: bool = Field(False, title="Use Python 2")
use_python_2: bool = SettingsField(False, title="Use Python 2")
class AppGroup(BaseSettingsModel):
enabled: bool = Field(True)
label: str = Field("", title="Label")
host_name: str = Field("", title="Host name")
icon: str = Field("", title="Icon")
environment: str = Field("{}", title="Environment", widget="textarea")
enabled: bool = SettingsField(True)
label: str = SettingsField("", title="Label")
host_name: str = SettingsField("", title="Host name")
icon: str = SettingsField("", title="Icon")
environment: str = SettingsField(
"{}", title="Environment", widget="textarea"
)
variants: list[AppVariant] = Field(
variants: list[AppVariant] = SettingsField(
default_factory=list,
title="Variants",
description="Different variants of the applications",
@ -69,7 +77,7 @@ class AppGroup(BaseSettingsModel):
class AppGroupWithPython(AppGroup):
variants: list[AppVariantWithPython] = Field(
variants: list[AppVariantWithPython] = SettingsField(
default_factory=list,
title="Variants",
description="Different variants of the applications",
@ -78,14 +86,16 @@ class AppGroupWithPython(AppGroup):
class AdditionalAppGroup(BaseSettingsModel):
enabled: bool = Field(True)
name: str = Field("", title="Name")
label: str = Field("", title="Label")
host_name: str = Field("", title="Host name")
icon: str = Field("", title="Icon")
environment: str = Field("{}", title="Environment", widget="textarea")
enabled: bool = SettingsField(True)
name: str = SettingsField("", title="Name")
label: str = SettingsField("", title="Label")
host_name: str = SettingsField("", title="Host name")
icon: str = SettingsField("", title="Icon")
environment: str = SettingsField(
"{}", title="Environment", widget="textarea"
)
variants: list[AppVariantWithPython] = Field(
variants: list[AppVariantWithPython] = SettingsField(
default_factory=list,
title="Variants",
description="Different variants of the applications",
@ -99,12 +109,16 @@ class AdditionalAppGroup(BaseSettingsModel):
class ToolVariantModel(BaseSettingsModel):
name: str = Field("", title="Name")
label: str = Field("", title="Label")
host_names: list[str] = Field(default_factory=list, title="Hosts")
name: str = SettingsField("", title="Name")
label: str = SettingsField("", title="Label")
host_names: list[str] = SettingsField(default_factory=list, title="Hosts")
# TODO use applications enum if possible
app_variants: list[str] = Field(default_factory=list, title="Applications")
environment: str = Field("{}", title="Environments", widget="textarea")
app_variants: list[str] = SettingsField(
default_factory=list, title="Applications"
)
environment: str = SettingsField(
"{}", title="Environments", widget="textarea"
)
@validator("environment")
def validate_json(cls, value):
@ -112,10 +126,12 @@ class ToolVariantModel(BaseSettingsModel):
class ToolGroupModel(BaseSettingsModel):
name: str = Field("", title="Name")
label: str = Field("", title="Label")
environment: str = Field("{}", title="Environments", widget="textarea")
variants: list[ToolVariantModel] = Field(default_factory=list)
name: str = SettingsField("", title="Name")
label: str = SettingsField("", title="Label")
environment: str = SettingsField(
"{}", title="Environments", widget="textarea"
)
variants: list[ToolVariantModel] = SettingsField(default_factory=list)
@validator("environment")
def validate_json(cls, value):
@ -130,47 +146,47 @@ class ToolGroupModel(BaseSettingsModel):
class ApplicationsSettings(BaseSettingsModel):
"""Applications settings"""
maya: AppGroupWithPython = Field(
maya: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Autodesk Maya")
adsk_3dsmax: AppGroupWithPython = Field(
adsk_3dsmax: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Autodesk 3ds Max")
flame: AppGroupWithPython = Field(
flame: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Autodesk Flame")
nuke: AppGroupWithPython = Field(
nuke: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Nuke")
nukeassist: AppGroupWithPython = Field(
nukeassist: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Nuke Assist")
nukex: AppGroupWithPython = Field(
nukex: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Nuke X")
nukestudio: AppGroupWithPython = Field(
nukestudio: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Nuke Studio")
hiero: AppGroupWithPython = Field(
hiero: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Hiero")
fusion: AppGroup = Field(
fusion: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Fusion")
resolve: AppGroupWithPython = Field(
resolve: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Resolve")
houdini: AppGroupWithPython = Field(
houdini: AppGroupWithPython = SettingsField(
default_factory=AppGroupWithPython, title="Houdini")
blender: AppGroup = Field(
blender: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Blender")
harmony: AppGroup = Field(
harmony: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Harmony")
tvpaint: AppGroup = Field(
tvpaint: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="TVPaint")
photoshop: AppGroup = Field(
photoshop: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Adobe Photoshop")
aftereffects: AppGroup = Field(
aftereffects: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Adobe After Effects")
celaction: AppGroup = Field(
celaction: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Celaction 2D")
substancepainter: AppGroup = Field(
substancepainter: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Substance Painter")
unreal: AppGroup = Field(
unreal: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Unreal Editor")
wrap: AppGroup = Field(
wrap: AppGroup = SettingsField(
default_factory=AppGroupWithPython, title="Wrap")
additional_apps: list[AdditionalAppGroup] = Field(
additional_apps: list[AdditionalAppGroup] = SettingsField(
default_factory=list, title="Additional Applications")
@validator("additional_apps")
@ -180,16 +196,16 @@ class ApplicationsSettings(BaseSettingsModel):
class ApplicationsAddonSettings(BaseSettingsModel):
applications: ApplicationsSettings = Field(
applications: ApplicationsSettings = SettingsField(
default_factory=ApplicationsSettings,
title="Applications",
scope=["studio"]
)
tool_groups: list[ToolGroupModel] = Field(
tool_groups: list[ToolGroupModel] = SettingsField(
default_factory=list,
scope=["studio"]
)
only_available: bool = Field(
only_available: bool = SettingsField(
True, title="Show only available applications")
@validator("tool_groups")

View file

@ -1 +1 @@
__version__ = "0.1.3"
__version__ = "0.1.4"

View file

@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -35,14 +35,14 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class BlenderImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)

View file

@ -1,6 +1,6 @@
from pydantic import Field
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
TemplateWorkfileBaseOptions,
)
@ -16,38 +16,38 @@ from .render_settings import (
class UnitScaleSettingsModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
apply_on_opening: bool = Field(
enabled: bool = SettingsField(True, title="Enabled")
apply_on_opening: bool = SettingsField(
False, title="Apply on Opening Existing Files")
base_file_unit_scale: float = Field(
base_file_unit_scale: float = SettingsField(
1.0, title="Base File Unit Scale"
)
class BlenderSettings(BaseSettingsModel):
unit_scale_settings: UnitScaleSettingsModel = Field(
unit_scale_settings: UnitScaleSettingsModel = SettingsField(
default_factory=UnitScaleSettingsModel,
title="Set Unit Scale"
)
set_resolution_startup: bool = Field(
set_resolution_startup: bool = SettingsField(
True,
title="Set Resolution on Startup"
)
set_frames_startup: bool = Field(
set_frames_startup: bool = SettingsField(
True,
title="Set Start/End Frames and FPS on Startup"
)
imageio: BlenderImageIOModel = Field(
imageio: BlenderImageIOModel = SettingsField(
default_factory=BlenderImageIOModel,
title="Color Management (ImageIO)"
)
RenderSettings: RenderSettingsModel = Field(
RenderSettings: RenderSettingsModel = SettingsField(
default_factory=RenderSettingsModel, title="Render Settings")
workfile_builder: TemplateWorkfileBaseOptions = Field(
workfile_builder: TemplateWorkfileBaseOptions = SettingsField(
default_factory=TemplateWorkfileBaseOptions,
title="Workfile Builder"
)
publish: PublishPuginsModel = Field(
publish: PublishPuginsModel = SettingsField(
default_factory=PublishPuginsModel,
title="Publish Plugins"
)

View file

@ -1,7 +1,7 @@
import json
from pydantic import Field, validator
from pydantic import validator
from ayon_server.exceptions import BadRequestException
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
def validate_json_dict(value):
@ -21,36 +21,36 @@ def validate_json_dict(value):
class ValidatePluginModel(BaseSettingsModel):
enabled: bool = Field(True)
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
enabled: bool = SettingsField(True)
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
class ValidateFileSavedModel(BaseSettingsModel):
enabled: bool = Field(title="ValidateFileSaved")
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
exclude_families: list[str] = Field(
enabled: bool = SettingsField(title="ValidateFileSaved")
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
exclude_families: list[str] = SettingsField(
default_factory=list,
title="Exclude product types"
)
class ExtractBlendModel(BaseSettingsModel):
enabled: bool = Field(True)
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
families: list[str] = Field(
enabled: bool = SettingsField(True)
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
families: list[str] = SettingsField(
default_factory=list,
title="Families"
)
class ExtractPlayblastModel(BaseSettingsModel):
enabled: bool = Field(True)
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
presets: str = Field("", title="Presets", widget="textarea")
enabled: bool = SettingsField(True)
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
presets: str = SettingsField("", title="Presets", widget="textarea")
@validator("presets")
def validate_json(cls, value):
@ -58,83 +58,83 @@ class ExtractPlayblastModel(BaseSettingsModel):
class PublishPuginsModel(BaseSettingsModel):
ValidateCameraZeroKeyframe: ValidatePluginModel = Field(
ValidateCameraZeroKeyframe: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Camera Zero Keyframe",
section="General Validators"
)
ValidateFileSaved: ValidateFileSavedModel = Field(
ValidateFileSaved: ValidateFileSavedModel = SettingsField(
default_factory=ValidateFileSavedModel,
title="Validate File Saved",
)
ValidateInstanceEmpty: ValidatePluginModel = Field(
ValidateInstanceEmpty: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Instance is not Empty"
)
ValidateMeshHasUvs: ValidatePluginModel = Field(
ValidateMeshHasUvs: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Mesh Has Uvs",
section="Model Validators"
)
ValidateMeshNoNegativeScale: ValidatePluginModel = Field(
ValidateMeshNoNegativeScale: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Mesh No Negative Scale"
)
ValidateTransformZero: ValidatePluginModel = Field(
ValidateTransformZero: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Transform Zero"
)
ValidateNoColonsInName: ValidatePluginModel = Field(
ValidateNoColonsInName: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate No Colons In Name"
)
ValidateRenderCameraIsSet: ValidatePluginModel = Field(
ValidateRenderCameraIsSet: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Render Camera Is Set",
section="Render Validators"
)
ValidateDeadlinePublish: ValidatePluginModel = Field(
ValidateDeadlinePublish: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Validate Render Output for Deadline",
)
ExtractBlend: ExtractBlendModel = Field(
ExtractBlend: ExtractBlendModel = SettingsField(
default_factory=ExtractBlendModel,
title="Extract Blend",
section="Extractors"
)
ExtractFBX: ValidatePluginModel = Field(
ExtractFBX: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract FBX"
)
ExtractModelABC: ValidatePluginModel = Field(
ExtractModelABC: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract ABC"
)
ExtractBlendAnimation: ValidatePluginModel = Field(
ExtractBlendAnimation: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract Blend Animation"
)
ExtractAnimationFBX: ValidatePluginModel = Field(
ExtractAnimationFBX: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract Animation FBX"
)
ExtractCamera: ValidatePluginModel = Field(
ExtractCamera: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract Camera"
)
ExtractCameraABC: ValidatePluginModel = Field(
ExtractCameraABC: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract Camera as ABC"
)
ExtractLayout: ValidatePluginModel = Field(
ExtractLayout: ValidatePluginModel = SettingsField(
default_factory=ValidatePluginModel,
title="Extract Layout (JSON)"
)
ExtractThumbnail: ExtractPlayblastModel = Field(
ExtractThumbnail: ExtractPlayblastModel = SettingsField(
default_factory=ExtractPlayblastModel,
title="Extract Thumbnail"
)
ExtractPlayblast: ExtractPlayblastModel = Field(
ExtractPlayblast: ExtractPlayblastModel = SettingsField(
default_factory=ExtractPlayblastModel,
title="Extract Playblast"
)

View file

@ -1,7 +1,5 @@
"""Providing models and values for Blender Render Settings."""
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
def aov_separators_enum():
@ -58,8 +56,8 @@ class CustomPassesModel(BaseSettingsModel):
"""Custom Passes"""
_layout = "compact"
attribute: str = Field("", title="Attribute name")
value: str = Field(
attribute: str = SettingsField("", title="Attribute name")
value: str = SettingsField(
"COLOR",
title="Type",
enum_resolver=custom_passes_types_enum
@ -67,28 +65,28 @@ class CustomPassesModel(BaseSettingsModel):
class RenderSettingsModel(BaseSettingsModel):
default_render_image_folder: str = Field(
default_render_image_folder: str = SettingsField(
title="Default Render Image Folder"
)
aov_separator: str = Field(
aov_separator: str = SettingsField(
"underscore",
title="AOV Separator Character",
enum_resolver=aov_separators_enum
)
image_format: str = Field(
image_format: str = SettingsField(
"exr",
title="Image Format",
enum_resolver=image_format_enum
)
multilayer_exr: bool = Field(
multilayer_exr: bool = SettingsField(
title="Multilayer (EXR)"
)
aov_list: list[str] = Field(
aov_list: list[str] = SettingsField(
default_factory=list,
enum_resolver=aov_list_enum,
title="AOVs to create"
)
custom_passes: list[CustomPassesModel] = Field(
custom_passes: list[CustomPassesModel] = SettingsField(
default_factory=list,
title="Custom Passes",
description=(

View file

@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -35,14 +35,14 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class CelActionImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)

View file

@ -1,18 +1,17 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from .imageio import CelActionImageIOModel
class CollectRenderPathModel(BaseSettingsModel):
output_extension: str = Field(
output_extension: str = SettingsField(
"",
title="Output render file extension"
)
anatomy_template_key_render_files: str = Field(
anatomy_template_key_render_files: str = SettingsField(
"",
title="Anatomy template key: render files"
)
anatomy_template_key_metadata: str = Field(
anatomy_template_key_metadata: str = SettingsField(
"",
title="Anatomy template key: metadata job file"
)
@ -36,7 +35,7 @@ def _workfile_submit_overrides():
class WorkfileModel(BaseSettingsModel):
submission_overrides: list[str] = Field(
submission_overrides: list[str] = SettingsField(
default_factory=list,
title="Submission workfile overrides",
enum_resolver=_workfile_submit_overrides
@ -44,21 +43,21 @@ class WorkfileModel(BaseSettingsModel):
class PublishPuginsModel(BaseSettingsModel):
CollectRenderPath: CollectRenderPathModel = Field(
CollectRenderPath: CollectRenderPathModel = SettingsField(
default_factory=CollectRenderPathModel,
title="Collect Render Path"
)
class CelActionSettings(BaseSettingsModel):
imageio: CelActionImageIOModel = Field(
imageio: CelActionImageIOModel = SettingsField(
default_factory=CelActionImageIOModel,
title="Color Management (ImageIO)"
)
workfile: WorkfileModel = Field(
workfile: WorkfileModel = SettingsField(
title="Workfile"
)
publish: PublishPuginsModel = Field(
publish: PublishPuginsModel = SettingsField(
default_factory=PublishPuginsModel,
title="Publish plugins",
)

View file

@ -1,9 +1,8 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class ClockifySettings(BaseSettingsModel):
workspace_name: str = Field(
workspace_name: str = SettingsField(
"",
title="Workspace name",
scope=["studio"]

View file

@ -1,7 +1,8 @@
import json
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
MultiplatformPathListModel,
ensure_unique_names,
task_types_enum,
@ -14,35 +15,35 @@ from .tools import GlobalToolsModel, DEFAULT_TOOLS_VALUES
class DiskMappingItemModel(BaseSettingsModel):
_layout = "expanded"
source: str = Field("", title="Source")
destination: str = Field("", title="Destination")
source: str = SettingsField("", title="Source")
destination: str = SettingsField("", title="Destination")
class DiskMappingModel(BaseSettingsModel):
windows: list[DiskMappingItemModel] = Field(
windows: list[DiskMappingItemModel] = SettingsField(
title="Windows",
default_factory=list,
)
linux: list[DiskMappingItemModel] = Field(
linux: list[DiskMappingItemModel] = SettingsField(
title="Linux",
default_factory=list,
)
darwin: list[DiskMappingItemModel] = Field(
darwin: list[DiskMappingItemModel] = SettingsField(
title="MacOS",
default_factory=list,
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class CoreImageIOFileRulesModel(BaseSettingsModel):
activate_global_file_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_global_file_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -54,19 +55,21 @@ class CoreImageIOFileRulesModel(BaseSettingsModel):
class CoreImageIOConfigModel(BaseSettingsModel):
filepath: list[str] = Field(default_factory=list, title="Config path")
filepath: list[str] = SettingsField(
default_factory=list, title="Config path"
)
class CoreImageIOBaseModel(BaseSettingsModel):
activate_global_color_management: bool = Field(
activate_global_color_management: bool = SettingsField(
False,
title="Enable Color Management"
)
ocio_config: CoreImageIOConfigModel = Field(
ocio_config: CoreImageIOConfigModel = SettingsField(
default_factory=CoreImageIOConfigModel,
title="OCIO config"
)
file_rules: CoreImageIOFileRulesModel = Field(
file_rules: CoreImageIOFileRulesModel = SettingsField(
default_factory=CoreImageIOFileRulesModel,
title="File Rules"
)
@ -74,28 +77,28 @@ class CoreImageIOBaseModel(BaseSettingsModel):
class VersionStartCategoryProfileModel(BaseSettingsModel):
_layout = "expanded"
host_names: list[str] = Field(
host_names: list[str] = SettingsField(
default_factory=list,
title="Host names"
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
product_names: list[str] = Field(
product_names: list[str] = SettingsField(
default_factory=list,
title="Product names"
)
version_start: int = Field(
version_start: int = SettingsField(
1,
title="Version Start",
ge=0
@ -103,52 +106,52 @@ class VersionStartCategoryProfileModel(BaseSettingsModel):
class VersionStartCategoryModel(BaseSettingsModel):
profiles: list[VersionStartCategoryProfileModel] = Field(
profiles: list[VersionStartCategoryProfileModel] = SettingsField(
default_factory=list,
title="Profiles"
)
class CoreSettings(BaseSettingsModel):
studio_name: str = Field("", title="Studio name", scope=["studio"])
studio_code: str = Field("", title="Studio code", scope=["studio"])
environments: str = Field(
studio_name: str = SettingsField("", title="Studio name", scope=["studio"])
studio_code: str = SettingsField("", title="Studio code", scope=["studio"])
environments: str = SettingsField(
"{}",
title="Global environment variables",
widget="textarea",
scope=["studio"],
)
disk_mapping: DiskMappingModel = Field(
disk_mapping: DiskMappingModel = SettingsField(
default_factory=DiskMappingModel,
title="Disk mapping",
)
tools: GlobalToolsModel = Field(
tools: GlobalToolsModel = SettingsField(
default_factory=GlobalToolsModel,
title="Tools"
)
version_start_category: VersionStartCategoryModel = Field(
version_start_category: VersionStartCategoryModel = SettingsField(
default_factory=VersionStartCategoryModel,
title="Version start"
)
imageio: CoreImageIOBaseModel = Field(
imageio: CoreImageIOBaseModel = SettingsField(
default_factory=CoreImageIOBaseModel,
title="Color Management (ImageIO)"
)
publish: PublishPuginsModel = Field(
publish: PublishPuginsModel = SettingsField(
default_factory=PublishPuginsModel,
title="Publish plugins"
)
project_plugins: MultiplatformPathListModel = Field(
project_plugins: MultiplatformPathListModel = SettingsField(
default_factory=MultiplatformPathListModel,
title="Additional Project Plugin Paths",
)
project_folder_structure: str = Field(
project_folder_structure: str = SettingsField(
"{}",
widget="textarea",
title="Project folder structure",
section="---"
)
project_environments: str = Field(
project_environments: str = SettingsField(
"{}",
widget="textarea",
title="Project environments",

View file

@ -1,7 +1,8 @@
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
MultiplatformPathModel,
normalize_name,
ensure_unique_names,
@ -13,46 +14,46 @@ from ayon_server.types import ColorRGBA_uint8
class ValidateBaseModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
optional: bool = Field(True, title="Optional")
active: bool = Field(True, title="Active")
enabled: bool = SettingsField(True)
optional: bool = SettingsField(True, title="Optional")
active: bool = SettingsField(True, title="Active")
class CollectAnatomyInstanceDataModel(BaseSettingsModel):
_isGroup = True
follow_workfile_version: bool = Field(
follow_workfile_version: bool = SettingsField(
True, title="Follow workfile version"
)
class CollectAudioModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
audio_product_name: str = Field(
enabled: bool = SettingsField(True)
audio_product_name: str = SettingsField(
"", title="Name of audio variant"
)
class CollectSceneVersionModel(BaseSettingsModel):
_isGroup = True
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Host names"
)
skip_hosts_headless_publish: list[str] = Field(
skip_hosts_headless_publish: list[str] = SettingsField(
default_factory=list,
title="Skip for host if headless publish"
)
class CollectCommentPIModel(BaseSettingsModel):
enabled: bool = Field(True)
families: list[str] = Field(default_factory=list, title="Families")
enabled: bool = SettingsField(True)
families: list[str] = SettingsField(default_factory=list, title="Families")
class CollectFramesFixDefModel(BaseSettingsModel):
enabled: bool = Field(True)
rewrite_version_enable: bool = Field(
enabled: bool = SettingsField(True)
rewrite_version_enable: bool = SettingsField(
True,
title="Show 'Rewrite latest version' toggle"
)
@ -60,15 +61,15 @@ class CollectFramesFixDefModel(BaseSettingsModel):
class ValidateIntentProfile(BaseSettingsModel):
_layout = "expanded"
hosts: list[str] = Field(default_factory=list, title="Host names")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Host names")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(default_factory=list, title="Task names")
tasks: list[str] = SettingsField(default_factory=list, title="Task names")
# TODO This was 'validate' in v3
validate_intent: bool = Field(True, title="Validate")
validate_intent: bool = SettingsField(True, title="Validate")
class ValidateIntentModel(BaseSettingsModel):
@ -79,16 +80,16 @@ class ValidateIntentModel(BaseSettingsModel):
"""
_isGroup = True
enabled: bool = Field(False)
profiles: list[ValidateIntentProfile] = Field(default_factory=list)
enabled: bool = SettingsField(False)
profiles: list[ValidateIntentProfile] = SettingsField(default_factory=list)
class ExtractThumbnailFFmpegModel(BaseSettingsModel):
input: list[str] = Field(
input: list[str] = SettingsField(
default_factory=list,
title="FFmpeg input arguments"
)
output: list[str] = Field(
output: list[str] = SettingsField(
default_factory=list,
title="FFmpeg input arguments"
)
@ -96,7 +97,7 @@ class ExtractThumbnailFFmpegModel(BaseSettingsModel):
class ResizeItemModel(BaseSettingsModel):
_layout = "expanded"
width: int = Field(
width: int = SettingsField(
1920,
ge=0,
le=100000,
@ -104,7 +105,7 @@ class ResizeItemModel(BaseSettingsModel):
description="Width and Height must be both set to higher value than 0"
" else source resolution is used."
)
height: int = Field(
height: int = SettingsField(
1080,
title="Height",
ge=0,
@ -121,7 +122,7 @@ _resize_types_enum = [
class ResizeModel(BaseSettingsModel):
_layout = "expanded"
type: str = Field(
type: str = SettingsField(
title="Type",
description="Type of resizing",
enum_resolver=lambda: _resize_types_enum,
@ -129,7 +130,7 @@ class ResizeModel(BaseSettingsModel):
default="source"
)
resize: ResizeItemModel = Field(
resize: ResizeItemModel = SettingsField(
default_factory=ResizeItemModel,
title="Resize"
)
@ -143,18 +144,18 @@ _thumbnail_oiio_transcoding_type = [
class DisplayAndViewModel(BaseSettingsModel):
_layout = "expanded"
display: str = Field(
display: str = SettingsField(
"default",
title="Display"
)
view: str = Field(
view: str = SettingsField(
"sRGB",
title="View"
)
class ExtractThumbnailOIIODefaultsModel(BaseSettingsModel):
type: str = Field(
type: str = SettingsField(
title="Type",
description="Transcoding type",
enum_resolver=lambda: _thumbnail_oiio_transcoding_type,
@ -162,11 +163,11 @@ class ExtractThumbnailOIIODefaultsModel(BaseSettingsModel):
default="colorspace"
)
colorspace: str = Field(
colorspace: str = SettingsField(
"",
title="Colorspace"
)
display_and_view: DisplayAndViewModel = Field(
display_and_view: DisplayAndViewModel = SettingsField(
default_factory=DisplayAndViewModel,
title="Display&View"
)
@ -174,30 +175,30 @@ class ExtractThumbnailOIIODefaultsModel(BaseSettingsModel):
class ExtractThumbnailModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
integrate_thumbnail: bool = Field(
enabled: bool = SettingsField(True)
integrate_thumbnail: bool = SettingsField(
True,
title="Integrate Thumbnail Representation"
)
target_size: ResizeModel = Field(
target_size: ResizeModel = SettingsField(
default_factory=ResizeModel,
title="Target size"
)
background_color: ColorRGBA_uint8 = Field(
background_color: ColorRGBA_uint8 = SettingsField(
(0, 0, 0, 0.0),
title="Background color"
)
duration_split: float = Field(
duration_split: float = SettingsField(
0.5,
title="Duration split",
ge=0.0,
le=1.0
)
oiiotool_defaults: ExtractThumbnailOIIODefaultsModel = Field(
oiiotool_defaults: ExtractThumbnailOIIODefaultsModel = SettingsField(
default_factory=ExtractThumbnailOIIODefaultsModel,
title="OIIOtool defaults"
)
ffmpeg_args: ExtractThumbnailFFmpegModel = Field(
ffmpeg_args: ExtractThumbnailFFmpegModel = SettingsField(
default_factory=ExtractThumbnailFFmpegModel
)
@ -210,57 +211,59 @@ def _extract_oiio_transcoding_type():
class OIIOToolArgumentsModel(BaseSettingsModel):
additional_command_args: list[str] = Field(
additional_command_args: list[str] = SettingsField(
default_factory=list, title="Arguments")
class ExtractOIIOTranscodeOutputModel(BaseSettingsModel):
_layout = "expanded"
name: str = Field("", title="Name")
extension: str = Field("", title="Extension")
transcoding_type: str = Field(
name: str = SettingsField("", title="Name")
extension: str = SettingsField("", title="Extension")
transcoding_type: str = SettingsField(
"colorspace",
title="Transcoding type",
enum_resolver=_extract_oiio_transcoding_type
)
colorspace: str = Field("", title="Colorspace")
display: str = Field("", title="Display")
view: str = Field("", title="View")
oiiotool_args: OIIOToolArgumentsModel = Field(
colorspace: str = SettingsField("", title="Colorspace")
display: str = SettingsField("", title="Display")
view: str = SettingsField("", title="View")
oiiotool_args: OIIOToolArgumentsModel = SettingsField(
default_factory=OIIOToolArgumentsModel,
title="OIIOtool arguments")
tags: list[str] = Field(default_factory=list, title="Tags")
custom_tags: list[str] = Field(default_factory=list, title="Custom Tags")
tags: list[str] = SettingsField(default_factory=list, title="Tags")
custom_tags: list[str] = SettingsField(
default_factory=list, title="Custom Tags"
)
class ExtractOIIOTranscodeProfileModel(BaseSettingsModel):
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Host names"
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
product_names: list[str] = Field(
product_names: list[str] = SettingsField(
default_factory=list,
title="Product names"
)
delete_original: bool = Field(
delete_original: bool = SettingsField(
True,
title="Delete Original Representation"
)
outputs: list[ExtractOIIOTranscodeOutputModel] = Field(
outputs: list[ExtractOIIOTranscodeOutputModel] = SettingsField(
default_factory=list,
title="Output Definitions",
)
@ -272,27 +275,27 @@ class ExtractOIIOTranscodeProfileModel(BaseSettingsModel):
class ExtractOIIOTranscodeModel(BaseSettingsModel):
enabled: bool = Field(True)
profiles: list[ExtractOIIOTranscodeProfileModel] = Field(
enabled: bool = SettingsField(True)
profiles: list[ExtractOIIOTranscodeProfileModel] = SettingsField(
default_factory=list, title="Profiles"
)
# --- [START] Extract Review ---
class ExtractReviewFFmpegModel(BaseSettingsModel):
video_filters: list[str] = Field(
video_filters: list[str] = SettingsField(
default_factory=list,
title="Video filters"
)
audio_filters: list[str] = Field(
audio_filters: list[str] = SettingsField(
default_factory=list,
title="Audio filters"
)
input: list[str] = Field(
input: list[str] = SettingsField(
default_factory=list,
title="Input arguments"
)
output: list[str] = Field(
output: list[str] = SettingsField(
default_factory=list,
title="Output arguments"
)
@ -316,11 +319,13 @@ def extract_review_filter_enum():
class ExtractReviewFilterModel(BaseSettingsModel):
families: list[str] = Field(default_factory=list, title="Families")
product_names: list[str] = Field(
families: list[str] = SettingsField(default_factory=list, title="Families")
product_names: list[str] = SettingsField(
default_factory=list, title="Product names")
custom_tags: list[str] = Field(default_factory=list, title="Custom Tags")
single_frame_filter: str = Field(
custom_tags: list[str] = SettingsField(
default_factory=list, title="Custom Tags"
)
single_frame_filter: str = SettingsField(
"everytime",
description=(
"Use output <b>always</b> / only if input <b>is 1 frame</b>"
@ -331,24 +336,24 @@ class ExtractReviewFilterModel(BaseSettingsModel):
class ExtractReviewLetterBox(BaseSettingsModel):
enabled: bool = Field(True)
ratio: float = Field(
enabled: bool = SettingsField(True)
ratio: float = SettingsField(
0.0,
title="Ratio",
ge=0.0,
le=10000.0
)
fill_color: ColorRGBA_uint8 = Field(
fill_color: ColorRGBA_uint8 = SettingsField(
(0, 0, 0, 0.0),
title="Fill Color"
)
line_thickness: int = Field(
line_thickness: int = SettingsField(
0,
title="Line Thickness",
ge=0,
le=1000
)
line_color: ColorRGBA_uint8 = Field(
line_color: ColorRGBA_uint8 = SettingsField(
(0, 0, 0, 0.0),
title="Line Color"
)
@ -356,29 +361,29 @@ class ExtractReviewLetterBox(BaseSettingsModel):
class ExtractReviewOutputDefModel(BaseSettingsModel):
_layout = "expanded"
name: str = Field("", title="Name")
ext: str = Field("", title="Output extension")
name: str = SettingsField("", title="Name")
ext: str = SettingsField("", title="Output extension")
# TODO use some different source of tags
tags: list[str] = Field(default_factory=list, title="Tags")
burnins: list[str] = Field(
tags: list[str] = SettingsField(default_factory=list, title="Tags")
burnins: list[str] = SettingsField(
default_factory=list, title="Link to a burnin by name"
)
ffmpeg_args: ExtractReviewFFmpegModel = Field(
ffmpeg_args: ExtractReviewFFmpegModel = SettingsField(
default_factory=ExtractReviewFFmpegModel,
title="FFmpeg arguments"
)
filter: ExtractReviewFilterModel = Field(
filter: ExtractReviewFilterModel = SettingsField(
default_factory=ExtractReviewFilterModel,
title="Additional output filtering"
)
overscan_crop: str = Field(
overscan_crop: str = SettingsField(
"",
title="Overscan crop",
description=(
"Crop input overscan. See the documentation for more information."
)
)
overscan_color: ColorRGBA_uint8 = Field(
overscan_color: ColorRGBA_uint8 = SettingsField(
(0, 0, 0, 0.0),
title="Overscan color",
description=(
@ -386,7 +391,7 @@ class ExtractReviewOutputDefModel(BaseSettingsModel):
" same as output aspect ratio."
)
)
width: int = Field(
width: int = SettingsField(
0,
ge=0,
le=100000,
@ -396,13 +401,13 @@ class ExtractReviewOutputDefModel(BaseSettingsModel):
" value than 0 else source resolution is used."
)
)
height: int = Field(
height: int = SettingsField(
0,
title="Output height",
ge=0,
le=100000,
)
scale_pixel_aspect: bool = Field(
scale_pixel_aspect: bool = SettingsField(
True,
title="Scale pixel aspect",
description=(
@ -410,7 +415,7 @@ class ExtractReviewOutputDefModel(BaseSettingsModel):
" Usefull for anamorph reviews."
)
)
bg_color: ColorRGBA_uint8 = Field(
bg_color: ColorRGBA_uint8 = SettingsField(
(0, 0, 0, 0.0),
description=(
"Background color is used only when input have transparency"
@ -418,7 +423,7 @@ class ExtractReviewOutputDefModel(BaseSettingsModel):
),
title="Background color",
)
letter_box: ExtractReviewLetterBox = Field(
letter_box: ExtractReviewLetterBox = SettingsField(
default_factory=ExtractReviewLetterBox,
title="Letter Box"
)
@ -431,14 +436,14 @@ class ExtractReviewOutputDefModel(BaseSettingsModel):
class ExtractReviewProfileModel(BaseSettingsModel):
_layout = "expanded"
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list, title="Product types"
)
# TODO use hosts enum
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list, title="Host names"
)
outputs: list[ExtractReviewOutputDefModel] = Field(
outputs: list[ExtractReviewOutputDefModel] = SettingsField(
default_factory=list, title="Output Definitions"
)
@ -450,8 +455,8 @@ class ExtractReviewProfileModel(BaseSettingsModel):
class ExtractReviewModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
profiles: list[ExtractReviewProfileModel] = Field(
enabled: bool = SettingsField(True)
profiles: list[ExtractReviewProfileModel] = SettingsField(
default_factory=list,
title="Profiles"
)
@ -460,30 +465,30 @@ class ExtractReviewModel(BaseSettingsModel):
# --- [Start] Extract Burnin ---
class ExtractBurninOptionsModel(BaseSettingsModel):
font_size: int = Field(0, ge=0, title="Font size")
font_color: ColorRGBA_uint8 = Field(
font_size: int = SettingsField(0, ge=0, title="Font size")
font_color: ColorRGBA_uint8 = SettingsField(
(255, 255, 255, 1.0),
title="Font color"
)
bg_color: ColorRGBA_uint8 = Field(
bg_color: ColorRGBA_uint8 = SettingsField(
(0, 0, 0, 1.0),
title="Background color"
)
x_offset: int = Field(0, title="X Offset")
y_offset: int = Field(0, title="Y Offset")
bg_padding: int = Field(0, title="Padding around text")
font_filepath: MultiplatformPathModel = Field(
x_offset: int = SettingsField(0, title="X Offset")
y_offset: int = SettingsField(0, title="Y Offset")
bg_padding: int = SettingsField(0, title="Padding around text")
font_filepath: MultiplatformPathModel = SettingsField(
default_factory=MultiplatformPathModel,
title="Font file path"
)
class ExtractBurninDefFilter(BaseSettingsModel):
families: list[str] = Field(
families: list[str] = SettingsField(
default_factory=list,
title="Families"
)
tags: list[str] = Field(
tags: list[str] = SettingsField(
default_factory=list,
title="Tags"
)
@ -492,14 +497,14 @@ class ExtractBurninDefFilter(BaseSettingsModel):
class ExtractBurninDef(BaseSettingsModel):
_isGroup = True
_layout = "expanded"
name: str = Field("")
TOP_LEFT: str = Field("", topic="Top Left")
TOP_CENTERED: str = Field("", topic="Top Centered")
TOP_RIGHT: str = Field("", topic="Top Right")
BOTTOM_LEFT: str = Field("", topic="Bottom Left")
BOTTOM_CENTERED: str = Field("", topic="Bottom Centered")
BOTTOM_RIGHT: str = Field("", topic="Bottom Right")
filter: ExtractBurninDefFilter = Field(
name: str = SettingsField("")
TOP_LEFT: str = SettingsField("", topic="Top Left")
TOP_CENTERED: str = SettingsField("", topic="Top Centered")
TOP_RIGHT: str = SettingsField("", topic="Top Right")
BOTTOM_LEFT: str = SettingsField("", topic="Bottom Left")
BOTTOM_CENTERED: str = SettingsField("", topic="Bottom Centered")
BOTTOM_RIGHT: str = SettingsField("", topic="Bottom Right")
filter: ExtractBurninDefFilter = SettingsField(
default_factory=ExtractBurninDefFilter,
title="Additional filtering"
)
@ -512,28 +517,28 @@ class ExtractBurninDef(BaseSettingsModel):
class ExtractBurninProfile(BaseSettingsModel):
_layout = "expanded"
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Produt types"
)
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Host names"
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
product_names: list[str] = Field(
product_names: list[str] = SettingsField(
default_factory=list,
title="Product names"
)
burnins: list[ExtractBurninDef] = Field(
burnins: list[ExtractBurninDef] = SettingsField(
default_factory=list,
title="Burnins"
)
@ -547,12 +552,12 @@ class ExtractBurninProfile(BaseSettingsModel):
class ExtractBurninModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
options: ExtractBurninOptionsModel = Field(
enabled: bool = SettingsField(True)
options: ExtractBurninOptionsModel = SettingsField(
default_factory=ExtractBurninOptionsModel,
title="Burnin formatting options"
)
profiles: list[ExtractBurninProfile] = Field(
profiles: list[ExtractBurninProfile] = SettingsField(
default_factory=list,
title="Profiles"
)
@ -561,24 +566,24 @@ class ExtractBurninModel(BaseSettingsModel):
class PreIntegrateThumbnailsProfile(BaseSettingsModel):
_isGroup = True
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types",
)
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Hosts",
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
product_names: list[str] = Field(
product_names: list[str] = SettingsField(
default_factory=list,
title="Product names",
)
integrate_thumbnail: bool = Field(True)
integrate_thumbnail: bool = SettingsField(True)
class PreIntegrateThumbnailsModel(BaseSettingsModel):
@ -589,26 +594,26 @@ class PreIntegrateThumbnailsModel(BaseSettingsModel):
"""
_isGroup = True
enabled: bool = Field(True)
integrate_profiles: list[PreIntegrateThumbnailsProfile] = Field(
enabled: bool = SettingsField(True)
integrate_profiles: list[PreIntegrateThumbnailsProfile] = SettingsField(
default_factory=list,
title="Integrate profiles"
)
class IntegrateProductGroupProfile(BaseSettingsModel):
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(default_factory=list, title="Task names")
template: str = Field("", title="Template")
tasks: list[str] = SettingsField(default_factory=list, title="Task names")
template: str = SettingsField("", title="Template")
class IntegrateProductGroupModel(BaseSettingsModel):
@ -622,163 +627,169 @@ class IntegrateProductGroupModel(BaseSettingsModel):
"""
_isGroup = True
product_grouping_profiles: list[IntegrateProductGroupProfile] = Field(
default_factory=list,
title="Product group profiles"
product_grouping_profiles: list[IntegrateProductGroupProfile] = (
SettingsField(
default_factory=list,
title="Product group profiles"
)
)
class IntegrateANProductGroupProfileModel(BaseSettingsModel):
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Hosts"
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(
tasks: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
template: str = Field("", title="Template")
template: str = SettingsField("", title="Template")
class IntegrateANTemplateNameProfileModel(BaseSettingsModel):
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Hosts"
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(
tasks: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
template_name: str = Field("", title="Template name")
template_name: str = SettingsField("", title="Template name")
class IntegrateHeroTemplateNameProfileModel(BaseSettingsModel):
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
hosts: list[str] = Field(
hosts: list[str] = SettingsField(
default_factory=list,
title="Hosts"
)
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
template_name: str = Field("", title="Template name")
template_name: str = SettingsField("", title="Template name")
class IntegrateHeroVersionModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
families: list[str] = Field(default_factory=list, title="Families")
enabled: bool = SettingsField(True)
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
families: list[str] = SettingsField(default_factory=list, title="Families")
class CleanUpModel(BaseSettingsModel):
_isGroup = True
paterns: list[str] = Field(
paterns: list[str] = SettingsField(
default_factory=list,
title="Patterns (regex)"
)
remove_temp_renders: bool = Field(False, title="Remove Temp renders")
remove_temp_renders: bool = SettingsField(
False, title="Remove Temp renders"
)
class CleanUpFarmModel(BaseSettingsModel):
_isGroup = True
enabled: bool = Field(True)
enabled: bool = SettingsField(True)
class PublishPuginsModel(BaseSettingsModel):
CollectAnatomyInstanceData: CollectAnatomyInstanceDataModel = Field(
default_factory=CollectAnatomyInstanceDataModel,
title="Collect Anatomy Instance Data"
CollectAnatomyInstanceData: CollectAnatomyInstanceDataModel = (
SettingsField(
default_factory=CollectAnatomyInstanceDataModel,
title="Collect Anatomy Instance Data"
)
)
CollectAudio: CollectAudioModel = Field(
CollectAudio: CollectAudioModel = SettingsField(
default_factory=CollectAudioModel,
title="Collect Audio"
)
CollectSceneVersion: CollectSceneVersionModel = Field(
CollectSceneVersion: CollectSceneVersionModel = SettingsField(
default_factory=CollectSceneVersionModel,
title="Collect Version from Workfile"
)
collect_comment_per_instance: CollectCommentPIModel = Field(
collect_comment_per_instance: CollectCommentPIModel = SettingsField(
default_factory=CollectCommentPIModel,
title="Collect comment per instance",
)
CollectFramesFixDef: CollectFramesFixDefModel = Field(
CollectFramesFixDef: CollectFramesFixDefModel = SettingsField(
default_factory=CollectFramesFixDefModel,
title="Collect Frames to Fix",
)
ValidateEditorialAssetName: ValidateBaseModel = Field(
ValidateEditorialAssetName: ValidateBaseModel = SettingsField(
default_factory=ValidateBaseModel,
title="Validate Editorial Asset Name"
)
ValidateVersion: ValidateBaseModel = Field(
ValidateVersion: ValidateBaseModel = SettingsField(
default_factory=ValidateBaseModel,
title="Validate Version"
)
ValidateIntent: ValidateIntentModel = Field(
ValidateIntent: ValidateIntentModel = SettingsField(
default_factory=ValidateIntentModel,
title="Validate Intent"
)
ExtractThumbnail: ExtractThumbnailModel = Field(
ExtractThumbnail: ExtractThumbnailModel = SettingsField(
default_factory=ExtractThumbnailModel,
title="Extract Thumbnail"
)
ExtractOIIOTranscode: ExtractOIIOTranscodeModel = Field(
ExtractOIIOTranscode: ExtractOIIOTranscodeModel = SettingsField(
default_factory=ExtractOIIOTranscodeModel,
title="Extract OIIO Transcode"
)
ExtractReview: ExtractReviewModel = Field(
ExtractReview: ExtractReviewModel = SettingsField(
default_factory=ExtractReviewModel,
title="Extract Review"
)
ExtractBurnin: ExtractBurninModel = Field(
ExtractBurnin: ExtractBurninModel = SettingsField(
default_factory=ExtractBurninModel,
title="Extract Burnin"
)
PreIntegrateThumbnails: PreIntegrateThumbnailsModel = Field(
PreIntegrateThumbnails: PreIntegrateThumbnailsModel = SettingsField(
default_factory=PreIntegrateThumbnailsModel,
title="Override Integrate Thumbnail Representations"
)
IntegrateProductGroup: IntegrateProductGroupModel = Field(
IntegrateProductGroup: IntegrateProductGroupModel = SettingsField(
default_factory=IntegrateProductGroupModel,
title="Integrate Product Group"
)
IntegrateHeroVersion: IntegrateHeroVersionModel = Field(
IntegrateHeroVersion: IntegrateHeroVersionModel = SettingsField(
default_factory=IntegrateHeroVersionModel,
title="Integrate Hero Version"
)
CleanUp: CleanUpModel = Field(
CleanUp: CleanUpModel = SettingsField(
default_factory=CleanUpModel,
title="Clean Up"
)
CleanUpFarm: CleanUpFarmModel = Field(
CleanUpFarm: CleanUpFarmModel = SettingsField(
default_factory=CleanUpFarmModel,
title="Clean Up Farm"
)

View file

@ -1,6 +1,7 @@
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
normalize_name,
ensure_unique_names,
task_types_enum,
@ -9,8 +10,10 @@ from ayon_server.settings import (
class ProductTypeSmartSelectModel(BaseSettingsModel):
_layout = "expanded"
name: str = Field("", title="Product type")
task_names: list[str] = Field(default_factory=list, title="Task names")
name: str = SettingsField("", title="Product type")
task_names: list[str] = SettingsField(
default_factory=list, title="Task names"
)
@validator("name")
def normalize_value(cls, value):
@ -19,26 +22,28 @@ class ProductTypeSmartSelectModel(BaseSettingsModel):
class ProductNameProfile(BaseSettingsModel):
_layout = "expanded"
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list, title="Product types"
)
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(default_factory=list, title="Task names")
template: str = Field("", title="Template")
tasks: list[str] = SettingsField(default_factory=list, title="Task names")
template: str = SettingsField("", title="Template")
class CreatorToolModel(BaseSettingsModel):
# TODO this was dynamic dictionary '{name: task_names}'
product_types_smart_select: list[ProductTypeSmartSelectModel] = Field(
default_factory=list,
title="Create Smart Select"
product_types_smart_select: list[ProductTypeSmartSelectModel] = (
SettingsField(
default_factory=list,
title="Create Smart Select"
)
)
product_name_profiles: list[ProductNameProfile] = Field(
product_name_profiles: list[ProductNameProfile] = SettingsField(
default_factory=list,
title="Product name profiles"
)
@ -51,29 +56,29 @@ class CreatorToolModel(BaseSettingsModel):
class WorkfileTemplateProfile(BaseSettingsModel):
_layout = "expanded"
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
# TODO this should use hosts enum
hosts: list[str] = Field(default_factory=list, title="Hosts")
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
# TODO this was using project anatomy template name
workfile_template: str = Field("", title="Workfile template")
workfile_template: str = SettingsField("", title="Workfile template")
class LastWorkfileOnStartupProfile(BaseSettingsModel):
_layout = "expanded"
# TODO this should use hosts enum
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(default_factory=list, title="Task names")
enabled: bool = Field(True, title="Enabled")
use_last_published_workfile: bool = Field(
tasks: list[str] = SettingsField(default_factory=list, title="Task names")
enabled: bool = SettingsField(True, title="Enabled")
use_last_published_workfile: bool = SettingsField(
True, title="Use last published workfile"
)
@ -81,54 +86,60 @@ class LastWorkfileOnStartupProfile(BaseSettingsModel):
class WorkfilesToolOnStartupProfile(BaseSettingsModel):
_layout = "expanded"
# TODO this should use hosts enum
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
tasks: list[str] = Field(default_factory=list, title="Task names")
enabled: bool = Field(True, title="Enabled")
tasks: list[str] = SettingsField(default_factory=list, title="Task names")
enabled: bool = SettingsField(True, title="Enabled")
class ExtraWorkFoldersProfile(BaseSettingsModel):
_layout = "expanded"
# TODO this should use hosts enum
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(default_factory=list, title="Task names")
folders: list[str] = Field(default_factory=list, title="Folders")
task_names: list[str] = SettingsField(
default_factory=list, title="Task names"
)
folders: list[str] = SettingsField(default_factory=list, title="Folders")
class WorkfilesLockProfile(BaseSettingsModel):
_layout = "expanded"
# TODO this should use hosts enum
host_names: list[str] = Field(default_factory=list, title="Hosts")
enabled: bool = Field(True, title="Enabled")
host_names: list[str] = SettingsField(default_factory=list, title="Hosts")
enabled: bool = SettingsField(True, title="Enabled")
class WorkfilesToolModel(BaseSettingsModel):
workfile_template_profiles: list[WorkfileTemplateProfile] = Field(
workfile_template_profiles: list[WorkfileTemplateProfile] = SettingsField(
default_factory=list,
title="Workfile template profiles"
)
last_workfile_on_startup: list[LastWorkfileOnStartupProfile] = Field(
default_factory=list,
title="Open last workfile on launch"
last_workfile_on_startup: list[LastWorkfileOnStartupProfile] = (
SettingsField(
default_factory=list,
title="Open last workfile on launch"
)
)
open_workfile_tool_on_startup: list[WorkfilesToolOnStartupProfile] = Field(
default_factory=list,
title="Open workfile tool on launch"
open_workfile_tool_on_startup: list[WorkfilesToolOnStartupProfile] = (
SettingsField(
default_factory=list,
title="Open workfile tool on launch"
)
)
extra_folders: list[ExtraWorkFoldersProfile] = Field(
extra_folders: list[ExtraWorkFoldersProfile] = SettingsField(
default_factory=list,
title="Extra work folders"
)
workfile_lock_profiles: list[WorkfilesLockProfile] = Field(
workfile_lock_profiles: list[WorkfilesLockProfile] = SettingsField(
default_factory=list,
title="Workfile lock profiles"
)
@ -175,95 +186,100 @@ def _product_types_enum():
class LoaderProductTypeFilterProfile(BaseSettingsModel):
_layout = "expanded"
# TODO this should use hosts enum
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
is_include: bool = Field(True, title="Exclude / Include")
filter_product_types: list[str] = Field(
is_include: bool = SettingsField(True, title="Exclude / Include")
filter_product_types: list[str] = SettingsField(
default_factory=list,
enum_resolver=_product_types_enum
)
class LoaderToolModel(BaseSettingsModel):
product_type_filter_profiles: list[LoaderProductTypeFilterProfile] = Field(
default_factory=list,
title="Product type filtering"
product_type_filter_profiles: list[LoaderProductTypeFilterProfile] = (
SettingsField(default_factory=list, title="Product type filtering")
)
class PublishTemplateNameProfile(BaseSettingsModel):
_layout = "expanded"
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
# TODO this should use hosts enum
hosts: list[str] = Field(default_factory=list, title="Hosts")
task_types: list[str] = Field(
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(default_factory=list, title="Task names")
template_name: str = Field("", title="Template name")
task_names: list[str] = SettingsField(
default_factory=list, title="Task names"
)
template_name: str = SettingsField("", title="Template name")
class CustomStagingDirProfileModel(BaseSettingsModel):
active: bool = Field(True, title="Is active")
hosts: list[str] = Field(default_factory=list, title="Host names")
task_types: list[str] = Field(
active: bool = SettingsField(True, title="Is active")
hosts: list[str] = SettingsField(default_factory=list, title="Host names")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list, title="Task names"
)
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list, title="Product types"
)
product_names: list[str] = Field(
product_names: list[str] = SettingsField(
default_factory=list, title="Product names"
)
custom_staging_dir_persistent: bool = Field(
custom_staging_dir_persistent: bool = SettingsField(
False, title="Custom Staging Folder Persistent"
)
template_name: str = Field("", title="Template Name")
template_name: str = SettingsField("", title="Template Name")
class PublishToolModel(BaseSettingsModel):
template_name_profiles: list[PublishTemplateNameProfile] = Field(
template_name_profiles: list[PublishTemplateNameProfile] = SettingsField(
default_factory=list,
title="Template name profiles"
)
hero_template_name_profiles: list[PublishTemplateNameProfile] = Field(
default_factory=list,
title="Hero template name profiles"
hero_template_name_profiles: list[PublishTemplateNameProfile] = (
SettingsField(
default_factory=list,
title="Hero template name profiles"
)
)
custom_staging_dir_profiles: list[CustomStagingDirProfileModel] = Field(
default_factory=list,
title="Custom Staging Dir Profiles"
custom_staging_dir_profiles: list[CustomStagingDirProfileModel] = (
SettingsField(
default_factory=list,
title="Custom Staging Dir Profiles"
)
)
class GlobalToolsModel(BaseSettingsModel):
creator: CreatorToolModel = Field(
creator: CreatorToolModel = SettingsField(
default_factory=CreatorToolModel,
title="Creator"
)
Workfiles: WorkfilesToolModel = Field(
Workfiles: WorkfilesToolModel = SettingsField(
default_factory=WorkfilesToolModel,
title="Workfiles"
)
loader: LoaderToolModel = Field(
loader: LoaderToolModel = SettingsField(
default_factory=LoaderToolModel,
title="Loader"
)
publish: PublishToolModel = Field(
publish: PublishToolModel = SettingsField(
default_factory=PublishToolModel,
title="Publish"
)

View file

@ -1,6 +1,10 @@
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, ensure_unique_names
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
)
from .publish_plugins import (
PublishPluginsModel,
@ -10,8 +14,8 @@ from .publish_plugins import (
class ServerListSubmodel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: str = Field(title="Value")
name: str = SettingsField(title="Name")
value: str = SettingsField(title="Value")
async def defined_deadline_ws_name_enum_resolver(
@ -33,18 +37,18 @@ async def defined_deadline_ws_name_enum_resolver(
class DeadlineSettings(BaseSettingsModel):
deadline_urls: list[ServerListSubmodel] = Field(
deadline_urls: list[ServerListSubmodel] = SettingsField(
default_factory=list,
title="System Deadline Webservice URLs",
scope=["studio"],
)
deadline_server: str = Field(
deadline_server: str = SettingsField(
title="Project deadline server",
section="---",
scope=["project"],
enum_resolver=defined_deadline_ws_name_enum_resolver
)
publish: PublishPluginsModel = Field(
publish: PublishPluginsModel = SettingsField(
default_factory=PublishPluginsModel,
title="Publish Plugins",
)

View file

@ -1,26 +1,30 @@
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, ensure_unique_names
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
)
class CollectDeadlinePoolsModel(BaseSettingsModel):
"""Settings Deadline default pools."""
primary_pool: str = Field(title="Primary Pool")
primary_pool: str = SettingsField(title="Primary Pool")
secondary_pool: str = Field(title="Secondary Pool")
secondary_pool: str = SettingsField(title="Secondary Pool")
class ValidateExpectedFilesModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
active: bool = Field(True, title="Active")
allow_user_override: bool = Field(
enabled: bool = SettingsField(True, title="Enabled")
active: bool = SettingsField(True, title="Active")
allow_user_override: bool = SettingsField(
True, title="Allow user change frame range"
)
families: list[str] = Field(
families: list[str] = SettingsField(
default_factory=list, title="Trigger on families"
)
targets: list[str] = Field(
targets: list[str] = SettingsField(
default_factory=list, title="Trigger for plugins"
)
@ -45,74 +49,76 @@ def tile_assembler_enum():
class ScenePatchesSubmodel(BaseSettingsModel):
_layout = "expanded"
name: str = Field(title="Patch name")
regex: str = Field(title="Patch regex")
line: str = Field(title="Patch line")
name: str = SettingsField(title="Patch name")
regex: str = SettingsField(title="Patch regex")
line: str = SettingsField(title="Patch line")
class MayaSubmitDeadlineModel(BaseSettingsModel):
"""Maya deadline submitter settings."""
enabled: bool = Field(title="Enabled")
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
use_published: bool = Field(title="Use Published scene")
import_reference: bool = Field(title="Use Scene with Imported Reference")
asset_dependencies: bool = Field(title="Use Asset dependencies")
priority: int = Field(title="Priority")
tile_priority: int = Field(title="Tile Priority")
group: str = Field(title="Group")
limit: list[str] = Field(
enabled: bool = SettingsField(title="Enabled")
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
use_published: bool = SettingsField(title="Use Published scene")
import_reference: bool = SettingsField(
title="Use Scene with Imported Reference"
)
asset_dependencies: bool = SettingsField(title="Use Asset dependencies")
priority: int = SettingsField(title="Priority")
tile_priority: int = SettingsField(title="Tile Priority")
group: str = SettingsField(title="Group")
limit: list[str] = SettingsField(
default_factory=list,
title="Limit Groups"
)
tile_assembler_plugin: str = Field(
tile_assembler_plugin: str = SettingsField(
title="Tile Assembler Plugin",
enum_resolver=tile_assembler_enum,
)
jobInfo: str = Field(
jobInfo: str = SettingsField(
title="Additional JobInfo data",
widget="textarea",
)
pluginInfo: str = Field(
pluginInfo: str = SettingsField(
title="Additional PluginInfo data",
widget="textarea",
)
scene_patches: list[ScenePatchesSubmodel] = Field(
scene_patches: list[ScenePatchesSubmodel] = SettingsField(
default_factory=list,
title="Scene patches",
)
strict_error_checking: bool = Field(
strict_error_checking: bool = SettingsField(
title="Disable Strict Error Check profiles"
)
@validator("limit", "scene_patches")
@validator("scene_patches")
def validate_unique_names(cls, value):
ensure_unique_names(value)
return value
class MaxSubmitDeadlineModel(BaseSettingsModel):
enabled: bool = Field(True)
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
use_published: bool = Field(title="Use Published scene")
priority: int = Field(title="Priority")
chunk_size: int = Field(title="Frame per Task")
group: str = Field("", title="Group Name")
enabled: bool = SettingsField(True)
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
use_published: bool = SettingsField(title="Use Published scene")
priority: int = SettingsField(title="Priority")
chunk_size: int = SettingsField(title="Frame per Task")
group: str = SettingsField("", title="Group Name")
class EnvSearchReplaceSubmodel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: str = Field(title="Value")
name: str = SettingsField(title="Name")
value: str = SettingsField(title="Value")
class LimitGroupsSubmodel(BaseSettingsModel):
_layout = "expanded"
name: str = Field(title="Name")
value: list[str] = Field(
name: str = SettingsField(title="Name")
value: list[str] = SettingsField(
default_factory=list,
title="Limit Groups"
)
@ -137,14 +143,16 @@ def fusion_deadline_plugin_enum():
class FusionSubmitDeadlineModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
priority: int = Field(50, title="Priority")
chunk_size: int = Field(10, title="Frame per Task")
concurrent_tasks: int = Field(1, title="Number of concurrent tasks")
group: str = Field("", title="Group Name")
plugin: str = Field("Fusion",
enabled: bool = SettingsField(True, title="Enabled")
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
priority: int = SettingsField(50, title="Priority")
chunk_size: int = SettingsField(10, title="Frame per Task")
concurrent_tasks: int = SettingsField(
1, title="Number of concurrent tasks"
)
group: str = SettingsField("", title="Group Name")
plugin: str = SettingsField("Fusion",
enum_resolver=fusion_deadline_plugin_enum,
title="Deadline Plugin")
@ -152,32 +160,39 @@ class FusionSubmitDeadlineModel(BaseSettingsModel):
class NukeSubmitDeadlineModel(BaseSettingsModel):
"""Nuke deadline submitter settings."""
enabled: bool = Field(title="Enabled")
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
priority: int = Field(title="Priority")
chunk_size: int = Field(title="Chunk Size")
concurrent_tasks: int = Field(title="Number of concurrent tasks")
group: str = Field(title="Group")
department: str = Field(title="Department")
use_gpu: bool = Field(title="Use GPU")
enabled: bool = SettingsField(title="Enabled")
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
priority: int = SettingsField(title="Priority")
chunk_size: int = SettingsField(title="Chunk Size")
concurrent_tasks: int = SettingsField(title="Number of concurrent tasks")
group: str = SettingsField(title="Group")
department: str = SettingsField(title="Department")
use_gpu: bool = SettingsField(title="Use GPU")
workfile_dependency: bool = SettingsField(title="Workfile Dependency")
use_published_workfile: bool = SettingsField(
title="Use Published Workfile"
)
env_allowed_keys: list[str] = Field(
env_allowed_keys: list[str] = SettingsField(
default_factory=list,
title="Allowed environment keys"
)
env_search_replace_values: list[EnvSearchReplaceSubmodel] = Field(
env_search_replace_values: list[EnvSearchReplaceSubmodel] = SettingsField(
default_factory=list,
title="Search & replace in environment values",
)
limit_groups: list[LimitGroupsSubmodel] = Field(
limit_groups: list[LimitGroupsSubmodel] = SettingsField(
default_factory=list,
title="Limit Groups",
)
@validator("limit_groups", "env_allowed_keys", "env_search_replace_values")
@validator(
"limit_groups",
"env_allowed_keys",
"env_search_replace_values")
def validate_unique_names(cls, value):
ensure_unique_names(value)
return value
@ -186,58 +201,62 @@ class NukeSubmitDeadlineModel(BaseSettingsModel):
class HarmonySubmitDeadlineModel(BaseSettingsModel):
"""Harmony deadline submitter settings."""
enabled: bool = Field(title="Enabled")
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
use_published: bool = Field(title="Use Published scene")
priority: int = Field(title="Priority")
chunk_size: int = Field(title="Chunk Size")
group: str = Field(title="Group")
department: str = Field(title="Department")
enabled: bool = SettingsField(title="Enabled")
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
use_published: bool = SettingsField(title="Use Published scene")
priority: int = SettingsField(title="Priority")
chunk_size: int = SettingsField(title="Chunk Size")
group: str = SettingsField(title="Group")
department: str = SettingsField(title="Department")
class AfterEffectsSubmitDeadlineModel(BaseSettingsModel):
"""After Effects deadline submitter settings."""
enabled: bool = Field(title="Enabled")
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
use_published: bool = Field(title="Use Published scene")
priority: int = Field(title="Priority")
chunk_size: int = Field(title="Chunk Size")
group: str = Field(title="Group")
department: str = Field(title="Department")
multiprocess: bool = Field(title="Optional")
enabled: bool = SettingsField(title="Enabled")
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
use_published: bool = SettingsField(title="Use Published scene")
priority: int = SettingsField(title="Priority")
chunk_size: int = SettingsField(title="Chunk Size")
group: str = SettingsField(title="Group")
department: str = SettingsField(title="Department")
multiprocess: bool = SettingsField(title="Optional")
class CelactionSubmitDeadlineModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
deadline_department: str = Field("", title="Deadline apartment")
deadline_priority: int = Field(50, title="Deadline priority")
deadline_pool: str = Field("", title="Deadline pool")
deadline_pool_secondary: str = Field("", title="Deadline pool (secondary)")
deadline_group: str = Field("", title="Deadline Group")
deadline_chunk_size: int = Field(10, title="Deadline Chunk size")
deadline_job_delay: str = Field(
enabled: bool = SettingsField(True, title="Enabled")
deadline_department: str = SettingsField("", title="Deadline apartment")
deadline_priority: int = SettingsField(50, title="Deadline priority")
deadline_pool: str = SettingsField("", title="Deadline pool")
deadline_pool_secondary: str = SettingsField(
"", title="Deadline pool (secondary)"
)
deadline_group: str = SettingsField("", title="Deadline Group")
deadline_chunk_size: int = SettingsField(10, title="Deadline Chunk size")
deadline_job_delay: str = SettingsField(
"", title="Delay job (timecode dd:hh:mm:ss)"
)
class BlenderSubmitDeadlineModel(BaseSettingsModel):
enabled: bool = Field(True)
optional: bool = Field(title="Optional")
active: bool = Field(title="Active")
use_published: bool = Field(title="Use Published scene")
priority: int = Field(title="Priority")
chunk_size: int = Field(title="Frame per Task")
group: str = Field("", title="Group Name")
job_delay: str = Field("", title="Delay job (timecode dd:hh:mm:ss)")
enabled: bool = SettingsField(True)
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
use_published: bool = SettingsField(title="Use Published scene")
priority: int = SettingsField(title="Priority")
chunk_size: int = SettingsField(title="Frame per Task")
group: str = SettingsField("", title="Group Name")
job_delay: str = SettingsField(
"", title="Delay job (timecode dd:hh:mm:ss)"
)
class AOVFilterSubmodel(BaseSettingsModel):
_layout = "expanded"
name: str = Field(title="Host")
value: list[str] = Field(
name: str = SettingsField(title="Host")
value: list[str] = SettingsField(
default_factory=list,
title="AOV regex"
)
@ -246,29 +265,29 @@ class AOVFilterSubmodel(BaseSettingsModel):
class ProcessCacheJobFarmModel(BaseSettingsModel):
"""Process submitted job on farm."""
enabled: bool = Field(title="Enabled")
deadline_department: str = Field(title="Department")
deadline_pool: str = Field(title="Pool")
deadline_group: str = Field(title="Group")
deadline_chunk_size: int = Field(title="Chunk Size")
deadline_priority: int = Field(title="Priority")
enabled: bool = SettingsField(title="Enabled")
deadline_department: str = SettingsField(title="Department")
deadline_pool: str = SettingsField(title="Pool")
deadline_group: str = SettingsField(title="Group")
deadline_chunk_size: int = SettingsField(title="Chunk Size")
deadline_priority: int = SettingsField(title="Priority")
class ProcessSubmittedJobOnFarmModel(BaseSettingsModel):
"""Process submitted job on farm."""
enabled: bool = Field(title="Enabled")
deadline_department: str = Field(title="Department")
deadline_pool: str = Field(title="Pool")
deadline_group: str = Field(title="Group")
deadline_chunk_size: int = Field(title="Chunk Size")
deadline_priority: int = Field(title="Priority")
publishing_script: str = Field(title="Publishing script path")
skip_integration_repre_list: list[str] = Field(
enabled: bool = SettingsField(title="Enabled")
deadline_department: str = SettingsField(title="Department")
deadline_pool: str = SettingsField(title="Pool")
deadline_group: str = SettingsField(title="Group")
deadline_chunk_size: int = SettingsField(title="Chunk Size")
deadline_priority: int = SettingsField(title="Priority")
publishing_script: str = SettingsField(title="Publishing script path")
skip_integration_repre_list: list[str] = SettingsField(
default_factory=list,
title="Skip integration of representation with ext"
)
aov_filter: list[AOVFilterSubmodel] = Field(
aov_filter: list[AOVFilterSubmodel] = SettingsField(
default_factory=list,
title="Reviewable products filter",
)
@ -280,41 +299,44 @@ class ProcessSubmittedJobOnFarmModel(BaseSettingsModel):
class PublishPluginsModel(BaseSettingsModel):
CollectDeadlinePools: CollectDeadlinePoolsModel = Field(
CollectDeadlinePools: CollectDeadlinePoolsModel = SettingsField(
default_factory=CollectDeadlinePoolsModel,
title="Default Pools")
ValidateExpectedFiles: ValidateExpectedFilesModel = Field(
ValidateExpectedFiles: ValidateExpectedFilesModel = SettingsField(
default_factory=ValidateExpectedFilesModel,
title="Validate Expected Files"
)
MayaSubmitDeadline: MayaSubmitDeadlineModel = Field(
MayaSubmitDeadline: MayaSubmitDeadlineModel = SettingsField(
default_factory=MayaSubmitDeadlineModel,
title="Maya Submit to deadline")
MaxSubmitDeadline: MaxSubmitDeadlineModel = Field(
MaxSubmitDeadline: MaxSubmitDeadlineModel = SettingsField(
default_factory=MaxSubmitDeadlineModel,
title="Max Submit to deadline")
FusionSubmitDeadline: FusionSubmitDeadlineModel = Field(
FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField(
default_factory=FusionSubmitDeadlineModel,
title="Fusion submit to Deadline")
NukeSubmitDeadline: NukeSubmitDeadlineModel = Field(
NukeSubmitDeadline: NukeSubmitDeadlineModel = SettingsField(
default_factory=NukeSubmitDeadlineModel,
title="Nuke Submit to deadline")
HarmonySubmitDeadline: HarmonySubmitDeadlineModel = Field(
HarmonySubmitDeadline: HarmonySubmitDeadlineModel = SettingsField(
default_factory=HarmonySubmitDeadlineModel,
title="Harmony Submit to deadline")
AfterEffectsSubmitDeadline: AfterEffectsSubmitDeadlineModel = Field(
default_factory=AfterEffectsSubmitDeadlineModel,
title="After Effects to deadline")
CelactionSubmitDeadline: CelactionSubmitDeadlineModel = Field(
AfterEffectsSubmitDeadline: AfterEffectsSubmitDeadlineModel = (
SettingsField(
default_factory=AfterEffectsSubmitDeadlineModel,
title="After Effects to deadline"
)
)
CelactionSubmitDeadline: CelactionSubmitDeadlineModel = SettingsField(
default_factory=CelactionSubmitDeadlineModel,
title="Celaction Submit Deadline")
BlenderSubmitDeadline: BlenderSubmitDeadlineModel = Field(
BlenderSubmitDeadline: BlenderSubmitDeadlineModel = SettingsField(
default_factory=BlenderSubmitDeadlineModel,
title="Blender Submit Deadline")
ProcessSubmittedCacheJobOnFarm: ProcessCacheJobFarmModel = Field(
ProcessSubmittedCacheJobOnFarm: ProcessCacheJobFarmModel = SettingsField(
default_factory=ProcessCacheJobFarmModel,
title="Process submitted cache Job on farm.")
ProcessSubmittedJobOnFarm: ProcessSubmittedJobOnFarmModel = Field(
ProcessSubmittedJobOnFarm: ProcessSubmittedJobOnFarmModel = SettingsField(
default_factory=ProcessSubmittedJobOnFarmModel,
title="Process submitted job on farm.")
@ -382,6 +404,8 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = {
"group": "",
"department": "",
"use_gpu": True,
"workfile_dependency": True,
"use_published_workfile": True,
"env_allowed_keys": [],
"env_search_replace_values": [],
"limit_groups": []

View file

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

View file

@ -1,95 +1,94 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class CreateShotClipModel(BaseSettingsModel):
hierarchy: str = Field(
hierarchy: str = SettingsField(
"shot",
title="Shot parent hierarchy",
section="Shot Hierarchy And Rename Settings"
)
useShotName: bool = Field(
useShotName: bool = SettingsField(
True,
title="Use Shot Name",
)
clipRename: bool = Field(
clipRename: bool = SettingsField(
False,
title="Rename clips",
)
clipName: str = Field(
clipName: str = SettingsField(
"{sequence}{shot}",
title="Clip name template"
)
segmentIndex: bool = Field(
segmentIndex: bool = SettingsField(
True,
title="Accept segment order"
)
countFrom: int = Field(
countFrom: int = SettingsField(
10,
title="Count sequence from"
)
countSteps: int = Field(
countSteps: int = SettingsField(
10,
title="Stepping number"
)
folder: str = Field(
folder: str = SettingsField(
"shots",
title="{folder}",
section="Shot Template Keywords"
)
episode: str = Field(
episode: str = SettingsField(
"ep01",
title="{episode}"
)
sequence: str = Field(
sequence: str = SettingsField(
"a",
title="{sequence}"
)
track: str = Field(
track: str = SettingsField(
"{_track_}",
title="{track}"
)
shot: str = Field(
shot: str = SettingsField(
"####",
title="{shot}"
)
vSyncOn: bool = Field(
vSyncOn: bool = SettingsField(
False,
title="Enable Vertical Sync",
section="Vertical Synchronization Of Attributes"
)
workfileFrameStart: int = Field(
workfileFrameStart: int = SettingsField(
1001,
title="Workfiles Start Frame",
section="Shot Attributes"
)
handleStart: int = Field(
handleStart: int = SettingsField(
10,
title="Handle start (head)"
)
handleEnd: int = Field(
handleEnd: int = SettingsField(
10,
title="Handle end (tail)"
)
includeHandles: bool = Field(
includeHandles: bool = SettingsField(
False,
title="Enable handles including"
)
retimedHandles: bool = Field(
retimedHandles: bool = SettingsField(
True,
title="Enable retimed handles"
)
retimedFramerange: bool = Field(
retimedFramerange: bool = SettingsField(
True,
title="Enable retimed shot frameranges"
)
class CreatePuginsModel(BaseSettingsModel):
CreateShotClip: CreateShotClipModel = Field(
CreateShotClip: CreateShotClipModel = SettingsField(
default_factory=CreateShotClipModel,
title="Create Shot Clip"
)

View file

@ -1,17 +1,21 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel, ensure_unique_names
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -23,24 +27,24 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class ImageIORemappingRulesModel(BaseSettingsModel):
host_native_name: str = Field(
host_native_name: str = SettingsField(
title="Application native colorspace name"
)
ocio_name: str = Field(title="OCIO colorspace name")
ocio_name: str = SettingsField(title="OCIO colorspace name")
class ImageIORemappingModel(BaseSettingsModel):
rules: list[ImageIORemappingRulesModel] = Field(
rules: list[ImageIORemappingRulesModel] = SettingsField(
default_factory=list
)
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
@ -49,30 +53,30 @@ class ImageIOConfigModel(BaseSettingsModel):
class ProfileNamesMappingInputsModel(BaseSettingsModel):
_layout = "expanded"
flameName: str = Field("", title="Flame name")
ocioName: str = Field("", title="OCIO name")
flameName: str = SettingsField("", title="Flame name")
ocioName: str = SettingsField("", title="OCIO name")
class ProfileNamesMappingModel(BaseSettingsModel):
_layout = "expanded"
inputs: list[ProfileNamesMappingInputsModel] = Field(
inputs: list[ProfileNamesMappingInputsModel] = SettingsField(
default_factory=list,
title="Profile names mapping"
)
class ImageIOProjectModel(BaseSettingsModel):
colourPolicy: str = Field(
colourPolicy: str = SettingsField(
"ACES 1.1",
title="Colour Policy (name or path)",
section="Project"
)
frameDepth: str = Field(
frameDepth: str = SettingsField(
"16-bit fp",
title="Image Depth"
)
fieldDominance: str = Field(
fieldDominance: str = SettingsField(
"PROGRESSIVE",
title="Field Dominance"
)
@ -80,18 +84,18 @@ class ImageIOProjectModel(BaseSettingsModel):
class FlameImageIOModel(BaseSettingsModel):
_isGroup = True
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
remapping: ImageIORemappingModel = Field(
remapping: ImageIORemappingModel = SettingsField(
title="Remapping colorspace names",
default_factory=ImageIORemappingModel
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)
@ -99,11 +103,11 @@ class FlameImageIOModel(BaseSettingsModel):
# inconsistency with v3 settings and harder conversion handling
# - it can be moved back but keep in mind that it must be handled in v3
# conversion script too
project: ImageIOProjectModel = Field(
project: ImageIOProjectModel = SettingsField(
default_factory=ImageIOProjectModel,
title="Project"
)
profilesMapping: ProfileNamesMappingModel = Field(
profilesMapping: ProfileNamesMappingModel = SettingsField(
default_factory=ProfileNamesMappingModel,
title="Profile names mapping"
)

View file

@ -1,60 +1,64 @@
from ayon_server.settings import Field, BaseSettingsModel
from ayon_server.settings import SettingsField, BaseSettingsModel
class LoadClipModel(BaseSettingsModel):
enabled: bool = Field(True)
enabled: bool = SettingsField(True)
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
reel_group_name: str = Field(
reel_group_name: str = SettingsField(
"OpenPype_Reels",
title="Reel group name"
)
reel_name: str = Field(
reel_name: str = SettingsField(
"Loaded",
title="Reel name"
)
clip_name_template: str = Field(
clip_name_template: str = SettingsField(
"{folder[name]}_{product[name]}<_{output}>",
title="Clip name template"
)
layer_rename_template: str = Field("", title="Layer name template")
layer_rename_patterns: list[str] = Field(
layer_rename_template: str = SettingsField(
"", title="Layer name template"
)
layer_rename_patterns: list[str] = SettingsField(
default_factory=list,
title="Layer rename patters",
)
class LoadClipBatchModel(BaseSettingsModel):
enabled: bool = Field(True)
product_types: list[str] = Field(
enabled: bool = SettingsField(True)
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
reel_name: str = Field(
reel_name: str = SettingsField(
"OP_LoadedReel",
title="Reel name"
)
clip_name_template: str = Field(
clip_name_template: str = SettingsField(
"{batch}_{folder[name]}_{product[name]}<_{output}>",
title="Clip name template"
)
layer_rename_template: str = Field("", title="Layer name template")
layer_rename_patterns: list[str] = Field(
layer_rename_template: str = SettingsField(
"", title="Layer name template"
)
layer_rename_patterns: list[str] = SettingsField(
default_factory=list,
title="Layer rename patters",
)
class LoaderPluginsModel(BaseSettingsModel):
LoadClip: LoadClipModel = Field(
LoadClip: LoadClipModel = SettingsField(
default_factory=LoadClipModel,
title="Load Clip"
)
LoadClipBatch: LoadClipBatchModel = Field(
LoadClipBatch: LoadClipBatchModel = SettingsField(
default_factory=LoadClipBatchModel,
title="Load as clip to current batch"
)

View file

@ -1,4 +1,4 @@
from ayon_server.settings import Field, BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from .imageio import FlameImageIOModel, DEFAULT_IMAGEIO_SETTINGS
from .create_plugins import CreatePuginsModel, DEFAULT_CREATE_SETTINGS
@ -7,19 +7,19 @@ from .loader_plugins import LoaderPluginsModel, DEFAULT_LOADER_SETTINGS
class FlameSettings(BaseSettingsModel):
imageio: FlameImageIOModel = Field(
imageio: FlameImageIOModel = SettingsField(
default_factory=FlameImageIOModel,
title="Color Management (ImageIO)"
)
create: CreatePuginsModel = Field(
create: CreatePuginsModel = SettingsField(
default_factory=CreatePuginsModel,
title="Create plugins"
)
publish: PublishPuginsModel = Field(
publish: PublishPuginsModel = SettingsField(
default_factory=PublishPuginsModel,
title="Publish plugins"
)
load: LoaderPluginsModel = Field(
load: LoaderPluginsModel = SettingsField(
default_factory=LoaderPluginsModel,
title="Loader plugins"
)

View file

@ -1,10 +1,14 @@
from ayon_server.settings import Field, BaseSettingsModel, task_types_enum
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
task_types_enum,
)
class XMLPresetAttrsFromCommentsModel(BaseSettingsModel):
_layout = "expanded"
name: str = Field("", title="Attribute name")
type: str = Field(
name: str = SettingsField("", title="Attribute name")
type: str = SettingsField(
default_factory=str,
title="Attribute type",
enum_resolver=lambda: ["number", "float", "string"]
@ -13,13 +17,13 @@ class XMLPresetAttrsFromCommentsModel(BaseSettingsModel):
class AddTasksModel(BaseSettingsModel):
_layout = "expanded"
name: str = Field("", title="Task name")
type: str = Field(
name: str = SettingsField("", title="Task name")
type: str = SettingsField(
default_factory=str,
title="Task type",
enum_resolver=task_types_enum
)
create_batch_group: bool = Field(
create_batch_group: bool = SettingsField(
True,
title="Create batch group"
)
@ -28,11 +32,13 @@ class AddTasksModel(BaseSettingsModel):
class CollectTimelineInstancesModel(BaseSettingsModel):
_isGroup = True
xml_preset_attrs_from_comments: list[XMLPresetAttrsFromCommentsModel] = Field(
default_factory=list,
title="XML presets attributes parsable from segment comments"
xml_preset_attrs_from_comments: list[XMLPresetAttrsFromCommentsModel] = (
SettingsField(
default_factory=list,
title="XML presets attributes parsable from segment comments"
)
)
add_tasks: list[AddTasksModel] = Field(
add_tasks: list[AddTasksModel] = SettingsField(
default_factory=list,
title="Add tasks"
)
@ -41,22 +47,22 @@ class CollectTimelineInstancesModel(BaseSettingsModel):
class ExportPresetsMappingModel(BaseSettingsModel):
_layout = "expanded"
name: str = Field(
name: str = SettingsField(
...,
title="Name"
)
active: bool = Field(True, title="Is active")
export_type: str = Field(
active: bool = SettingsField(True, title="Is active")
export_type: str = SettingsField(
"File Sequence",
title="Eport clip type",
enum_resolver=lambda: ["Movie", "File Sequence", "Sequence Publish"]
)
ext: str = Field("exr", title="Output extension")
xml_preset_file: str = Field(
ext: str = SettingsField("exr", title="Output extension")
xml_preset_file: str = SettingsField(
"OpenEXR (16-bit fp DWAA).xml",
title="XML preset file (with ext)"
)
colorspace_out: str = Field(
colorspace_out: str = SettingsField(
"ACES - ACEScg",
title="Output color (imageio)"
)
@ -65,31 +71,31 @@ class ExportPresetsMappingModel(BaseSettingsModel):
# created inconsistency with v3 settings and harder conversion handling
# - it can be moved back but keep in mind that it must be handled in v3
# conversion script too
xml_preset_dir: str = Field(
xml_preset_dir: str = SettingsField(
"",
title="XML preset directory"
)
parsed_comment_attrs: bool = Field(
parsed_comment_attrs: bool = SettingsField(
True,
title="Parsed comment attributes"
)
representation_add_range: bool = Field(
representation_add_range: bool = SettingsField(
True,
title="Add range to representation name"
)
representation_tags: list[str] = Field(
representation_tags: list[str] = SettingsField(
default_factory=list,
title="Representation tags"
)
load_to_batch_group: bool = Field(
load_to_batch_group: bool = SettingsField(
True,
title="Load to batch group reel"
)
batch_group_loader_name: str = Field(
batch_group_loader_name: str = SettingsField(
"LoadClipBatch",
title="Use loader name"
)
filter_path_regex: str = Field(
filter_path_regex: str = SettingsField(
".*",
title="Regex in clip path"
)
@ -98,35 +104,35 @@ class ExportPresetsMappingModel(BaseSettingsModel):
class ExtractProductResourcesModel(BaseSettingsModel):
_isGroup = True
keep_original_representation: bool = Field(
keep_original_representation: bool = SettingsField(
False,
title="Publish clip's original media"
)
export_presets_mapping: list[ExportPresetsMappingModel] = Field(
export_presets_mapping: list[ExportPresetsMappingModel] = SettingsField(
default_factory=list,
title="Export presets mapping"
)
class IntegrateBatchGroupModel(BaseSettingsModel):
enabled: bool = Field(
enabled: bool = SettingsField(
False,
title="Enabled"
)
class PublishPuginsModel(BaseSettingsModel):
CollectTimelineInstances: CollectTimelineInstancesModel = Field(
CollectTimelineInstances: CollectTimelineInstancesModel = SettingsField(
default_factory=CollectTimelineInstancesModel,
title="Collect Timeline Instances"
)
ExtractProductResources: ExtractProductResourcesModel = Field(
ExtractProductResources: ExtractProductResourcesModel = SettingsField(
default_factory=ExtractProductResourcesModel,
title="Extract Product Resources"
)
IntegrateBatchGroup: IntegrateBatchGroupModel = Field(
IntegrateBatchGroup: IntegrateBatchGroupModel = SettingsField(
default_factory=IntegrateBatchGroupModel,
title="IntegrateBatchGroup"
)

View file

@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -35,14 +35,14 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class FusionImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)

View file

@ -1,15 +1,15 @@
from pydantic import Field
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
)
from .imageio import FusionImageIOModel
class CopyFusionSettingsModel(BaseSettingsModel):
copy_path: str = Field("", title="Local Fusion profile directory")
copy_status: bool = Field(title="Copy profile on first launch")
force_sync: bool = Field(title="Resync profile on each launch")
copy_path: str = SettingsField("", title="Local Fusion profile directory")
copy_status: bool = SettingsField(title="Copy profile on first launch")
force_sync: bool = SettingsField(title="Resync profile on each launch")
def _create_saver_instance_attributes_enum():
@ -45,40 +45,40 @@ def _frame_range_options_enum():
class CreateSaverPluginModel(BaseSettingsModel):
_isGroup = True
temp_rendering_path_template: str = Field(
temp_rendering_path_template: str = SettingsField(
"", title="Temporary rendering path template"
)
default_variants: list[str] = Field(
default_variants: list[str] = SettingsField(
default_factory=list,
title="Default variants"
)
instance_attributes: list[str] = Field(
instance_attributes: list[str] = SettingsField(
default_factory=list,
enum_resolver=_create_saver_instance_attributes_enum,
title="Instance attributes"
)
output_formats: list[str] = Field(
output_formats: list[str] = SettingsField(
default_factory=list,
title="Output formats"
)
class HookOptionalModel(BaseSettingsModel):
enabled: bool = Field(
enabled: bool = SettingsField(
True,
title="Enabled"
)
class HooksModel(BaseSettingsModel):
InstallPySideToFusion: HookOptionalModel = Field(
InstallPySideToFusion: HookOptionalModel = SettingsField(
default_factory=HookOptionalModel,
title="Install PySide2"
)
class CreateSaverModel(CreateSaverPluginModel):
default_frame_range_option: str = Field(
default_frame_range_option: str = SettingsField(
default="asset_db",
enum_resolver=_frame_range_options_enum,
title="Default frame range source"
@ -86,17 +86,17 @@ class CreateSaverModel(CreateSaverPluginModel):
class CreateImageSaverModel(CreateSaverPluginModel):
default_frame: int = Field(
default_frame: int = SettingsField(
0,
title="Default rendered frame"
)
class CreatPluginsModel(BaseSettingsModel):
CreateSaver: CreateSaverModel = Field(
CreateSaver: CreateSaverModel = SettingsField(
default_factory=CreateSaverModel,
title="Create Saver",
description="Creator for render product type (eg. sequence)"
)
CreateImageSaver: CreateImageSaverModel = Field(
CreateImageSaver: CreateImageSaverModel = SettingsField(
default_factory=CreateImageSaverModel,
title="Create Image Saver",
description="Creator for image product type (eg. single)"
@ -104,19 +104,19 @@ class CreatPluginsModel(BaseSettingsModel):
class FusionSettings(BaseSettingsModel):
imageio: FusionImageIOModel = Field(
imageio: FusionImageIOModel = SettingsField(
default_factory=FusionImageIOModel,
title="Color Management (ImageIO)"
)
copy_fusion_settings: CopyFusionSettingsModel = Field(
copy_fusion_settings: CopyFusionSettingsModel = SettingsField(
default_factory=CopyFusionSettingsModel,
title="Local Fusion profile settings"
)
hooks: HooksModel = Field(
hooks: HooksModel = SettingsField(
default_factory=HooksModel,
title="Hooks"
)
create: CreatPluginsModel = Field(
create: CreatPluginsModel = SettingsField(
default_factory=CreatPluginsModel,
title="Creator plugins"
)

View file

@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -35,21 +35,21 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class ImageIORemappingRulesModel(BaseSettingsModel):
host_native_name: str = Field(
host_native_name: str = SettingsField(
title="Application native colorspace name"
)
ocio_name: str = Field(title="OCIO colorspace name")
ocio_name: str = SettingsField(title="OCIO colorspace name")
class HarmonyImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)

View file

@ -1,5 +1,4 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from .imageio import HarmonyImageIOModel
from .publish_plugins import HarmonyPublishPlugins
@ -8,11 +7,11 @@ from .publish_plugins import HarmonyPublishPlugins
class HarmonySettings(BaseSettingsModel):
"""Harmony Project Settings."""
imageio: HarmonyImageIOModel = Field(
imageio: HarmonyImageIOModel = SettingsField(
default_factory=HarmonyImageIOModel,
title="OCIO config"
)
publish: HarmonyPublishPlugins = Field(
publish: HarmonyPublishPlugins = SettingsField(
default_factory=HarmonyPublishPlugins,
title="Publish plugins"
)

View file

@ -1,12 +1,10 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class CollectPalettesPlugin(BaseSettingsModel):
"""Set regular expressions to filter triggering on specific task names. '.*' means on all.""" # noqa
allowed_tasks: list[str] = Field(
allowed_tasks: list[str] = SettingsField(
default_factory=list,
title="Allowed tasks"
)
@ -16,16 +14,16 @@ class ValidateAudioPlugin(BaseSettingsModel):
"""Check if scene contains audio track.""" #
_isGroup = True
enabled: bool = True
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
class ValidateContainersPlugin(BaseSettingsModel):
"""Check if loaded container is scene are latest versions."""
_isGroup = True
enabled: bool = True
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
class ValidateSceneSettingsPlugin(BaseSettingsModel):
@ -34,20 +32,20 @@ class ValidateSceneSettingsPlugin(BaseSettingsModel):
or task names."""
_isGroup = True
enabled: bool = True
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
frame_check_filter: list[str] = Field(
frame_check_filter: list[str] = SettingsField(
default_factory=list,
title="Skip Frame check for Assets with name containing"
)
skip_resolution_check: list[str] = Field(
skip_resolution_check: list[str] = SettingsField(
default_factory=list,
title="Skip Resolution Check for Tasks"
)
skip_timelines_check: list[str] = Field(
skip_timelines_check: list[str] = SettingsField(
default_factory=list,
title="Skip Timeline Check for Tasks"
)
@ -55,22 +53,22 @@ class ValidateSceneSettingsPlugin(BaseSettingsModel):
class HarmonyPublishPlugins(BaseSettingsModel):
CollectPalettes: CollectPalettesPlugin = Field(
CollectPalettes: CollectPalettesPlugin = SettingsField(
title="Collect Palettes",
default_factory=CollectPalettesPlugin,
)
ValidateAudio: ValidateAudioPlugin = Field(
ValidateAudio: ValidateAudioPlugin = SettingsField(
title="Validate Audio",
default_factory=ValidateAudioPlugin,
)
ValidateContainers: ValidateContainersPlugin = Field(
ValidateContainers: ValidateContainersPlugin = SettingsField(
title="Validate Containers",
default_factory=ValidateContainersPlugin,
)
ValidateSceneSettings: ValidateSceneSettingsPlugin = Field(
ValidateSceneSettings: ValidateSceneSettingsPlugin = SettingsField(
title="Validate Scene Settings",
default_factory=ValidateSceneSettingsPlugin,
)

View file

@ -1,5 +1,4 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.types import (
ColorRGBA_float,
ColorRGB_uint8
@ -9,16 +8,16 @@ from ayon_server.types import (
class Vector2d(BaseSettingsModel):
_layout = "compact"
x: float = Field(1.0, title="X")
y: float = Field(1.0, title="Y")
x: float = SettingsField(1.0, title="X")
y: float = SettingsField(1.0, title="Y")
class Vector3d(BaseSettingsModel):
_layout = "compact"
x: float = Field(1.0, title="X")
y: float = Field(1.0, title="Y")
z: float = Field(1.0, title="Z")
x: float = SettingsField(1.0, title="X")
y: float = SettingsField(1.0, title="Y")
z: float = SettingsField(1.0, title="Z")
def formatable_knob_type_enum():
@ -34,12 +33,12 @@ def formatable_knob_type_enum():
class Formatable(BaseSettingsModel):
_layout = "compact"
template: str = Field(
template: str = SettingsField(
"",
placeholder="""{{key}} or {{key}};{{key}}""",
title="Template"
)
to_type: str = Field(
to_type: str = SettingsField(
"Text",
title="To Knob type",
enum_resolver=formatable_knob_type_enum,
@ -62,37 +61,37 @@ knob_types_enum = [
class KnobModel(BaseSettingsModel):
_layout = "expanded"
type: str = Field(
type: str = SettingsField(
title="Type",
description="Switch between different knob types",
enum_resolver=lambda: knob_types_enum,
conditionalEnum=True
)
name: str = Field(
name: str = SettingsField(
title="Name",
placeholder="Name"
)
text: str = Field("", title="Value")
color_gui: ColorRGB_uint8 = Field(
text: str = SettingsField("", title="Value")
color_gui: ColorRGB_uint8 = SettingsField(
(0, 0, 255),
title="RGB Uint8",
)
boolean: bool = Field(False, title="Value")
number: int = Field(0, title="Value")
decimal_number: float = Field(0.0, title="Value")
vector_2d: Vector2d = Field(
boolean: bool = SettingsField(False, title="Value")
number: int = SettingsField(0, title="Value")
decimal_number: float = SettingsField(0.0, title="Value")
vector_2d: Vector2d = SettingsField(
default_factory=Vector2d,
title="Value"
)
vector_3d: Vector3d = Field(
vector_3d: Vector3d = SettingsField(
default_factory=Vector3d,
title="Value"
)
color: ColorRGBA_float = Field(
color: ColorRGBA_float = SettingsField(
(0.0, 0.0, 1.0, 1.0),
title="RGBA Float"
)
formatable: Formatable = Field(
formatable: Formatable = SettingsField(
default_factory=Formatable,
title="Value"
)

View file

@ -1,75 +1,74 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class CreateShotClipModels(BaseSettingsModel):
hierarchy: str = Field(
hierarchy: str = SettingsField(
"{folder}/{sequence}",
title="Shot parent hierarchy",
section="Shot Hierarchy And Rename Settings"
)
clipRename: bool = Field(
clipRename: bool = SettingsField(
True,
title="Rename clips"
)
clipName: str = Field(
clipName: str = SettingsField(
"{track}{sequence}{shot}",
title="Clip name template"
)
countFrom: int = Field(
countFrom: int = SettingsField(
10,
title="Count sequence from"
)
countSteps: int = Field(
countSteps: int = SettingsField(
10,
title="Stepping number"
)
folder: str = Field(
folder: str = SettingsField(
"shots",
title="{folder}",
section="Shot Template Keywords"
)
episode: str = Field(
episode: str = SettingsField(
"ep01",
title="{episode}"
)
sequence: str = Field(
sequence: str = SettingsField(
"sq01",
title="{sequence}"
)
track: str = Field(
track: str = SettingsField(
"{_track_}",
title="{track}"
)
shot: str = Field(
shot: str = SettingsField(
"sh###",
title="{shot}"
)
vSyncOn: bool = Field(
vSyncOn: bool = SettingsField(
False,
title="Enable Vertical Sync",
section="Vertical Synchronization Of Attributes"
)
workfileFrameStart: int = Field(
workfileFrameStart: int = SettingsField(
1001,
title="Workfiles Start Frame",
section="Shot Attributes"
)
handleStart: int = Field(
handleStart: int = SettingsField(
10,
title="Handle start (head)"
)
handleEnd: int = Field(
handleEnd: int = SettingsField(
10,
title="Handle end (tail)"
)
class CreatorPluginsSettings(BaseSettingsModel):
CreateShotClip: CreateShotClipModels = Field(
CreateShotClip: CreateShotClipModels = SettingsField(
default_factory=CreateShotClipModels,
title="Create Shot Clip"
)

View file

@ -1,17 +1,23 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel, ensure_unique_names
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
)
class PublishGUIFilterItemModel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: bool = Field(True, title="Active")
name: str = SettingsField(title="Name")
value: bool = SettingsField(True, title="Active")
class PublishGUIFiltersModel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: list[PublishGUIFilterItemModel] = Field(default_factory=list)
name: str = SettingsField(title="Name")
value: list[PublishGUIFilterItemModel] = SettingsField(
default_factory=list
)
@validator("value")
def validate_unique_outputs(cls, value):

View file

@ -1,7 +1,8 @@
from pydantic import Field, validator
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
)
@ -39,34 +40,34 @@ class WorkfileColorspaceSettings(BaseSettingsModel):
thumbnail_name = thumbnailLut
"""
ocioConfigName: str = Field(
ocioConfigName: str = SettingsField(
title="OpenColorIO Config",
description="Switch between OCIO configs",
enum_resolver=ocio_configs_switcher_enum,
conditionalEnum=True
)
workingSpace: str = Field(
workingSpace: str = SettingsField(
title="Working Space"
)
viewerLut: str = Field(
viewerLut: str = SettingsField(
title="Viewer"
)
eightBitLut: str = Field(
eightBitLut: str = SettingsField(
title="8-bit files"
)
sixteenBitLut: str = Field(
sixteenBitLut: str = SettingsField(
title="16-bit files"
)
logLut: str = Field(
logLut: str = SettingsField(
title="Log files"
)
floatLut: str = Field(
floatLut: str = SettingsField(
title="Float files"
)
thumbnailLut: str = Field(
thumbnailLut: str = SettingsField(
title="Thumnails"
)
monitorOutLut: str = Field(
monitorOutLut: str = SettingsField(
title="Monitor"
)
@ -74,38 +75,38 @@ class WorkfileColorspaceSettings(BaseSettingsModel):
class ClipColorspaceRulesItems(BaseSettingsModel):
_layout = "expanded"
regex: str = Field("", title="Regex expression")
colorspace: str = Field("", title="Colorspace")
regex: str = SettingsField("", title="Regex expression")
colorspace: str = SettingsField("", title="Colorspace")
class RegexInputsModel(BaseSettingsModel):
inputs: list[ClipColorspaceRulesItems] = Field(
inputs: list[ClipColorspaceRulesItems] = SettingsField(
default_factory=list,
title="Inputs"
)
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -119,18 +120,18 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class ImageIOSettings(BaseSettingsModel):
"""Hiero color management project settings. """
_isGroup: bool = True
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)
workfile: WorkfileColorspaceSettings = Field(
workfile: WorkfileColorspaceSettings = SettingsField(
default_factory=WorkfileColorspaceSettings,
title="Workfile"
)
@ -140,7 +141,7 @@ class ImageIOSettings(BaseSettingsModel):
- no need for `inputs` middle part. It can stay
directly on `regex_inputs`
"""
regexInputs: RegexInputsModel = Field(
regexInputs: RegexInputsModel = SettingsField(
default_factory=RegexInputsModel,
title="Assign colorspace to clips via rules"
)

View file

@ -1,23 +1,22 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class LoadClipModel(BaseSettingsModel):
enabled: bool = Field(
enabled: bool = SettingsField(
True,
title="Enabled"
)
product_types: list[str] = Field(
product_types: list[str] = SettingsField(
default_factory=list,
title="Product types"
)
clip_name_template: str = Field(
clip_name_template: str = SettingsField(
title="Clip name template"
)
class LoaderPuginsModel(BaseSettingsModel):
LoadClip: LoadClipModel = Field(
LoadClip: LoadClipModel = SettingsField(
default_factory=LoadClipModel,
title="Load Clip"
)

View file

@ -1,6 +1,4 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from .imageio import (
ImageIOSettings,
@ -28,28 +26,28 @@ from .filters import PublishGUIFilterItemModel
class HieroSettings(BaseSettingsModel):
"""Nuke addon settings."""
imageio: ImageIOSettings = Field(
imageio: ImageIOSettings = SettingsField(
default_factory=ImageIOSettings,
title="Color Management (imageio)",
)
create: CreatorPluginsSettings = Field(
create: CreatorPluginsSettings = SettingsField(
default_factory=CreatorPluginsSettings,
title="Creator Plugins",
)
load: LoaderPuginsModel = Field(
load: LoaderPuginsModel = SettingsField(
default_factory=LoaderPuginsModel,
title="Loader plugins"
)
publish: PublishPuginsModel = Field(
publish: PublishPuginsModel = SettingsField(
default_factory=PublishPuginsModel,
title="Publish plugins"
)
scriptsmenu: ScriptsmenuSettings = Field(
scriptsmenu: ScriptsmenuSettings = SettingsField(
default_factory=ScriptsmenuSettings,
title="Scripts Menu Definition",
)
filters: list[PublishGUIFilterItemModel] = Field(
filters: list[PublishGUIFilterItemModel] = SettingsField(
default_factory=list
)

View file

@ -1,35 +1,68 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
ensure_unique_names,
normalize_name,
)
class CollectInstanceVersionModel(BaseSettingsModel):
enabled: bool = Field(
enabled: bool = SettingsField(
True,
title="Enabled"
)
class CollectClipEffectsDefModel(BaseSettingsModel):
_layout = "expanded"
name: str = SettingsField("", title="Name")
effect_classes: list[str] = SettingsField(
default_factory=list, title="Effect Classes"
)
@validator("name")
def validate_name(cls, value):
"""Ensure name does not contain weird characters"""
return normalize_name(value)
class CollectClipEffectsModel(BaseSettingsModel):
effect_categories: list[CollectClipEffectsDefModel] = SettingsField(
default_factory=list, title="Effect Categories"
)
@validator("effect_categories")
def validate_unique_outputs(cls, value):
ensure_unique_names(value)
return value
class ExtractReviewCutUpVideoModel(BaseSettingsModel):
enabled: bool = Field(
enabled: bool = SettingsField(
True,
title="Enabled"
)
tags_addition: list[str] = Field(
tags_addition: list[str] = SettingsField(
default_factory=list,
title="Additional tags"
)
class PublishPuginsModel(BaseSettingsModel):
CollectInstanceVersion: CollectInstanceVersionModel = Field(
CollectInstanceVersion: CollectInstanceVersionModel = SettingsField(
default_factory=CollectInstanceVersionModel,
title="Collect Instance Version"
)
CollectClipEffects: CollectClipEffectsModel = SettingsField(
default_factory=CollectClipEffectsModel,
title="Collect Clip Effects"
)
"""# TODO: enhance settings with host api:
Rename class name and plugin name
to match title (it makes more sense)
"""
ExtractReviewCutUpVideo: ExtractReviewCutUpVideoModel = Field(
ExtractReviewCutUpVideo: ExtractReviewCutUpVideoModel = SettingsField(
default_factory=ExtractReviewCutUpVideoModel,
title="Exctract Review Trim"
)
@ -44,5 +77,8 @@ DEFAULT_PUBLISH_PLUGIN_SETTINGS = {
"tags_addition": [
"review"
]
},
"CollectClipEffectsModel": {
"effect_categories": []
}
}

View file

@ -1,16 +1,15 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class ScriptsmenuSubmodel(BaseSettingsModel):
"""Item Definition"""
_isGroup = True
type: str = Field(title="Type")
command: str = Field(title="Command")
sourcetype: str = Field(title="Source Type")
title: str = Field(title="Title")
tooltip: str = Field(title="Tooltip")
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")
class ScriptsmenuSettings(BaseSettingsModel):
@ -20,8 +19,8 @@ class ScriptsmenuSettings(BaseSettingsModel):
"""# TODO: enhance settings with host api:
- in api rename key `name` to `menu_name`
"""
name: str = Field(title="Menu name")
definition: list[ScriptsmenuSubmodel] = Field(
name: str = SettingsField(title="Menu name")
definition: list[ScriptsmenuSubmodel] = SettingsField(
default_factory=list,
title="Definition",
description="Scriptmenu Items Definition")

View file

@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"

View file

@ -1,92 +1,91 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
# Creator Plugins
class CreatorModel(BaseSettingsModel):
enabled: bool = Field(title="Enabled")
default_variants: list[str] = Field(
enabled: bool = SettingsField(title="Enabled")
default_variants: list[str] = SettingsField(
title="Default Products",
default_factory=list,
)
class CreateArnoldAssModel(BaseSettingsModel):
enabled: bool = Field(title="Enabled")
default_variants: list[str] = Field(
enabled: bool = SettingsField(title="Enabled")
default_variants: list[str] = SettingsField(
title="Default Products",
default_factory=list,
)
ext: str = Field(Title="Extension")
ext: str = SettingsField(Title="Extension")
class CreateStaticMeshModel(BaseSettingsModel):
enabled: bool = Field(title="Enabled")
default_variants: list[str] = Field(
enabled: bool = SettingsField(title="Enabled")
default_variants: list[str] = SettingsField(
default_factory=list,
title="Default Products"
)
static_mesh_prefix: str = Field("S", title="Static Mesh Prefix")
collision_prefixes: list[str] = Field(
static_mesh_prefix: str = SettingsField("S", title="Static Mesh Prefix")
collision_prefixes: list[str] = SettingsField(
default_factory=list,
title="Collision Prefixes"
)
class CreatePluginsModel(BaseSettingsModel):
CreateAlembicCamera: CreatorModel = Field(
CreateAlembicCamera: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Alembic Camera")
CreateArnoldAss: CreateArnoldAssModel = Field(
CreateArnoldAss: CreateArnoldAssModel = SettingsField(
default_factory=CreateArnoldAssModel,
title="Create Arnold Ass")
CreateArnoldRop: CreatorModel = Field(
CreateArnoldRop: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Arnold ROP")
CreateCompositeSequence: CreatorModel = Field(
CreateCompositeSequence: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Composite (Image Sequence)")
CreateHDA: CreatorModel = Field(
CreateHDA: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Houdini Digital Asset")
CreateKarmaROP: CreatorModel = Field(
CreateKarmaROP: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Karma ROP")
CreateMantraIFD: CreatorModel = Field(
CreateMantraIFD: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Mantra IFD")
CreateMantraROP: CreatorModel = Field(
CreateMantraROP: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Mantra ROP")
CreatePointCache: CreatorModel = Field(
CreatePointCache: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create PointCache (Abc)")
CreateBGEO: CreatorModel = Field(
CreateBGEO: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create PointCache (Bgeo)")
CreateRedshiftProxy: CreatorModel = Field(
CreateRedshiftProxy: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Redshift Proxy")
CreateRedshiftROP: CreatorModel = Field(
CreateRedshiftROP: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Redshift ROP")
CreateReview: CreatorModel = Field(
CreateReview: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create Review")
# "-" is not compatible in the new model
CreateStaticMesh: CreateStaticMeshModel = Field(
CreateStaticMesh: CreateStaticMeshModel = SettingsField(
default_factory=CreateStaticMeshModel,
title="Create Static Mesh")
CreateUSD: CreatorModel = Field(
CreateUSD: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create USD (experimental)")
CreateUSDRender: CreatorModel = Field(
CreateUSDRender: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create USD render (experimental)")
CreateVDBCache: CreatorModel = Field(
CreateVDBCache: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create VDB Cache")
CreateVrayROP: CreatorModel = Field(
CreateVrayROP: CreatorModel = SettingsField(
default_factory=CreatorModel,
title="Create VRay ROP")

View file

@ -1,12 +1,11 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
class HoudiniVarModel(BaseSettingsModel):
_layout = "expanded"
var: str = Field("", title="Var")
value: str = Field("", title="Value")
is_directory: bool = Field(False, title="Treat as directory")
var: str = SettingsField("", title="Var")
value: str = SettingsField("", title="Value")
is_directory: bool = SettingsField(False, title="Treat as directory")
class UpdateHoudiniVarcontextModel(BaseSettingsModel):
@ -16,20 +15,20 @@ class UpdateHoudiniVarcontextModel(BaseSettingsModel):
it will be ensured the folder exists.
"""
enabled: bool = Field(title="Enabled")
enabled: bool = SettingsField(title="Enabled")
# TODO this was dynamic dictionary '{var: path}'
houdini_vars: list[HoudiniVarModel] = Field(
houdini_vars: list[HoudiniVarModel] = SettingsField(
default_factory=list,
title="Houdini Vars"
)
class GeneralSettingsModel(BaseSettingsModel):
add_self_publish_button: bool = Field(
add_self_publish_button: bool = SettingsField(
False,
title="Add Self Publish Button"
)
update_houdini_var_context: UpdateHoudiniVarcontextModel = Field(
update_houdini_var_context: UpdateHoudiniVarcontextModel = SettingsField(
default_factory=UpdateHoudiniVarcontextModel,
title="Update Houdini Vars on context change"
)

View file

@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names
class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)
class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")
class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
@ -35,14 +35,14 @@ class ImageIOFileRulesModel(BaseSettingsModel):
class HoudiniImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)

View file

@ -1,5 +1,4 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField
from .general import (
GeneralSettingsModel,
DEFAULT_GENERAL_SETTINGS
@ -17,23 +16,23 @@ from .publish import (
class HoudiniSettings(BaseSettingsModel):
general: GeneralSettingsModel = Field(
general: GeneralSettingsModel = SettingsField(
default_factory=GeneralSettingsModel,
title="General"
)
imageio: HoudiniImageIOModel = Field(
imageio: HoudiniImageIOModel = SettingsField(
default_factory=HoudiniImageIOModel,
title="Color Management (ImageIO)"
)
shelves: list[ShelvesModel] = Field(
shelves: list[ShelvesModel] = SettingsField(
default_factory=list,
title="Shelves Manager",
)
create: CreatePluginsModel = Field(
create: CreatePluginsModel = SettingsField(
default_factory=CreatePluginsModel,
title="Creator Plugins",
)
publish: PublishPluginsModel = Field(
publish: PublishPluginsModel = SettingsField(
default_factory=PublishPluginsModel,
title="Publish Plugins",
)

Some files were not shown because too many files have changed in this diff Show more