mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Merge remote-tracking branch 'origin/develop' into 3.0/refactoring
# Conflicts: # pype/hosts/harmony/__init__.py
This commit is contained in:
commit
386a3d8b5c
185 changed files with 3083 additions and 836 deletions
|
|
@ -13,13 +13,14 @@ class CreateRender(harmony.Creator):
|
|||
super(CreateRender, self).__init__(*args, **kwargs)
|
||||
|
||||
def setup_node(self, node):
|
||||
func = """function func(args)
|
||||
sig = harmony.signature()
|
||||
func = """function %s(args)
|
||||
{
|
||||
node.setTextAttr(args[0], "DRAWING_TYPE", 1, "PNG4");
|
||||
node.setTextAttr(args[0], "DRAWING_NAME", 1, args[1]);
|
||||
node.setTextAttr(args[0], "MOVIE_PATH", 1, args[1]);
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
path = "{0}/{0}".format(node.split("/")[-1])
|
||||
harmony.send({"function": func, "args": [node, path]})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from avalon import api, harmony
|
||||
|
||||
|
||||
sig = harmony.signature()
|
||||
func = """
|
||||
function getUniqueColumnName( column_prefix )
|
||||
{
|
||||
|
|
@ -18,14 +18,14 @@ function getUniqueColumnName( column_prefix )
|
|||
return column_name;
|
||||
}
|
||||
|
||||
function func(args)
|
||||
function %s(args)
|
||||
{
|
||||
var uniqueColumnName = getUniqueColumnName(args[0]);
|
||||
column.add(uniqueColumnName , "SOUND");
|
||||
column.importSound(uniqueColumnName, 1, args[1]);
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
|
||||
|
||||
class ImportAudioLoader(api.Loader):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import json
|
||||
import os
|
||||
import uuid
|
||||
|
||||
import clique
|
||||
|
||||
from avalon import api, harmony
|
||||
|
||||
import pype.lib
|
||||
import json
|
||||
|
||||
copy_files = """function copyFile(srcFilename, dstFilename)
|
||||
{
|
||||
|
|
@ -256,7 +254,9 @@ class BackgroundLoader(api.Loader):
|
|||
container_nodes = []
|
||||
|
||||
for layer in sorted(layers):
|
||||
file_to_import = [os.path.join(bg_folder, layer).replace("\\", "/")]
|
||||
file_to_import = [
|
||||
os.path.join(bg_folder, layer).replace("\\", "/")
|
||||
]
|
||||
|
||||
read_node = harmony.send(
|
||||
{
|
||||
|
|
@ -301,8 +301,10 @@ class BackgroundLoader(api.Loader):
|
|||
print(container)
|
||||
|
||||
for layer in sorted(layers):
|
||||
file_to_import = [os.path.join(bg_folder, layer).replace("\\", "/")]
|
||||
print(20*"#")
|
||||
file_to_import = [
|
||||
os.path.join(bg_folder, layer).replace("\\", "/")
|
||||
]
|
||||
print(20 * "#")
|
||||
print(f"FILE TO REPLACE: {file_to_import}")
|
||||
print(f"LAYER: {layer}")
|
||||
node = harmony.find_node_by_name(layer, "READ")
|
||||
|
|
@ -324,9 +326,9 @@ class BackgroundLoader(api.Loader):
|
|||
)["result"]
|
||||
container['nodes'].append(read_node)
|
||||
|
||||
|
||||
# Colour node.
|
||||
func = """function func(args){
|
||||
sig = harmony.signature("set_color")
|
||||
func = """function %s(args){
|
||||
for( var i =0; i <= args[0].length - 1; ++i)
|
||||
{
|
||||
var red_color = new ColorRGBA(255, 0, 0, 255);
|
||||
|
|
@ -339,8 +341,8 @@ class BackgroundLoader(api.Loader):
|
|||
}
|
||||
}
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
if pype.lib.is_latest(representation):
|
||||
harmony.send({"function": func, "args": [node, "green"]})
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import os
|
|||
import uuid
|
||||
|
||||
import clique
|
||||
|
||||
from avalon import api, harmony
|
||||
|
||||
import pype.lib
|
||||
|
||||
copy_files = """function copyFile(srcFilename, dstFilename)
|
||||
|
|
@ -301,7 +301,8 @@ class ImageSequenceLoader(api.Loader):
|
|||
)
|
||||
|
||||
# Colour node.
|
||||
func = """function func(args){
|
||||
sig = harmony.signature("copyFile")
|
||||
func = """function %s(args){
|
||||
for( var i =0; i <= args[0].length - 1; ++i)
|
||||
{
|
||||
var red_color = new ColorRGBA(255, 0, 0, 255);
|
||||
|
|
@ -314,8 +315,8 @@ class ImageSequenceLoader(api.Loader):
|
|||
}
|
||||
}
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
if pype.lib.is_latest(representation):
|
||||
harmony.send({"function": func, "args": [node, "green"]})
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import tempfile
|
||||
import zipfile
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import zipfile
|
||||
|
||||
from avalon import api, harmony
|
||||
|
||||
|
|
@ -21,15 +21,16 @@ class ImportTemplateLoader(api.Loader):
|
|||
with zipfile.ZipFile(zip_file, "r") as zip_ref:
|
||||
zip_ref.extractall(template_path)
|
||||
|
||||
func = """function func(args)
|
||||
sig = harmony.signature("paste")
|
||||
func = """function %s(args)
|
||||
{
|
||||
var template_path = args[0];
|
||||
var drag_object = copyPaste.pasteTemplateIntoGroup(
|
||||
template_path, "Top", 1
|
||||
);
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
|
||||
harmony.send({"function": func, "args": [template_path]})
|
||||
|
||||
|
|
|
|||
|
|
@ -13,15 +13,16 @@ class CollectCurrentFile(pyblish.api.ContextPlugin):
|
|||
|
||||
def process(self, context):
|
||||
"""Inject the current working file"""
|
||||
func = """function func()
|
||||
sig = harmony.signature()
|
||||
func = """function %s()
|
||||
{
|
||||
return (
|
||||
scene.currentProjectPath() + "/" +
|
||||
scene.currentVersionName() + ".xstage"
|
||||
);
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
|
||||
current_file = harmony.send({"function": func})["result"]
|
||||
context.data["currentFile"] = os.path.normpath(current_file)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
import json
|
||||
import os
|
||||
|
||||
import pyblish.api
|
||||
from avalon import harmony
|
||||
|
|
@ -13,7 +13,8 @@ class CollectPalettes(pyblish.api.ContextPlugin):
|
|||
hosts = ["harmony"]
|
||||
|
||||
def process(self, context):
|
||||
func = """function func()
|
||||
sig = harmony.signature()
|
||||
func = """function %s()
|
||||
{
|
||||
var palette_list = PaletteObjectManager.getScenePaletteList();
|
||||
|
||||
|
|
@ -26,8 +27,8 @@ class CollectPalettes(pyblish.api.ContextPlugin):
|
|||
|
||||
return palettes;
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
palettes = harmony.send({"function": func})["result"]
|
||||
|
||||
for name, id in palettes.items():
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
|
||||
from avalon import harmony
|
||||
|
||||
import pype.api
|
||||
import pype.hosts.harmony
|
||||
|
||||
|
|
@ -13,14 +14,15 @@ class ExtractPalette(pype.api.Extractor):
|
|||
families = ["harmony.palette"]
|
||||
|
||||
def process(self, instance):
|
||||
func = """function func(args)
|
||||
sig = harmony.signature()
|
||||
func = """function %s(args)
|
||||
{
|
||||
var palette_list = PaletteObjectManager.getScenePaletteList();
|
||||
var palette = palette_list.getPaletteById(args[0]);
|
||||
return (palette.getPath() + "/" + palette.getName() + ".plt");
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
palette_file = harmony.send(
|
||||
{"function": func, "args": [instance.data["id"]]}
|
||||
)["result"]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import os
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
import pyblish.api
|
||||
from avalon import harmony
|
||||
import pype.lib
|
||||
import tempfile
|
||||
|
||||
import clique
|
||||
import pyblish.api
|
||||
from avalon import harmony
|
||||
|
||||
import pype.lib
|
||||
|
||||
|
||||
class ExtractRender(pyblish.api.InstancePlugin):
|
||||
|
|
@ -21,7 +21,8 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
|
||||
def process(self, instance):
|
||||
# Collect scene data.
|
||||
func = """function func(write_node)
|
||||
sig = harmony.signature()
|
||||
func = """function %s(write_node)
|
||||
{
|
||||
return [
|
||||
about.getApplicationPath(),
|
||||
|
|
@ -33,8 +34,8 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
sound.getSoundtrackAll().path()
|
||||
]
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
result = harmony.send(
|
||||
{"function": func, "args": [instance[0]]}
|
||||
)["result"]
|
||||
|
|
@ -44,18 +45,18 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
frame_start = result[4]
|
||||
frame_end = result[5]
|
||||
audio_path = result[6]
|
||||
if audio_path:
|
||||
instance.data["audio"] = [{"filename": audio_path}]
|
||||
|
||||
instance.data["fps"] = frame_rate
|
||||
|
||||
# Set output path to temp folder.
|
||||
path = tempfile.mkdtemp()
|
||||
func = """function func(args)
|
||||
sig = harmony.signature()
|
||||
func = """function %s(args)
|
||||
{
|
||||
node.setTextAttr(args[0], "DRAWING_NAME", 1, args[1]);
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
result = harmony.send(
|
||||
{
|
||||
"function": func,
|
||||
|
|
@ -89,7 +90,7 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
if len(collections) > 1:
|
||||
for col in collections:
|
||||
if len(list(col)) > 1:
|
||||
collection = col
|
||||
collection = col
|
||||
else:
|
||||
collection = collections[0]
|
||||
|
||||
|
|
@ -137,6 +138,9 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
}
|
||||
instance.data["representations"] = [representation, thumbnail]
|
||||
|
||||
if audio_path and os.path.exists(audio_path):
|
||||
instance.data["audio"] = [{"filename": audio_path}]
|
||||
|
||||
# Required for extract_review plugin (L222 onwards).
|
||||
instance.data["frameStart"] = frame_start
|
||||
instance.data["frameEnd"] = frame_end
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import os
|
||||
import shutil
|
||||
|
||||
from avalon import harmony
|
||||
|
||||
import pype.api
|
||||
import avalon.harmony
|
||||
import pype.hosts.harmony
|
||||
|
||||
|
||||
|
|
@ -30,7 +31,7 @@ class ExtractTemplate(pype.api.Extractor):
|
|||
unique_backdrops = [backdrops[x] for x in set(backdrops.keys())]
|
||||
|
||||
# Get non-connected nodes within backdrops.
|
||||
all_nodes = avalon.harmony.send(
|
||||
all_nodes = harmony.send(
|
||||
{"function": "node.subNodes", "args": ["Top"]}
|
||||
)["result"]
|
||||
for node in [x for x in all_nodes if x not in dependencies]:
|
||||
|
|
@ -66,7 +67,8 @@ class ExtractTemplate(pype.api.Extractor):
|
|||
instance.data["representations"] = [representation]
|
||||
|
||||
def get_backdrops(self, node):
|
||||
func = """function func(probe_node)
|
||||
sig = harmony.signature()
|
||||
func = """function %s(probe_node)
|
||||
{
|
||||
var backdrops = Backdrop.backdrops("Top");
|
||||
var valid_backdrops = [];
|
||||
|
|
@ -92,14 +94,15 @@ class ExtractTemplate(pype.api.Extractor):
|
|||
}
|
||||
return valid_backdrops;
|
||||
}
|
||||
func
|
||||
"""
|
||||
return avalon.harmony.send(
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
return harmony.send(
|
||||
{"function": func, "args": [node]}
|
||||
)["result"]
|
||||
|
||||
def get_dependencies(self, node, dependencies):
|
||||
func = """function func(args)
|
||||
sig = harmony.signature()
|
||||
func = """function %s(args)
|
||||
{
|
||||
var target_node = args[0];
|
||||
var numInput = node.numberOfInputPorts(target_node);
|
||||
|
|
@ -110,10 +113,10 @@ class ExtractTemplate(pype.api.Extractor):
|
|||
}
|
||||
return dependencies;
|
||||
}
|
||||
func
|
||||
"""
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
|
||||
current_dependencies = avalon.harmony.send(
|
||||
current_dependencies = harmony.send(
|
||||
{"function": func, "args": [node]}
|
||||
)["result"]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import os
|
||||
import shutil
|
||||
|
||||
from avalon import harmony
|
||||
|
||||
import pype.api
|
||||
import avalon.harmony
|
||||
import pype.hosts.harmony
|
||||
|
||||
|
||||
|
|
@ -15,10 +16,10 @@ class ExtractWorkfile(pype.api.Extractor):
|
|||
|
||||
def process(self, instance):
|
||||
# Export template.
|
||||
backdrops = avalon.harmony.send(
|
||||
backdrops = harmony.send(
|
||||
{"function": "Backdrop.backdrops", "args": ["Top"]}
|
||||
)["result"]
|
||||
nodes = avalon.harmony.send(
|
||||
nodes = harmony.send(
|
||||
{"function": "node.subNodes", "args": ["Top"]}
|
||||
)["result"]
|
||||
staging_dir = self.staging_dir(instance)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
import json
|
||||
import os
|
||||
|
||||
import pyblish.api
|
||||
|
||||
import avalon.harmony
|
||||
import pype.hosts.harmony
|
||||
from avalon import harmony
|
||||
|
||||
|
||||
class ValidateAudio(pyblish.api.InstancePlugin):
|
||||
"""Ensures that there is an audio file in the scene. If you are sure that you want to send render without audio, you can disable this validator before clicking on "publish" """
|
||||
"""Ensures that there is an audio file in the scene.
|
||||
|
||||
If you are sure that you want to send render without audio, you can
|
||||
disable this validator before clicking on "publish"
|
||||
|
||||
"""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
label = "Validate Audio"
|
||||
|
|
@ -26,7 +28,7 @@ class ValidateAudio(pyblish.api.InstancePlugin):
|
|||
}
|
||||
func
|
||||
"""
|
||||
result = avalon.harmony.send(
|
||||
result = harmony.send(
|
||||
{"function": func, "args": [instance[0]]}
|
||||
)["result"]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import json
|
||||
|
||||
import pyblish.api
|
||||
from avalon import harmony
|
||||
|
||||
import avalon.harmony
|
||||
import pype.hosts.harmony
|
||||
|
||||
|
||||
|
|
@ -46,7 +46,8 @@ class ValidateSceneSettings(pyblish.api.InstancePlugin):
|
|||
for string in self.frame_check_filter):
|
||||
expected_settings.pop("frameEnd")
|
||||
|
||||
func = """function func()
|
||||
sig = harmony.signature()
|
||||
func = """function %s()
|
||||
{
|
||||
return {
|
||||
"fps": scene.getFrameRate(),
|
||||
|
|
@ -56,9 +57,9 @@ class ValidateSceneSettings(pyblish.api.InstancePlugin):
|
|||
"resolutionHeight": scene.defaultResolutionY()
|
||||
};
|
||||
}
|
||||
func
|
||||
"""
|
||||
current_settings = avalon.harmony.send({"function": func})["result"]
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
current_settings = harmony.send({"function": func})["result"]
|
||||
|
||||
invalid_settings = []
|
||||
for key, value in expected_settings.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue