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
path: root/source
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2018-10-10 04:29:05 +0300
committermano-wii <germano.costa@ig.com.br>2018-10-10 04:30:00 +0300
commit7e6a8678c66df110d7649a7c01bdb778d7ed3fc7 (patch)
treedb08b644241fa637336a85c5004ba9e4491f8065 /source
parent44f478bb1a8f74d8d32d5028d5186133f5abc21c (diff)
RNA: Always keep at least one element in snap_mode.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 882cd50d6a8..199f74c709d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -532,6 +532,14 @@ const EnumPropertyItem rna_enum_transform_orientation_items[] = {
#include "FRS_freestyle.h"
#endif
+static void rna_ToolSettings_snap_mode_set(struct PointerRNA *ptr, int value)
+{
+ ToolSettings *ts = (ToolSettings *)ptr->data;
+ if (value != 0) {
+ ts->snap_mode = value;
+ }
+}
+
/* Grease Pencil update cache */
static void rna_GPencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
@@ -2420,6 +2428,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_mode");
RNA_def_property_enum_items(prop, rna_enum_snap_element_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_ToolSettings_snap_mode_set", NULL);
RNA_def_property_flag(prop, PROP_ENUM_FLAG);
RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */