fix imports

This commit is contained in:
Jakub Trllo 2024-05-31 17:28:03 +02:00
parent fa3edd79c0
commit 5ef9b5d17c
51 changed files with 87 additions and 88 deletions

View file

@ -1,7 +1,7 @@
import os
from ayon_core.addon import AYONAddon, IHostAddon
BLENDER_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
BLENDER_ADDON_ROOT = os.path.dirname(os.path.abspath(__file__))
class BlenderAddon(AYONAddon, IHostAddon):
@ -12,7 +12,7 @@ class BlenderAddon(AYONAddon, IHostAddon):
"""Modify environments to contain all required for implementation."""
# Prepare path to implementation script
implementation_user_script_path = os.path.join(
BLENDER_ROOT_DIR,
BLENDER_ADDON_ROOT,
"blender_addon"
)
@ -61,7 +61,7 @@ class BlenderAddon(AYONAddon, IHostAddon):
if app.host_name != self.host_name:
return []
return [
os.path.join(BLENDER_ROOT_DIR, "hooks")
os.path.join(BLENDER_ADDON_ROOT, "hooks")
]
def get_workfile_extensions(self):

View file

@ -5,9 +5,6 @@ from typing import Callable, Dict, Iterator, List, Optional
import bpy
from . import lib
from . import ops
import pyblish.api
import ayon_api
@ -33,8 +30,12 @@ from ayon_core.lib import (
register_event_callback,
emit_event
)
import ayon_core.hosts.blender
from ayon_core.settings import get_project_settings
from ayon_blender import BLENDER_ADDON_ROOT
from . import lib
from . import ops
from .workio import (
open_file,
save_file,
@ -44,9 +45,7 @@ from .workio import (
work_root,
)
HOST_DIR = os.path.dirname(os.path.abspath(ayon_core.hosts.blender.__file__))
PLUGINS_DIR = os.path.join(HOST_DIR, "plugins")
PLUGINS_DIR = os.path.join(BLENDER_ADDON_ROOT, "plugins")
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish")
LOAD_PATH = os.path.join(PLUGINS_DIR, "load")
CREATE_PATH = os.path.join(PLUGINS_DIR, "create")

View file

@ -496,7 +496,7 @@ class AssetLoader(LoaderPlugin):
# Only containerise if it's not already a collection from a .blend file.
# representation = context["representation"]["name"]
# if representation != "blend":
# from ayon_core.hosts.blender.api.pipeline import containerise
# from ayon_blender.api.pipeline import containerise
# return containerise(
# name=name,
# namespace=namespace,

View file

@ -1,5 +1,5 @@
from ayon_core.pipeline import install_host
from ayon_core.hosts.blender.api import BlenderHost
from ayon_blender.api import BlenderHost
def register():

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Converter for legacy Houdini products."""
from ayon_core.pipeline.create.creator_plugins import ProductConvertorPlugin
from ayon_core.hosts.blender.api.lib import imprint
from ayon_blender.api.lib import imprint
class BlenderLegacyConvertor(ProductConvertorPlugin):

View file

@ -2,7 +2,7 @@
import bpy
from ayon_core.hosts.blender.api import lib, plugin
from ayon_blender.api import lib, plugin
class CreateAction(plugin.BaseCreator):

View file

@ -1,6 +1,6 @@
"""Create an animation asset."""
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateAnimation(plugin.BaseCreator):

View file

@ -2,7 +2,7 @@
import bpy
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateBlendScene(plugin.BaseCreator):

View file

@ -2,8 +2,8 @@
import bpy
from ayon_core.hosts.blender.api import plugin, lib
from ayon_core.hosts.blender.api.pipeline import AVALON_INSTANCES
from ayon_blender.api import plugin, lib
from ayon_blender.api.pipeline import AVALON_INSTANCES
class CreateCamera(plugin.BaseCreator):

View file

@ -2,7 +2,7 @@
import bpy
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateLayout(plugin.BaseCreator):

View file

@ -2,7 +2,7 @@
import bpy
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateModel(plugin.BaseCreator):

View file

@ -1,6 +1,6 @@
"""Create a pointcache asset."""
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreatePointcache(plugin.BaseCreator):

View file

@ -2,9 +2,9 @@
import bpy
from ayon_core.lib import version_up
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.render_lib import prepare_rendering
from ayon_core.hosts.blender.api.workio import save_file
from ayon_blender.api import plugin
from ayon_blender.api.render_lib import prepare_rendering
from ayon_blender.api.workio import save_file
class CreateRenderlayer(plugin.BaseCreator):

View file

@ -1,6 +1,6 @@
"""Create review."""
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateReview(plugin.BaseCreator):

View file

@ -2,7 +2,7 @@
import bpy
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateRig(plugin.BaseCreator):

View file

@ -1,6 +1,6 @@
"""Create a USD Export."""
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CreateUSD(plugin.BaseCreator):

View file

@ -2,8 +2,8 @@ import bpy
import ayon_api
from ayon_core.pipeline import CreatedInstance, AutoCreator
from ayon_core.hosts.blender.api.plugin import BaseCreator
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api.plugin import BaseCreator
from ayon_blender.api.pipeline import (
AVALON_PROPERTY,
AVALON_CONTAINERS
)

View file

@ -1,6 +1,6 @@
import bpy
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
def append_workfile(context, fname, do_import):

View file

@ -7,8 +7,8 @@ from typing import Dict, List, Optional
import bpy
from ayon_core.pipeline import get_representation_path
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin
from ayon_blender.api.pipeline import (
containerise_existing,
AVALON_PROPERTY,
)

View file

@ -4,8 +4,8 @@ from typing import Dict, List, Optional
import bpy
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.pipeline import AVALON_PROPERTY
from ayon_blender.api import plugin
from ayon_blender.api.pipeline import AVALON_PROPERTY
class BlendAnimationLoader(plugin.AssetLoader):

View file

@ -10,8 +10,8 @@ from ayon_core.pipeline import (
get_representation_path,
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)

View file

@ -9,9 +9,9 @@ from ayon_core.pipeline import (
registered_host
)
from ayon_core.pipeline.create import CreateContext
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.lib import imprint
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin
from ayon_blender.api.lib import imprint
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)

View file

@ -7,9 +7,9 @@ from ayon_core.pipeline import (
get_representation_path,
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.lib import imprint
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin
from ayon_blender.api.lib import imprint
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)

View file

@ -11,11 +11,11 @@ from ayon_core.pipeline import (
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class CacheModelLoader(plugin.AssetLoader):

View file

@ -10,8 +10,8 @@ from ayon_core.pipeline import (
get_representation_path,
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api import plugin, lib
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin, lib
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)

View file

@ -10,8 +10,8 @@ from ayon_core.pipeline import (
get_representation_path,
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api import plugin, lib
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin, lib
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)

View file

@ -10,8 +10,8 @@ from ayon_core.pipeline import (
get_representation_path,
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api import plugin, lib
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin, lib
from ayon_blender.api.pipeline import (
AVALON_CONTAINERS,
AVALON_PROPERTY,
)

View file

@ -15,12 +15,12 @@ from ayon_core.pipeline import (
loaders_from_representation,
AVALON_CONTAINER_ID,
)
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api.pipeline import (
AVALON_INSTANCES,
AVALON_CONTAINERS,
AVALON_PROPERTY,
)
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
class JsonLayoutLoader(plugin.AssetLoader):

View file

@ -9,8 +9,8 @@ import json
import bpy
from ayon_core.pipeline import get_representation_path
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.pipeline import (
from ayon_blender.api import plugin
from ayon_blender.api.pipeline import (
containerise_existing,
AVALON_PROPERTY
)

View file

@ -1,5 +1,5 @@
import pyblish.api
from ayon_core.hosts.blender.api import workio
from ayon_blender.api import workio
class CollectBlenderCurrentFile(pyblish.api.ContextPlugin):

View file

@ -3,7 +3,7 @@ import bpy
import pyblish.api
from ayon_core.pipeline.publish import KnownPublishError
from ayon_core.hosts.blender.api.pipeline import AVALON_PROPERTY
from ayon_blender.api.pipeline import AVALON_PROPERTY
class CollectBlenderInstanceData(pyblish.api.InstancePlugin):

View file

@ -6,7 +6,7 @@ import re
import bpy
from ayon_core.hosts.blender.api import colorspace
from ayon_blender.api import colorspace
import pyblish.api

View file

@ -4,7 +4,7 @@ import bpy
from ayon_core.lib import BoolDef
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
class ExtractABC(publish.Extractor, publish.OptionalPyblishPluginMixin):

View file

@ -3,7 +3,7 @@ import os
import bpy
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
class ExtractAnimationABC(

View file

@ -3,7 +3,7 @@ import os
import bpy
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
class ExtractCameraABC(publish.Extractor, publish.OptionalPyblishPluginMixin):

View file

@ -3,7 +3,7 @@ import os
import bpy
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
class ExtractCamera(publish.Extractor, publish.OptionalPyblishPluginMixin):

View file

@ -3,7 +3,7 @@ import os
import bpy
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_blender.api import plugin
class ExtractFBX(publish.Extractor, publish.OptionalPyblishPluginMixin):

View file

@ -6,8 +6,8 @@ import bpy_extras
import bpy_extras.anim_utils
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.pipeline import AVALON_PROPERTY
from ayon_blender.api import plugin
from ayon_blender.api.pipeline import AVALON_PROPERTY
def get_all_parents(obj):

View file

@ -8,8 +8,8 @@ import bpy_extras.anim_utils
from ayon_api import get_representations
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin
from ayon_core.hosts.blender.api.pipeline import AVALON_PROPERTY
from ayon_blender.api import plugin
from ayon_blender.api.pipeline import AVALON_PROPERTY
class ExtractLayout(publish.Extractor, publish.OptionalPyblishPluginMixin):

View file

@ -7,8 +7,8 @@ import pyblish.api
import bpy
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import capture
from ayon_core.hosts.blender.api.lib import maintained_time
from ayon_blender.api import capture
from ayon_blender.api.lib import maintained_time
class ExtractPlayblast(publish.Extractor, publish.OptionalPyblishPluginMixin):

View file

@ -4,8 +4,8 @@ import json
import pyblish.api
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import capture
from ayon_core.hosts.blender.api.lib import maintained_time
from ayon_blender.api import capture
from ayon_blender.api.lib import maintained_time
import bpy

View file

@ -3,7 +3,7 @@ import os
import bpy
from ayon_core.pipeline import publish
from ayon_core.hosts.blender.api import plugin, lib
from ayon_blender.api import plugin, lib
class ExtractUSD(publish.Extractor):

View file

@ -1,6 +1,6 @@
import pyblish.api
from ayon_core.pipeline.publish import OptionalPyblishPluginMixin
from ayon_core.hosts.blender.api.workio import save_file
from ayon_blender.api.workio import save_file
class IncrementWorkfileVersion(

View file

@ -4,7 +4,7 @@ import bpy
import pyblish.api
import ayon_core.hosts.blender.api.action
import ayon_blender.api.action
from ayon_core.pipeline.publish import (
ValidateContentsOrder,
PublishValidationError,
@ -25,7 +25,7 @@ class ValidateCameraZeroKeyframe(pyblish.api.InstancePlugin,
hosts = ["blender"]
families = ["camera"]
label = "Zero Keyframe"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction]
actions = [ayon_blender.api.action.SelectInvalidAction]
@staticmethod
def get_invalid(instance) -> List:

View file

@ -9,7 +9,7 @@ from ayon_core.pipeline.publish import (
PublishValidationError,
OptionalPyblishPluginMixin
)
from ayon_core.hosts.blender.api.render_lib import prepare_rendering
from ayon_blender.api.render_lib import prepare_rendering
class ValidateDeadlinePublish(pyblish.api.InstancePlugin,

View file

@ -9,7 +9,7 @@ from ayon_core.pipeline.publish import (
OptionalPyblishPluginMixin,
PublishValidationError
)
import ayon_core.hosts.blender.api.action
import ayon_blender.api.action
class ValidateMeshHasUvs(
@ -22,7 +22,7 @@ class ValidateMeshHasUvs(
hosts = ["blender"]
families = ["model"]
label = "Mesh Has UVs"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction]
actions = [ayon_blender.api.action.SelectInvalidAction]
optional = True
@staticmethod

View file

@ -9,7 +9,7 @@ from ayon_core.pipeline.publish import (
OptionalPyblishPluginMixin,
PublishValidationError
)
import ayon_core.hosts.blender.api.action
import ayon_blender.api.action
class ValidateMeshNoNegativeScale(pyblish.api.InstancePlugin,
@ -20,7 +20,7 @@ class ValidateMeshNoNegativeScale(pyblish.api.InstancePlugin,
hosts = ["blender"]
families = ["model"]
label = "Mesh No Negative Scale"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction]
actions = [ayon_blender.api.action.SelectInvalidAction]
@staticmethod
def get_invalid(instance) -> List:

View file

@ -11,7 +11,7 @@ from ayon_core.pipeline.publish import (
PublishValidationError,
RepairAction
)
import ayon_core.hosts.blender.api.action
import ayon_blender.api.action
class ValidateModelMeshUvMap1(
@ -27,7 +27,7 @@ class ValidateModelMeshUvMap1(
hosts = ["blender"]
families = ["model"]
label = "Mesh UVs named map1"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction,
actions = [ayon_blender.api.action.SelectInvalidAction,
RepairAction]
optional = True
enabled = False

View file

@ -4,7 +4,7 @@ import bpy
import pyblish.api
import ayon_core.hosts.blender.api.action
import ayon_blender.api.action
from ayon_core.pipeline.publish import (
ValidateContentsOrder,
OptionalPyblishPluginMixin,
@ -25,7 +25,7 @@ class ValidateNoColonsInName(pyblish.api.InstancePlugin,
hosts = ["blender"]
families = ["model", "rig"]
label = "No Colons in names"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction]
actions = [ayon_blender.api.action.SelectInvalidAction]
@staticmethod
def get_invalid(instance) -> List:

View file

@ -7,7 +7,7 @@ from ayon_core.pipeline.publish import (
OptionalPyblishPluginMixin,
PublishValidationError
)
import ayon_core.hosts.blender.api.action
import ayon_blender.api.action
class ValidateObjectIsInObjectMode(
@ -20,7 +20,7 @@ class ValidateObjectIsInObjectMode(
hosts = ["blender"]
families = ["model", "rig", "layout"]
label = "Validate Object Mode"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction]
actions = [ayon_blender.api.action.SelectInvalidAction]
optional = False
@staticmethod

View file

@ -6,8 +6,8 @@ import bpy
import pyblish.api
from ayon_core.hosts.blender.api import plugin, lib
import ayon_core.hosts.blender.api.action
from ayon_blender.api import plugin, lib
import ayon_blender.api.action
from ayon_core.pipeline.publish import (
ValidateContentsOrder,
OptionalPyblishPluginMixin,
@ -24,7 +24,7 @@ class ValidateTransformZero(pyblish.api.InstancePlugin,
hosts = ["blender"]
families = ["model"]
label = "Transform Zero"
actions = [ayon_core.hosts.blender.api.action.SelectInvalidAction,
actions = [ayon_blender.api.action.SelectInvalidAction,
RepairAction]
_identity = mathutils.Matrix()