diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-22 20:22:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-22 20:23:27 +0300 |
commit | a997b5d17bafa1b00df84da8d21e19131d1ef608 (patch) | |
tree | ebc723378d233ec91000b35a5ae08f6ce990f8e1 /source/blender/makesrna/intern/rna_scene.c | |
parent | cc4dc2dce26c724e27598e4a1878e00fdf30dcf2 (diff) |
Tool System: transform can now toggle loc/rot/scale
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 4b0c955d51a..1fbb416f3d8 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -413,6 +413,13 @@ const EnumPropertyItem rna_enum_bake_pass_filter_type_items[] = { {0, NULL, 0, NULL, NULL} }; +static const EnumPropertyItem rna_enum_manipulator_items[] = { + {SCE_MANIP_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, + {SCE_MANIP_ROTATE, "ROTATE", 0, "Rotate", ""}, + {SCE_MANIP_SCALE, "SCALE", 0, "Scale", ""}, + {0, NULL, 0, NULL, NULL} +}; + #ifndef RNA_RUNTIME static const EnumPropertyItem rna_enum_gpencil_interpolation_mode_items[] = { /* interpolation */ @@ -640,6 +647,14 @@ static void rna_GPencilBrush_name_set(PointerRNA *ptr, const char *value) /* ----------------- end of Grease pencil drawing brushes ------------*/ +static void rna_ToolSettings_manipulator_flag_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +{ + ToolSettings *ts = scene->toolsettings; + if ((ts->manipulator_flag & (SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE)) == 0) { + ts->manipulator_flag |= SCE_MANIP_TRANSLATE; + } +} + static void rna_SpaceImageEditor_uv_sculpt_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) { ED_space_image_uv_sculpt_update(bmain, bmain->wm.first, scene); @@ -2671,6 +2686,13 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_ORTHO, 0); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ + prop = RNA_def_property(srna, "use_manipulator_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "manipulator_flag"); + RNA_def_property_enum_items(prop, rna_enum_manipulator_items); + RNA_def_property_flag(prop, PROP_ENUM_FLAG); + RNA_def_property_ui_text(prop, "Manipulator", ""); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ToolSettings_manipulator_flag_update"); + /* Grease Pencil */ prop = RNA_def_property(srna, "use_gpencil_continuous_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON); |