Skip to content

Commit

Permalink
Merge pull request #45 from HaiyiMei/master
Browse files Browse the repository at this point in the history
[fix] stuck in background mode
  • Loading branch information
atticus-lv authored Sep 17, 2023
2 parents 536c96b + b494a79 commit 6e55dfb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
.vscode
20 changes: 9 additions & 11 deletions preferences/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
from . import data_icon, data_config_prop, data_keymap, data_config_filter_panel, prefs

classes = (
data_icon, data_config_prop, data_config_filter_panel, data_keymap, prefs
data_icon,
data_config_prop,
data_config_filter_panel,
data_keymap,
prefs,
)


def register():
data_icon.register()
data_config_prop.register()
data_config_filter_panel.register()
data_keymap.register()
prefs.register()
for cls in classes:
cls.register()


def unregister():
prefs.unregister()
data_config_prop.unregister()
data_config_filter_panel.unregister()
data_keymap.unregister()
data_icon.unregister()
for cls in reversed(classes):
cls.unregister()
4 changes: 2 additions & 2 deletions preferences/data_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def register_icon():
if file.endswith('.bip'):
mats_icon.append(icon_dir.joinpath(file))
# 注册
pcoll = previews.new()
pcoll = previews.new(lazy_load=not bpy.app.background)

for icon_path in mats_icon:
pcoll.load(icon_path.name[:-4], str(icon_path), 'IMAGE')
Expand All @@ -32,8 +32,8 @@ def unregister_icon():

for pcoll in G_PV_COLL.values():
previews.remove(pcoll)
G_PV_COLL.clear()

G_PV_COLL.clear()
G_ICON_ID.clear()


Expand Down

0 comments on commit 6e55dfb

Please sign in to comment.