[Bf-extensions-cvs] [559d29d] master: add to T50357: moved console var panel from Tool shelf to scene properties

Gaia Clary noreply at git.blender.org
Sat Jan 7 10:28:32 CET 2017


Commit: 559d29dff9c59f7952179b07f4bce7401f68ef47
Author: Gaia Clary
Date:   Sat Jan 7 10:26:45 2017 +0100
Branches: master
https://developer.blender.org/rBA559d29dff9c59f7952179b07f4bce7401f68ef47

add to T50357: moved console var panel from Tool shelf to scene properties

===================================================================

M	space_view3d_math_vis/__init__.py
M	space_view3d_math_vis/draw.py

===================================================================

diff --git a/space_view3d_math_vis/__init__.py b/space_view3d_math_vis/__init__.py
index 6aa7d22..7fad335 100644
--- a/space_view3d_math_vis/__init__.py
+++ b/space_view3d_math_vis/__init__.py
@@ -44,8 +44,9 @@ from bpy.props import StringProperty, BoolProperty, BoolVectorProperty, FloatPro
 
 
 class PanelConsoleVars(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'scene'
     bl_label = "Console Vars"
     bl_idname = "mathvis.panel_console_vars"
     bl_category = "Math Vis"
@@ -87,7 +88,7 @@ class DeleteVar(bpy.types.Operator):
         locals = utils.console_namespace()
         utils.VarStates.delete(self.key)
         del locals[self.key]
-        draw.tag_redraw_all_view3d_areas()
+        draw.tag_redraw_areas()
         return {'FINISHED'}
 
 
@@ -101,7 +102,7 @@ class ToggleDisplay(bpy.types.Operator):
 
     def execute(self, context):
         utils.VarStates.toggle_display_state(self.key)
-        draw.tag_redraw_all_view3d_areas()
+        draw.tag_redraw_areas()
         return {'FINISHED'}
 
 
@@ -115,7 +116,7 @@ class ToggleLock(bpy.types.Operator):
 
     def execute(self, context):
         utils.VarStates.toggle_lock_state(self.key)
-        draw.tag_redraw_all_view3d_areas()
+        draw.tag_redraw_areas()
         return {'FINISHED'}
 
 
@@ -127,7 +128,7 @@ class ToggleMatrixBBoxDisplay(bpy.types.Operator):
 
     def execute(self, context):
         utils.VarStates.toggle_show_bbox()
-        draw.tag_redraw_all_view3d_areas()
+        draw.tag_redraw_areas()
         return {'FINISHED'}
 
 
@@ -139,7 +140,7 @@ class CleanupConsole(bpy.types.Operator):
 
     def execute(self, context):
         utils.cleanup_math_data()
-        draw.tag_redraw_all_view3d_areas()
+        draw.tag_redraw_areas()
         return {'FINISHED'}
 
 
@@ -149,7 +150,7 @@ def menu_func_cleanup(self, context):
 
 def console_hook():
     utils.VarStates.store_states()
-    draw.tag_redraw_all_view3d_areas()
+    draw.tag_redraw_areas()
     context = bpy.context
     for window in context.window_manager.windows:
         window.screen.areas.update()
diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py
index fa18551..46b3d9e 100644
--- a/space_view3d_math_vis/draw.py
+++ b/space_view3d_math_vis/draw.py
@@ -27,13 +27,13 @@ SpaceView3D = bpy.types.SpaceView3D
 callback_handle = []
 
 
-def tag_redraw_all_view3d_areas():
+def tag_redraw_areas():
     context = bpy.context
 
     # Py cant access notifers
     for window in context.window_manager.windows:
         for area in window.screen.areas:
-            if area.type == 'VIEW_3D':
+            if area.type in ['VIEW_3D', 'PROPERTIES']:
                 area.tag_redraw()
 
 
@@ -45,7 +45,7 @@ def callback_enable():
     handle_view = SpaceView3D.draw_handler_add(draw_callback_view, (), 'WINDOW', 'POST_VIEW')
     callback_handle[:] = handle_pixel, handle_view
 
-    tag_redraw_all_view3d_areas()
+    tag_redraw_areas()
 
 
 def callback_disable():
@@ -57,7 +57,7 @@ def callback_disable():
     SpaceView3D.draw_handler_remove(handle_view, 'WINDOW')
     callback_handle[:] = []
 
-    tag_redraw_all_view3d_areas()
+    tag_redraw_areas()
 
 
 def draw_callback_px():



More information about the Bf-extensions-cvs mailing list