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:
authorCampbell Barton <ideasman42@gmail.com>2017-08-27 17:48:43 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-27 17:56:08 +0300
commitddff9d0ea68b4c92be2fc515a4ec6a17b3696aa0 (patch)
tree0bf133537dac8f69339905ee364db47fa992a3e1 /source/blender/makesrna/intern/rna_wm_manipulator_api.c
parentca9801bd427ce2e76a992b62d476859efcc14547 (diff)
Manipulator: support operator per-part
A single manipulator could only assign a single operator to each part. Now each part can have it's own. Also modify 2D selection callback, 2D started at 1, 3D at 0. Now use -1 for unset value, start both at 0.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_manipulator_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_manipulator_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator_api.c b/source/blender/makesrna/intern/rna_wm_manipulator_api.c
index a0d474968d0..27d292ddfa2 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator_api.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator_api.c
@@ -140,7 +140,7 @@ static void rna_manipulator_target_set_prop(
}
static PointerRNA rna_manipulator_target_set_operator(
- wmManipulator *mpr, ReportList *reports, const char *opname)
+ wmManipulator *mpr, ReportList *reports, const char *opname, int part_index)
{
wmOperatorType *ot;
@@ -157,9 +157,7 @@ static PointerRNA rna_manipulator_target_set_operator(
properties = IDP_New(IDP_GROUP, &val, "wmManipulatorProperties");
}
- WM_manipulator_set_operator(mpr, ot, properties);
-
- return mpr->op_data.ptr;
+ return *WM_manipulator_operator_set(mpr, part_index, ot, properties);
}
/** \} */
@@ -264,6 +262,8 @@ void RNA_api_manipulator(StructRNA *srna)
"(overrides property targets)");
parm = RNA_def_string(func, "operator", NULL, 0, "", "Target operator");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ RNA_def_int(func, "index", 0, 0, 255, "Part index", "", 0, 255);
+
/* similar to UILayout.operator */
parm = RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR);