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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-10-01 21:40:02 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-10-01 21:40:02 +0400
commit8fa211dd81a6767cef8913dd05189ec8ad3a12a5 (patch)
tree2ea439e2b7ffd25ffd09e80102d8c2a28397df40 /release/scripts/startup/bl_ui/space_info.py
parent20ca67bc3570f01ce2f9f6163382df51648b11a3 (diff)
Fix [#32719] "New object align to view" option doesn't work on lamps and force fields
There was strange context changes in the Add menu... Now everything uses the EXEC_REGION_WIN one (no need to invoke here, and metaballs have a strange specific invoke func...). This fixes the problem when using Add menu from a 3D view. Obviously, it still doesn't work when used from Info window's header, but that can't be helped for now (and never worked for any kind of object). Anyway, imho all this "add object" code could use some review/cleanup, both on py menu and C ops side, but this is obviously postponed to after 2.64!
Diffstat (limited to 'release/scripts/startup/bl_ui/space_info.py')
-rw-r--r--release/scripts/startup/bl_ui/space_info.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 04ea6b818ac..a67c30e2b85 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -272,7 +272,9 @@ class INFO_MT_add(Menu):
# note, don't use 'EXEC_SCREEN' or operators wont get the 'v3d' context.
- layout.operator_context = 'EXEC_AREA'
+ # Note: was EXEC_AREA, but this context does not have the 'rv3d', which prevents
+ # "align_view" to work on first call (see [#32719]).
+ layout.operator_context = 'EXEC_REGION_WIN'
#layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
@@ -282,7 +284,7 @@ class INFO_MT_add(Menu):
#layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
- layout.operator_context = 'INVOKE_REGION_WIN'
+# layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
layout.separator()
@@ -295,7 +297,7 @@ class INFO_MT_add(Menu):
layout.separator()
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
- layout.operator_context = 'EXEC_AREA'
+# layout.operator_context = 'EXEC_AREA'
layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
layout.separator()