Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Blender 2.80 support (this will resolve #361) #466

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1a7911d
Add Blender 2.80 support
jasperges Oct 30, 2019
baf6c49
Some style changes and cleanup
jasperges Oct 30, 2019
d83484c
Fix: renamed open_file and save_file in __all__
jasperges Oct 30, 2019
4e2ab62
Fix: fix line lenght + unused var
jasperges Oct 30, 2019
0fbe9aa
Merge remote-tracking branch 'upstream/master' into add-blender28-sup…
jasperges Oct 30, 2019
a1bf183
Style fix
jasperges Oct 30, 2019
ee2954b
Import QtWidgets with namespace
jasperges Nov 1, 2019
809e53d
Style changes
jasperges Nov 1, 2019
aafbf85
Merge branch 'master' into add-blender28-support
jasperges Nov 5, 2019
16bd950
Merge branch 'master' into add-blender28-support
jasperges Nov 11, 2019
d3a4865
Merge branch 'master' into add-blender28-support
jasperges Dec 4, 2019
4be0f7c
Merge remote-tracking branch 'upstream/master' into add-blender28-sup…
jasperges Dec 16, 2019
ea5b85f
Merge branch 'master' into add-blender28-support
jasperges Dec 17, 2019
5bc3bb3
Add bpy.context wrapper
jasperges Dec 17, 2019
bf54052
Use bpy.context wrapper in TestApp
jasperges Dec 17, 2019
0570d60
Add `bpy.context` wrapper
jasperges Dec 17, 2019
834371b
Revert adding the bpy wrapper
jasperges Dec 30, 2019
2433fdc
Add library function to get selected objects
jasperges Dec 30, 2019
0a655ea
Make Avalon imports relative
jasperges Dec 30, 2019
d2ec489
Add note to change to `bpy.app.timers`
jasperges Dec 30, 2019
a78b312
Remove hardcoded 'scene' directory
jasperges Dec 30, 2019
3d46168
Use `bpy.app.timers` and remove test app
jasperges Dec 31, 2019
0840537
Cleanup
jasperges Dec 31, 2019
cc205ba
Merge branch 'master' into blender28-dev
jasperges Jan 6, 2020
d14d97b
Merge branch 'master' into blender28-dev
jasperges Jan 8, 2020
23331c4
Refactor to find_submodule (needed after merge of #501)
jasperges Jan 8, 2020
37c2fa8
Remove teardown function
jasperges Jan 8, 2020
12633c7
Make sure only 1 timer is registered for Qt apps
jasperges Jan 8, 2020
5019142
Fix check for self._window
jasperges Jan 8, 2020
cff9ad6
Exclude blender from tests
jasperges Jan 8, 2020
945c7a3
Merge branch 'master' into blender28-dev
jasperges Jan 13, 2020
a320eb3
Rename avalon_setup → setup_avalon and add comment about sys.excepthook
jasperges Jan 8, 2020
33d6e0c
Merge branch 'master' into blender28-dev
jasperges Jan 24, 2020
fe4bd5c
Remove unneeded `config` variable from blender (un)install
jasperges Jan 24, 2020
fd10091
Remove unused import + fix indentation
jasperges Jan 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor to find_submodule (needed after merge of #501)
  • Loading branch information
jasperges committed Jan 8, 2020
commit 23331c49f45e1b32135e4d10089eb088d1babad4
32 changes: 3 additions & 29 deletions avalon/blender/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
import pyblish.util

from .. import api, schema
from ..lib import logger
from ..lib import find_submodule, logger
from ..pipeline import AVALON_CONTAINER_ID
from . import lib, ops

self = sys.modules[__name__]
self._events = dict() # Registered Blender callbacks
self._parent = None # Main window
self._ignore_lock = False

AVALON_CONTAINERS = "AVALON_CONTAINERS"
AVALON_PROPERTY = 'avalon'
Expand Down Expand Up @@ -92,18 +91,6 @@ def _register_events():
logger.info("Installed event callback for 'taskChanged'...")


def find_host_config(config: ModuleType) -> Optional[ModuleType]:
"""Find the config for the current host (Blender)."""

config_name = f"{config.__name__}.blender"
try:
return importlib.import_module(config_name)
except ImportError as exc:
if str(exc) != f"No module named '{config_name}'":
raise
return None


def install(config: ModuleType):
"""Install Blender-specific functionality for Avalon.

Expand All @@ -118,10 +105,6 @@ def install(config: ModuleType):

pyblish.api.register_host("blender")

host_config = find_host_config(config)
if hasattr(host_config, "install"):
host_config.install()


def uninstall(config: ModuleType):
"""Uninstall Blender-specific functionality of avalon-core.
Expand All @@ -132,10 +115,6 @@ def uninstall(config: ModuleType):
config: configuration module
"""

host_config = find_host_config(config)
if hasattr(config, "uninstall"):
host_config.uninstall()

if not IS_HEADLESS:
ops.unregister()

Expand Down Expand Up @@ -364,13 +343,8 @@ def ls() -> Iterator:

containers = _ls()

has_metadata_collector = False
config = find_host_config(api.registered_config())
if config is None:
logger.error("Could not find host config for Blender")
return tuple()
if hasattr(config, "collect_container_metadata"):
has_metadata_collector = True
config = find_submodule(api.registered_config(), "blender")
has_metadata_collector = hasattr(config, "collect_container_metadata")

for container in containers:
data = parse_container(container)
Expand Down