Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier Addon Setting for Nodes settings in color management section #43

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion server/settings/imageio.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,41 @@
ColorspaceConfigurationModel,
)

def nuke_creator_plugins_enum():
return [
{"value": "CreateWritePrerender", "label": "Prerender (write)"},
{"value": "CreateCamera", "label": "Camera (3d)"},
{"value": "CreateGizmo", "label": "Gizmo (group)"},
{"value": "CreateWriteImage", "label": "Image (write)"},
{"value": "CreateModel", "label": "Model (3d)"},
{"value": "CreateBackdrop", "label": "Nukenodes (backdrop)"},
{"value": "CreateWriteRender", "label": "Render (write)"},
{"value": "CreateSource", "label": "Source (read)"},
]


def nuke_node_class_enum():
return [
{"value": "Write", "label": "Write [Image]"},
{"value": "Read", "label": "Read [Image]"},
{"value": "Group", "label": "Group [Other]"},
{"value": "Camera4", "label": "Camera [3D]"},
{"value": "Camera2", "label": "Camera [3D Classic]"},
{"value": "Scene", "label": "Scene [3D Classic]"},
{"value": "BackdropNode", "label": "Backdrop [Other]"},
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially not for this PR, but I'm wondering if there is a way to make these enums dynamically retrieved ?
We would need to add a class attribute to each creator to get the associated Nuke node Class and gather the creators.

Benefit imo would be that we get server settings follow code adjustments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to!
I don't know if we can the client side of ayon_nuke in the server side.
Let's summon our server guardian @martastain



class NodesModel(BaseSettingsModel):
_layout = "expanded"
plugins: list[str] = SettingsField(
default_factory=list,
title="Used in plugins"
title="Used in plugins",
enum_resolver=nuke_creator_plugins_enum
)
nuke_node_class: str = SettingsField(
title="Nuke Node Class",
enum_resolver=nuke_node_class_enum
)


Expand Down
Loading