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

This commit is contained in:
Gaia Clary 2017-01-07 10:26:45 +01:00
parent 56f9bbdb5e
commit 559d29dff9
2 changed files with 13 additions and 12 deletions

View File

@ -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()

View File

@ -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():