first step of pype's reorganization

This commit is contained in:
iLLiCiTiT 2020-05-25 18:20:02 +02:00
parent 19a46c7cd6
commit 15c0c10a5c
426 changed files with 517 additions and 530 deletions

View file

@ -7,12 +7,12 @@ from typing import Dict, List, Optional
from avalon import api, blender
import bpy
import pype.blender.plugin
import pype.hosts.blender.plugin
logger = logging.getLogger("pype").getChild("blender").getChild("load_action")
class BlendActionLoader(pype.blender.plugin.AssetLoader):
class BlendActionLoader(pype.hosts.blender.plugin.AssetLoader):
"""Load action from a .blend file.
Warning:
@ -42,8 +42,8 @@ class BlendActionLoader(pype.blender.plugin.AssetLoader):
libpath = self.fname
asset = context["asset"]["name"]
subset = context["subset"]["name"]
lib_container = pype.blender.plugin.asset_name(asset, subset)
container_name = pype.blender.plugin.asset_name(
lib_container = pype.hosts.blender.plugin.asset_name(asset, subset)
container_name = pype.hosts.blender.plugin.asset_name(
asset, subset, namespace
)
@ -149,7 +149,7 @@ class BlendActionLoader(pype.blender.plugin.AssetLoader):
assert libpath.is_file(), (
f"The file doesn't exist: {libpath}"
)
assert extension in pype.blender.plugin.VALID_EXTENSIONS, (
assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, (
f"Unsupported file: {libpath}"
)

View file

@ -7,14 +7,14 @@ from typing import Dict, List, Optional
from avalon import api, blender
import bpy
import pype.blender.plugin
import pype.hosts.blender.plugin
logger = logging.getLogger("pype").getChild(
"blender").getChild("load_animation")
class BlendAnimationLoader(pype.blender.plugin.AssetLoader):
class BlendAnimationLoader(pype.hosts.blender.plugin.AssetLoader):
"""Load animations from a .blend file.
Warning:
@ -109,8 +109,8 @@ class BlendAnimationLoader(pype.blender.plugin.AssetLoader):
libpath = self.fname
asset = context["asset"]["name"]
subset = context["subset"]["name"]
lib_container = pype.blender.plugin.asset_name(asset, subset)
container_name = pype.blender.plugin.asset_name(
lib_container = pype.hosts.blender.plugin.asset_name(asset, subset)
container_name = pype.hosts.blender.plugin.asset_name(
asset, subset, namespace
)
@ -179,7 +179,7 @@ class BlendAnimationLoader(pype.blender.plugin.AssetLoader):
assert libpath.is_file(), (
f"The file doesn't exist: {libpath}"
)
assert extension in pype.blender.plugin.VALID_EXTENSIONS, (
assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, (
f"Unsupported file: {libpath}"
)

View file

@ -7,12 +7,12 @@ from typing import Dict, List, Optional
from avalon import api, blender
import bpy
import pype.blender.plugin
import pype.hosts.blender.plugin
logger = logging.getLogger("pype").getChild("blender").getChild("load_model")
class BlendModelLoader(pype.blender.plugin.AssetLoader):
class BlendModelLoader(pype.hosts.blender.plugin.AssetLoader):
"""Load models from a .blend file.
Because they come from a .blend file we can simply link the collection that
@ -96,8 +96,8 @@ class BlendModelLoader(pype.blender.plugin.AssetLoader):
libpath = self.fname
asset = context["asset"]["name"]
subset = context["subset"]["name"]
lib_container = pype.blender.plugin.asset_name(asset, subset)
container_name = pype.blender.plugin.asset_name(
lib_container = pype.hosts.blender.plugin.asset_name(asset, subset)
container_name = pype.hosts.blender.plugin.asset_name(
asset, subset, namespace
)
@ -164,7 +164,7 @@ class BlendModelLoader(pype.blender.plugin.AssetLoader):
assert libpath.is_file(), (
f"The file doesn't exist: {libpath}"
)
assert extension in pype.blender.plugin.VALID_EXTENSIONS, (
assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, (
f"Unsupported file: {libpath}"
)
@ -233,7 +233,7 @@ class BlendModelLoader(pype.blender.plugin.AssetLoader):
return True
class CacheModelLoader(pype.blender.plugin.AssetLoader):
class CacheModelLoader(pype.hosts.blender.plugin.AssetLoader):
"""Load cache models.
Stores the imported asset in a collection named after the asset.
@ -269,7 +269,7 @@ class CacheModelLoader(pype.blender.plugin.AssetLoader):
subset = context["subset"]["name"]
# TODO (jasper): evaluate use of namespace which is 'alien' to Blender.
lib_container = container_name = (
pype.blender.plugin.asset_name(asset, subset, namespace)
pype.hosts.blender.plugin.asset_name(asset, subset, namespace)
)
relative = bpy.context.preferences.filepaths.use_relative_paths

View file

@ -7,12 +7,12 @@ from typing import Dict, List, Optional
from avalon import api, blender
import bpy
import pype.blender.plugin
import pype.hosts.blender.plugin
logger = logging.getLogger("pype").getChild("blender").getChild("load_model")
class BlendRigLoader(pype.blender.plugin.AssetLoader):
class BlendRigLoader(pype.hosts.blender.plugin.AssetLoader):
"""Load rigs from a .blend file.
Because they come from a .blend file we can simply link the collection that
@ -108,8 +108,8 @@ class BlendRigLoader(pype.blender.plugin.AssetLoader):
libpath = self.fname
asset = context["asset"]["name"]
subset = context["subset"]["name"]
lib_container = pype.blender.plugin.asset_name(asset, subset)
container_name = pype.blender.plugin.asset_name(
lib_container = pype.hosts.blender.plugin.asset_name(asset, subset)
container_name = pype.hosts.blender.plugin.asset_name(
asset, subset, namespace
)
@ -178,7 +178,7 @@ class BlendRigLoader(pype.blender.plugin.AssetLoader):
assert libpath.is_file(), (
f"The file doesn't exist: {libpath}"
)
assert extension in pype.blender.plugin.VALID_EXTENSIONS, (
assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, (
f"Unsupported file: {libpath}"
)