Manipulator: add optional properties argument
Needed for RNA/Py API
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user