Skip to content

Commit

Permalink
Merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kalisp committed Jan 15, 2025
2 parents 838898b + 3ec2e03 commit 8657663
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/ayon_harmony/api/js/AyonHarmonyAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ AyonHarmonyAPI.setupNodeForCreator = function(node) {
* @return {array} Node names.
*/
AyonHarmonyAPI.getNodesNamesByType = function(nodeType) {
var nodes = node.getNodes(nodeType);
var nodes = node.getNodes([nodeType]);
var nodeNames = [];
for (var i = 0; i < nodes.length; ++i) {
nodeNames.push(node.getName(nodes[i]));
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_harmony/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def ls():
continue

# Filter to only containers.
if "container" not in data.get("id"):
if "container" not in data.get("id", ""):
continue

if not data.get("objectName"): # backward compatibility
Expand Down
35 changes: 34 additions & 1 deletion client/ayon_harmony/api/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from ayon_core.pipeline import LegacyCreator
import re

from ayon_core.pipeline import LegacyCreator, CreatorError
import ayon_harmony.api as harmony


Expand All @@ -14,6 +16,10 @@ class Creator(LegacyCreator):

defaults = ["Main"]
node_type = "COMPOSITE"
settings_category = "harmony"

auto_connect = False
composition_node_pattern = ""

def setup_node(self, node):
"""Prepare node as container.
Expand Down Expand Up @@ -57,6 +63,33 @@ def process(self):
"args": [self.name, self.node_type, selection[-1]]
}
)["result"]
elif (self.auto_connect):
existing_comp_names = harmony.send(
{
"function": "AyonHarmonyAPI.getNodesNamesByType",
"args": "COMPOSITE"
})["result"]
name_pattern = self.composition_node_pattern
if not name_pattern:
raise CreatorError("Composition name regex pattern "
"must be filled")
compiled_pattern = re.compile(name_pattern)
matching_nodes = [name for name in existing_comp_names
if compiled_pattern.match(name)]
if len(matching_nodes) > 1:
self.log.warning("Multiple composition node found, "
"picked first")
elif len(matching_nodes) <= 0:
raise CreatorError("No matching composition "
"node found")
node_name = f"/Top/{matching_nodes[0]}"

node = harmony.send(
{
"function": "AyonHarmonyAPI.createContainer",
"args": [self.name, self.node_type, node_name]
}
)["result"]
else:
node = harmony.send(
{
Expand Down
1 change: 0 additions & 1 deletion client/ayon_harmony/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def receive(self):
"""
current_time = time.time()
while True:
self.log.info("wait ttt")
# Receive the data in small chunks and retransmit it
request = None
try:
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_harmony/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring AYON addon 'harmony' version."""
__version__ = "0.2.2+dev"
__version__ = "0.2.2+dev.1"
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "harmony"
title = "Harmony"
version = "0.2.2+dev"
version = "0.2.2+dev.1"
client_dir = "ayon_harmony"
app_host_name = "harmony"

Expand Down
5 changes: 5 additions & 0 deletions server/settings/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ayon_server.settings import BaseSettingsModel, SettingsField

from .imageio import HarmonyImageIOModel
from .creator_plugins import HarmonyCreatePlugins
from .publish_plugins import HarmonyPublishPlugins


Expand All @@ -11,6 +12,10 @@ class HarmonySettings(BaseSettingsModel):
default_factory=HarmonyImageIOModel,
title="OCIO config"
)
create: HarmonyCreatePlugins = SettingsField(
default_factory=HarmonyCreatePlugins,
title="Creator plugins"
)
publish: HarmonyPublishPlugins = SettingsField(
default_factory=HarmonyPublishPlugins,
title="Publish plugins"
Expand Down

0 comments on commit 8657663

Please sign in to comment.