Context operators for adjusting context values directly to avoid adding operators...
[blender.git] / source / blender / makesrna / intern / rna_scene.c
index 29fb9e4deb2cce15e25de495ee2812e0672236de..7831f6acd11f812324073b4e955986bfe0a2abcf 100644 (file)
@@ -502,6 +502,12 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
                {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
                {0, NULL, 0, NULL, NULL}};
 
+       static EnumPropertyItem proportional_editing_items[] = {
+               {PROP_EDIT_OFF, "DISABLED", 0, "Disable", ""},
+               {PROP_EDIT_ON, "ENABLED", 0, "Enable", ""},
+               {PROP_EDIT_CONNECTED, "CONNECTED", 0, "Connected", ""},
+               {0, NULL, 0, NULL, NULL}};
+
        srna= RNA_def_struct(brna, "ToolSettings", NULL);
        RNA_def_struct_ui_text(srna, "Tool Settings", "");
        
@@ -526,14 +532,17 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
        RNA_def_property_ui_text(prop, "Particle Edit", "");
 
        /* Transform */
-       prop= RNA_def_property(srna, "proportional_editing", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "proportional", 0);
+       prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "proportional");
+       RNA_def_property_enum_items(prop, proportional_editing_items);
        RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode.");
+       RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
 
        prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
        RNA_def_property_enum_items(prop, prop_mode_items);
        RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
+       RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
 
        prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
        RNA_def_property_float_sdna(prop, NULL, "normalsize");