[Bf-blender-cvs] [70b5cec5faf] blender2.8: Manipulator: add optional properties argument

Campbell Barton noreply at git.blender.org
Mon Jun 26 00:14:29 CEST 2017


Commit: 70b5cec5fafc09fedb2a0cc2713565c4340a5536
Author: Campbell Barton
Date:   Mon Jun 26 08:19:55 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB70b5cec5fafc09fedb2a0cc2713565c4340a5536

Manipulator: add optional properties argument

Needed for RNA/Py API

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

M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/editors/transform/transform_manipulator2d.c
M	source/blender/windowmanager/manipulators/WM_manipulator_api.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulator.c

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

diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 02a6ead9925..0f5f2f02e84 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1228,7 +1228,7 @@ static void WIDGETGROUP_manipulator_setup(const bContext *UNUSED(C), wmManipulat
 				if (ot_store.translate == NULL) {
 					ot_store.translate = WM_operatortype_find("TRANSFORM_OT_translate", true);
 				}
-				ptr = WM_manipulator_set_operator(axis, ot_store.translate);
+				ptr = WM_manipulator_set_operator(axis, ot_store.translate, NULL);
 				break;
 			case MAN_AXES_ROTATE:
 			{
@@ -1245,7 +1245,7 @@ static void WIDGETGROUP_manipulator_setup(const bContext *UNUSED(C), wmManipulat
 					}
 					ot_rotate = ot_store.rotate;
 				}
-				ptr = WM_manipulator_set_operator(axis, ot_rotate);
+				ptr = WM_manipulator_set_operator(axis, ot_rotate, NULL);
 				break;
 			}
 			case MAN_AXES_SCALE:
@@ -1253,7 +1253,7 @@ static void WIDGETGROUP_manipulator_setup(const bContext *UNUSED(C), wmManipulat
 				if (ot_store.resize == NULL) {
 					ot_store.resize = WM_operatortype_find("TRANSFORM_OT_resize", true);
 				}
-				ptr = WM_manipulator_set_operator(axis, ot_store.resize);
+				ptr = WM_manipulator_set_operator(axis, ot_store.resize, NULL);
 				break;
 			}
 		}
diff --git a/source/blender/editors/transform/transform_manipulator2d.c b/source/blender/editors/transform/transform_manipulator2d.c
index 697bc7d1f9f..104675cb1a8 100644
--- a/source/blender/editors/transform/transform_manipulator2d.c
+++ b/source/blender/editors/transform/transform_manipulator2d.c
@@ -205,7 +205,7 @@ void ED_widgetgroup_manipulator2d_setup(const bContext *UNUSED(C), wmManipulator
 		WM_manipulator_set_color_highlight(axis, col_hi);
 
 		/* assign operator */
-		PointerRNA *ptr = WM_manipulator_set_operator(axis, ot_translate);
+		PointerRNA *ptr = WM_manipulator_set_operator(axis, ot_translate, NULL);
 		int constraint[3] = {0.0f};
 		constraint[(axis_idx + 1) % 2] = 1;
 		if (RNA_struct_find_property(ptr, "constraint_axis"))
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_api.h b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
index d6e468089f8..ecb0af818b2 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_api.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
@@ -38,6 +38,7 @@
 
 struct ARegion;
 struct GHashIterator;
+struct IDProperty;
 struct Main;
 struct PropertyRNA;
 struct wmKeyConfig;
@@ -66,7 +67,8 @@ void WM_manipulator_free(
         ListBase *manipulatorlist, struct wmManipulatorMap *mmap, struct wmManipulator *mpr,
         struct bContext *C);
 
-struct PointerRNA *WM_manipulator_set_operator(struct wmManipulator *, struct wmOperatorType *ot);
+struct PointerRNA *WM_manipulator_set_operator(
+        struct wmManipulator *, struct wmOperatorType *ot, struct IDProperty *properties);
 
 /* callbacks */
 void WM_manipulator_set_fn_custom_modal(struct wmManipulator *mpr, wmManipulatorFnModal fn);
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
index ba0e720485a..d11defc4e98 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
@@ -232,7 +232,8 @@ void WM_manipulator_free(ListBase *manipulatorlist, wmManipulatorMap *mmap, wmMa
  * \{ */
 
 
-PointerRNA *WM_manipulator_set_operator(wmManipulator *mpr, wmOperatorType *ot)
+PointerRNA *WM_manipulator_set_operator(
+        wmManipulator *mpr, wmOperatorType *ot, IDProperty *properties)
 {
 	mpr->op_data.type = ot;
 
@@ -241,6 +242,10 @@ PointerRNA *WM_manipulator_set_operator(wmManipulator *mpr, wmOperatorType *ot)
 	}
 	WM_operator_properties_create_ptr(&mpr->op_data.ptr, ot);
 
+	if (properties) {
+		mpr->op_data.ptr.data = properties;
+	}
+
 	return &mpr->op_data.ptr;
 }




More information about the Bf-blender-cvs mailing list