Commit: 781dc08f0933d2f9291b9a1185508e29374c11e3
Author: Julian Eisel
Date:   Thu Sep 29 18:40:24 2016 +0200
Branches: custom-manipulators
https://developer.blender.org/rB781dc08f0933d2f9291b9a1185508e29374c11e3

Some fixes for manipulator tweaking after recent changes

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

M       source/blender/editors/space_image/space_image.c
M       source/blender/editors/space_node/space_node.c
M       source/blender/editors/space_view3d/space_view3d.c
M       source/blender/editors/space_view3d/view3d_widgets.c
M       source/blender/editors/transform/transform_manipulator.c
M       source/blender/windowmanager/manipulators/WM_manipulator_types.h
M       source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h

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

diff --git a/source/blender/editors/space_image/space_image.c 
b/source/blender/editors/space_image/space_image.c
index 05ef596..5d11afa 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -674,8 +674,10 @@ static void image_main_region_init(wmWindowManager *wm, 
ARegion *ar)
        // UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, 
ar->winy);
 
        /* manipulators */
-       ar->manipulator_map = WM_manipulatormap_new_from_type(&(const struct 
wmManipulatorMapType_Params) {
-               "Image_UV", SPACE_IMAGE, RGN_TYPE_WINDOW, 0});
+       if (!ar->manipulator_map) {
+               ar->manipulator_map = WM_manipulatormap_new_from_type(&(const 
struct wmManipulatorMapType_Params) {
+                       "Image_UV", SPACE_IMAGE, RGN_TYPE_WINDOW});
+       }
        WM_manipulatormaps_add_handlers(ar, ar->manipulator_map);
 
        /* mask polls mode */
diff --git a/source/blender/editors/space_node/space_node.c 
b/source/blender/editors/space_node/space_node.c
index c73465c..754e509 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -649,8 +649,10 @@ static void node_main_region_init(wmWindowManager *wm, 
ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, 
ar->winy);
 
        /* manipulators stay in the background for now - quick patchjob to make 
sure nodes themselves work */
-       ar->manipulator_map = WM_manipulatormap_new_from_type(&(const struct 
wmManipulatorMapType_Params) {
-               "Node_Canvas", SPACE_NODE, RGN_TYPE_WINDOW});
+       if (!ar->manipulator_map) {
+               ar->manipulator_map = WM_manipulatormap_new_from_type(&(const 
struct wmManipulatorMapType_Params) {
+                       "Node_Canvas", SPACE_NODE, RGN_TYPE_WINDOW});
+       }
 
        WM_manipulatormaps_add_handlers(ar, ar->manipulator_map);
 
diff --git a/source/blender/editors/space_view3d/space_view3d.c 
b/source/blender/editors/space_view3d/space_view3d.c
index e0036cc..73a4093 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -500,8 +500,10 @@ static void view3d_main_region_init(wmWindowManager *wm, 
ARegion *ar)
        ListBase *lb;
        wmKeyMap *keymap;
 
-       ar->manipulator_map = WM_manipulatormap_new_from_type(&(const struct 
wmManipulatorMapType_Params) {
-               "View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW});
+       if (!ar->manipulator_map) {
+               ar->manipulator_map = WM_manipulatormap_new_from_type(&(const 
struct wmManipulatorMapType_Params) {
+                       "View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW});
+       }
 
        WM_manipulatormaps_add_handlers(ar, ar->manipulator_map);
 
diff --git a/source/blender/editors/space_view3d/view3d_widgets.c 
b/source/blender/editors/space_view3d/view3d_widgets.c
index 0159b8e..b2c1883 100644
--- a/source/blender/editors/space_view3d/view3d_widgets.c
+++ b/source/blender/editors/space_view3d/view3d_widgets.c
@@ -113,6 +113,8 @@ void VIEW3D_WGT_lamp(wmManipulatorGroupType *wgt)
        wgt->poll = WIDGETGROUP_lamp_poll;
        wgt->init = WIDGETGROUP_lamp_init;
        wgt->refresh = WIDGETGROUP_lamp_refresh;
+
+       wgt->flag |= WM_MANIPULATORGROUPTYPE_3D;
 }
 
 static bool WIDGETGROUP_camera_poll(const bContext *C, wmManipulatorGroupType 
*UNUSED(wgrouptype))
@@ -266,6 +268,8 @@ void VIEW3D_WGT_camera(wmManipulatorGroupType *wgt)
        wgt->poll = WIDGETGROUP_camera_poll;
        wgt->init = WIDGETGROUP_camera_init;
        wgt->refresh = WIDGETGROUP_camera_refresh;
+
+       wgt->flag |= WM_MANIPULATORGROUPTYPE_3D;
 }
 
 static bool WIDGETGROUP_forcefield_poll(const bContext *C, 
wmManipulatorGroupType *UNUSED(wgrouptype))
@@ -323,6 +327,8 @@ void VIEW3D_WGT_force_field(wmManipulatorGroupType *wgt)
        wgt->poll = WIDGETGROUP_forcefield_poll;
        wgt->init = WIDGETGROUP_forcefield_init;
        wgt->refresh = WIDGETGROUP_forcefield_refresh;
+
+       wgt->flag |= WM_MANIPULATORGROUPTYPE_3D;
 }
 
 /* draw facemaps depending on the selected bone in pose mode */
@@ -566,4 +572,6 @@ void VIEW3D_WGT_armature_facemaps(wmManipulatorGroupType 
*wgt)
        wgt->refresh = WIDGETGROUP_armature_facemaps_refresh;
 
        wgt->keymap_init = WM_manipulatorgroup_keymap_common_sel;
+
+       wgt->flag |= WM_MANIPULATORGROUPTYPE_3D;
 }
diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 5b7e302..c3b4ed6 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1396,6 +1396,8 @@ void TRANSFORM_WGT_manipulator(wmManipulatorGroupType 
*wgt)
        wgt->init = WIDGETGROUP_manipulator_init;
        wgt->refresh = WIDGETGROUP_manipulator_refresh;
        wgt->draw_prepare = WIDGETGROUP_manipulator_draw_prepare;
+
+       wgt->flag |= WM_MANIPULATORGROUPTYPE_3D;
 }
 
 
@@ -1434,4 +1436,6 @@ void TRANSFORM_WGT_object(wmManipulatorGroupType *wgt)
        wgt->init = WIDGETGROUP_object_manipulator_init;
        wgt->refresh = WIDGETGROUP_manipulator_refresh;
        wgt->draw_prepare = WIDGETGROUP_manipulator_draw_prepare;
+
+       wgt->flag |= WM_MANIPULATORGROUPTYPE_3D;
 }
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h 
b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 2a3be7d..1c2b3ba 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -88,6 +88,9 @@ typedef struct wmManipulatorGroupType {
        char mapidname[64];
 } wmManipulatorGroupType;
 
+/* XXX other flags are in wm_manipulator_wmapi.h */
+#define WM_MANIPULATORGROUPTYPE_3D (1 << 0)
+
 struct wmManipulatorMapType_Params {
        const char *idname;
        const int spaceid;
diff --git a/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h 
b/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
index 7e244d4..c617038 100644
--- a/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
+++ b/source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
@@ -64,7 +64,7 @@ void  wm_manipulatorgroup_attach_to_modal_handler(
 
 /* wmManipulatorGroupType->flag */
 enum {
-       WM_MANIPULATORGROUPTYPE_3D      = (1 << 0),
+//     WM_MANIPULATORGROUPTYPE_3D      = (1 << 0),
        /* manipulator group is attached to operator, and is only accessible as 
long as this runs */
        WM_MANIPULATORGROUPTYPE_OP      = (1 << 1),
        /* TODO mixed group and group-type flags, should be separate enums */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to