mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
fix imports
This commit is contained in:
parent
af26054c2b
commit
a0636eec08
29 changed files with 52 additions and 52 deletions
|
|
@ -5,7 +5,7 @@
|
|||
The easiest way to setup for using Toon Boom Harmony is to use the built-in launch:
|
||||
|
||||
```
|
||||
python -c "import ayon_core.hosts.harmony.api as harmony;harmony.launch("path/to/harmony/executable")"
|
||||
python -c "import ayon_harmony.api as harmony;harmony.launch("path/to/harmony/executable")"
|
||||
```
|
||||
|
||||
Communication with Harmony happens with a server/client relationship where the server is in the Python process and the client is in the Harmony process. Messages between Python and Harmony are required to be dictionaries, which are serialized to strings:
|
||||
|
|
@ -59,7 +59,7 @@ You can show the Workfiles app when Harmony launches by setting environment vari
|
|||
### Low level messaging
|
||||
To send from Python to Harmony you can use the exposed method:
|
||||
```python
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
from uuid import uuid4
|
||||
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ print(harmony.send({"function": func, "args": ["Python"]})["result"])
|
|||
|
||||
To send a function with multiple arguments its best to declare the arguments within the function:
|
||||
```python
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
from uuid import uuid4
|
||||
|
||||
signature = str(uuid4()).replace("-", "_")
|
||||
|
|
@ -114,7 +114,7 @@ PypeHarmony.myAwesomeFunction = function() {
|
|||
Then you can call that javascript code from your Python like:
|
||||
|
||||
```Python
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
harmony.send({"function": "PypeHarmony.myAwesomeFunction"});
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ Now in python, just read all those files and send them to Harmony.
|
|||
|
||||
```python
|
||||
from pathlib import Path
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
path_to_js = Path('/path/to/my/js')
|
||||
script_to_send = ""
|
||||
|
|
@ -178,7 +178,7 @@ harmony.send({"function": "Master.Boo.B"})
|
|||
### Scene Save
|
||||
Instead of sending a request to Harmony with `scene.saveAll` please use:
|
||||
```python
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
harmony.save_scene()
|
||||
```
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ These plugins were made with the [polly config](https://github.com/mindbender-st
|
|||
|
||||
#### Creator Plugin
|
||||
```python
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
from uuid import uuid4
|
||||
|
||||
|
||||
|
|
@ -213,7 +213,7 @@ class CreateComposite(harmony.Creator):
|
|||
The creator plugin can be configured to use other node types. For example here is a write node creator:
|
||||
```python
|
||||
from uuid import uuid4
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class CreateRender(harmony.Creator):
|
||||
|
|
@ -244,7 +244,7 @@ class CreateRender(harmony.Creator):
|
|||
```python
|
||||
import pyblish.api
|
||||
from ayon_core.pipeline import AYON_INSTANCE_ID, AVALON_INSTANCE_ID
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class CollectInstances(pyblish.api.ContextPlugin):
|
||||
|
|
@ -292,7 +292,7 @@ import os
|
|||
from uuid import uuid4
|
||||
|
||||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
import clique
|
||||
|
||||
|
|
@ -423,7 +423,7 @@ class ExtractImage(pyblish.api.InstancePlugin):
|
|||
import os
|
||||
from uuid import uuid4
|
||||
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
signature = str(uuid4()).replace("-", "_")
|
||||
copy_files = """function copyFile(srcFilename, dstFilename)
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ function start() {
|
|||
*/
|
||||
self.onCreator = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['creator']
|
||||
}, false);
|
||||
|
|
@ -402,7 +402,7 @@ function start() {
|
|||
*/
|
||||
self.onWorkfiles = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['workfiles']
|
||||
}, false);
|
||||
|
|
@ -417,7 +417,7 @@ function start() {
|
|||
*/
|
||||
self.onLoad = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['loader']
|
||||
}, false);
|
||||
|
|
@ -433,7 +433,7 @@ function start() {
|
|||
*/
|
||||
self.onPublish = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['publish']
|
||||
}, false);
|
||||
|
|
@ -449,7 +449,7 @@ function start() {
|
|||
*/
|
||||
self.onManage = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['sceneinventory']
|
||||
}, false);
|
||||
|
|
@ -465,7 +465,7 @@ function start() {
|
|||
*/
|
||||
self.onSubsetManage = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['subsetmanager']
|
||||
}, false);
|
||||
|
|
@ -482,7 +482,7 @@ function start() {
|
|||
self.onSetSceneSettings = function() {
|
||||
app.avalonClient.send(
|
||||
{
|
||||
"module": "ayon_core.hosts.harmony.api",
|
||||
"module": "ayon_harmony.api",
|
||||
"method": "ensure_scene_settings",
|
||||
"args": []
|
||||
},
|
||||
|
|
@ -500,7 +500,7 @@ function start() {
|
|||
*/
|
||||
self.onExperimentalTools = function() {
|
||||
app.avalonClient.send({
|
||||
'module': 'ayon_core.hosts.harmony.api.lib',
|
||||
'module': 'ayon_harmony.api.lib',
|
||||
'method': 'show',
|
||||
'args': ['experimental_tools']
|
||||
}, false);
|
||||
|
|
@ -550,7 +550,7 @@ function ensureSceneSettings() {
|
|||
var app = QCoreApplication.instance();
|
||||
app.avalonClient.send(
|
||||
{
|
||||
"module": "ayon_core.hosts.harmony.api",
|
||||
"module": "ayon_harmony.api",
|
||||
"method": "ensure_scene_settings",
|
||||
"args": []
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ workfile or others.
|
|||
import os
|
||||
import sys
|
||||
|
||||
from ayon_core.hosts.harmony.api.lib import main as host_main
|
||||
from ayon_harmony.api.lib import main as host_main
|
||||
|
||||
# Get current file to locate start point of sys.argv
|
||||
CURRENT_FILE = os.path.abspath(__file__)
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ def launch(application_path, *args):
|
|||
|
||||
"""
|
||||
from ayon_core.pipeline import install_host
|
||||
from ayon_core.hosts.harmony import api as harmony
|
||||
from ayon_harmony import api as harmony
|
||||
|
||||
install_host(harmony)
|
||||
|
||||
|
|
@ -486,7 +486,7 @@ def imprint(node_id, data, remove=False):
|
|||
remove (bool): Removes the data from the scene.
|
||||
|
||||
Example:
|
||||
>>> from ayon_core.hosts.harmony.api import lib
|
||||
>>> from ayon_harmony.api import lib
|
||||
>>> node = "Top/Display"
|
||||
>>> data = {"str": "something", "int": 1, "float": 0.32, "bool": True}
|
||||
>>> lib.imprint(layer, data)
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ from ayon_core.pipeline import (
|
|||
from ayon_core.pipeline.load import get_outdated_containers
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
|
||||
from ayon_core.hosts.harmony import HARMONY_ADDON_ROOT
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
from ayon_harmony import HARMONY_ADDON_ROOT
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
log = logging.getLogger("ayon_core.hosts.harmony")
|
||||
log = logging.getLogger("ayon_harmony")
|
||||
|
||||
PLUGINS_DIR = os.path.join(HARMONY_ADDON_ROOT, "plugins")
|
||||
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from ayon_core.pipeline import LegacyCreator
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class Creator(LegacyCreator):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from ayon_core.lib import (
|
|||
is_using_ayon_console,
|
||||
)
|
||||
from ayon_applications import PreLaunchHook, LaunchTypes
|
||||
from ayon_core.hosts.harmony import get_launch_script_path
|
||||
from ayon_harmony import get_launch_script_path
|
||||
|
||||
|
||||
def get_launch_kwargs(kwargs):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Create Composite node for render on farm."""
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
from ayon_core.hosts.harmony.api import plugin
|
||||
import ayon_harmony.api as harmony
|
||||
from ayon_harmony.api import plugin
|
||||
|
||||
|
||||
class CreateFarmRender(plugin.Creator):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Create render node."""
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
from ayon_core.hosts.harmony.api import plugin
|
||||
import ayon_harmony.api as harmony
|
||||
from ayon_harmony.api import plugin
|
||||
|
||||
|
||||
class CreateRender(plugin.Creator):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from ayon_core.hosts.harmony.api import plugin
|
||||
from ayon_harmony.api import plugin
|
||||
|
||||
|
||||
class CreateTemplate(plugin.Creator):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
sig = harmony.signature()
|
||||
func = """
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from ayon_core.pipeline import (
|
|||
get_representation_path,
|
||||
)
|
||||
from ayon_core.pipeline.context_tools import is_representation_from_latest
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
copy_files = """function copyFile(srcFilename, dstFilename)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from ayon_core.pipeline import (
|
|||
get_representation_path,
|
||||
)
|
||||
from ayon_core.pipeline.context_tools import is_representation_from_latest
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class ImageSequenceLoader(load.LoaderPlugin):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class ImportPaletteLoader(load.LoaderPlugin):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from ayon_core.pipeline import (
|
|||
get_representation_path,
|
||||
)
|
||||
from ayon_core.pipeline.context_tools import is_representation_from_latest
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class TemplateLoader(load.LoaderPlugin):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class ImportTemplateLoader(load.LoaderPlugin):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import os
|
||||
|
||||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class CollectCurrentFile(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import attr
|
|||
from ayon_core.lib import get_formatted_current_time
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.pipeline.publish import RenderInstance
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
@attr.s
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import json
|
||||
|
||||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class CollectInstances(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import json
|
|||
import re
|
||||
|
||||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class CollectPalettes(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import os
|
||||
|
||||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class CollectScene(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import csv
|
|||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
from ayon_core.pipeline import publish
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import tempfile
|
|||
import subprocess
|
||||
|
||||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
import ayon_core.lib
|
||||
|
||||
import clique
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import pyblish.api
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class ExtractSaveScene(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import os
|
|||
import shutil
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class ExtractTemplate(publish.Extractor):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import os
|
|||
import pyblish.api
|
||||
from ayon_core.pipeline.publish import get_errored_plugins_from_context
|
||||
from ayon_core.lib import version_up
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
|
||||
class IncrementWorkfile(pyblish.api.InstancePlugin):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import os
|
|||
|
||||
import pyblish.api
|
||||
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
|
||||
from ayon_core.pipeline import PublishXmlValidationError
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import pyblish.api
|
||||
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
from ayon_core.pipeline import get_current_folder_path
|
||||
from ayon_core.pipeline.publish import (
|
||||
ValidateContentsOrder,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import re
|
|||
|
||||
import pyblish.api
|
||||
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
import ayon_harmony.api as harmony
|
||||
from ayon_core.pipeline import PublishXmlValidationError
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue