Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Inch <mythologylover75@gmail.com>2020-03-30 09:34:28 +0300
committerRyan Inch <mythologylover75@gmail.com>2020-03-30 09:34:28 +0300
commita32b859fecb1a1d269408d0b9730eb5c7fc52c0f (patch)
tree81d7374b19aef4f4ecca1a59a8c0fdd4c15ddb0a /object_collection_manager/qcd_init.py
parentbbd5fd92a3d95389d6489d78cc062539a6f1e0e4 (diff)
Collection Manager: QCD polishing. Task: T69577
Made QCD internal structure more stable. Prevented reload scripts from resetting QCD slots. Fixed QCD being left in an incorrect state on undo/redo. Fixed a small error on unregister.
Diffstat (limited to 'object_collection_manager/qcd_init.py')
-rw-r--r--object_collection_manager/qcd_init.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/object_collection_manager/qcd_init.py b/object_collection_manager/qcd_init.py
index 4857719a..87cbcd16 100644
--- a/object_collection_manager/qcd_init.py
+++ b/object_collection_manager/qcd_init.py
@@ -3,6 +3,7 @@ import bpy
import bpy.utils.previews
from bpy.app.handlers import persistent
+from . import internals
from . import preferences
from . import qcd_move_widget
from . import qcd_operators
@@ -27,8 +28,11 @@ def depsgraph_update_post_handler(dummy):
qcd_operators.move_selection.clear()
qcd_operators.move_active = None
- qcd_operators.get_move_selection()
- qcd_operators.get_move_active()
+
+@persistent
+def undo_redo_post_handler(dummy):
+ qcd_operators.move_selection.clear()
+ qcd_operators.move_active = None
@persistent
def save_internal_data(dummy):
@@ -63,6 +67,8 @@ def register_qcd():
addon_qcd_keymaps.append((km, kmi))
bpy.app.handlers.depsgraph_update_post.append(depsgraph_update_post_handler)
+ bpy.app.handlers.undo_post.append(undo_redo_post_handler)
+ bpy.app.handlers.redo_post.append(undo_redo_post_handler)
bpy.app.handlers.save_pre.append(save_internal_data)
bpy.app.handlers.load_post.append(load_internal_data)
@@ -117,6 +123,8 @@ def unregister_qcd():
bpy.utils.unregister_class(cls)
bpy.app.handlers.depsgraph_update_post.remove(depsgraph_update_post_handler)
+ bpy.app.handlers.undo_post.remove(undo_redo_post_handler)
+ bpy.app.handlers.redo_post.remove(undo_redo_post_handler)
bpy.app.handlers.save_pre.remove(save_internal_data)
bpy.app.handlers.load_post.remove(load_internal_data)