diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-19 21:35:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-20 17:51:03 +0300 |
commit | 177a8f6dab191db2756cc247565458b07d5b6005 (patch) | |
tree | c10ace2dc1ec781744b385c0442bf93810f9e5b3 /source | |
parent | 6b0d4302beb5e79a6569b4afe17d05150cdf42d0 (diff) |
Manipulator: add access to manipulator's group
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_manipulator.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator.c b/source/blender/makesrna/intern/rna_wm_manipulator.c index 6efed5c1150..a4debc86505 100644 --- a/source/blender/makesrna/intern/rna_wm_manipulator.c +++ b/source/blender/makesrna/intern/rna_wm_manipulator.c @@ -393,6 +393,12 @@ static int rna_Manipulator_name_length(PointerRNA *ptr) return strlen(mpr->name); } +static PointerRNA rna_Manipulator_group_get(PointerRNA *ptr) +{ + wmManipulator *mpr = ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_ManipulatorGroup, mpr->parent_mgroup); +} + #ifdef WITH_PYTHON static void rna_Manipulator_unregister(struct Main *bmain, StructRNA *type); @@ -998,6 +1004,12 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL); + prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "ManipulatorGroup"); + RNA_def_property_pointer_funcs(prop, "rna_Manipulator_group_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "", "Manipulator group this manipulator is a member of"); + /* Color & Alpha */ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); |