diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/armature/armature_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 22 | ||||
-rw-r--r-- | source/blender/editors/metaball/mball_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 32 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 36 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 17 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 13 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 40 |
15 files changed, 91 insertions, 96 deletions
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 3401c6ed157..b53ae813f10 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -161,7 +161,7 @@ void ED_operatormacros_armature(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", @@ -170,7 +170,7 @@ void ED_operatormacros_armature(void) otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); RNA_boolean_set(otmacro->ptr, "forked", false); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); /* XXX would it be nicer to just be able to have standard extrude_move, * but set the forked property separate? @@ -182,7 +182,7 @@ void ED_operatormacros_armature(void) otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); RNA_boolean_set(otmacro->ptr, "forked", true); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); } void ED_keymap_armature(wmKeyConfig *keyconf) diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 782b093fab4..3d2ac009072 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -147,7 +147,7 @@ void ED_operatormacros_curve(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "CURVE_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", @@ -156,7 +156,7 @@ void ED_operatormacros_curve(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "CURVE_OT_extrude"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); } diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index fce8fa79217..db4c601709c 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -362,7 +362,7 @@ void ED_operatormacros_gpencil(void) WM_operatortype_macro_define(ot, "GPENCIL_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); /* Extrude + Move = Interactively add new points */ @@ -373,7 +373,7 @@ void ED_operatormacros_gpencil(void) WM_operatortype_macro_define(ot, "GPENCIL_OT_extrude"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); } diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 454e7e2a731..0c5591ed89b 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -520,6 +520,6 @@ void ED_operatormacros_mask(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MASK_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); } diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 8a51b9ba54e..ed5e6c39f85 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -242,7 +242,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_rip_move", @@ -251,7 +251,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_rip_edge_move", @@ -260,7 +260,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_rip_edge"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", @@ -269,7 +269,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_extrude_context_move", @@ -278,7 +278,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_context"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_extrude_region_shrink_fatten", @@ -287,7 +287,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", @@ -296,7 +296,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", @@ -305,7 +305,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", @@ -314,7 +314,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_polybuild_face_at_cursor_move", @@ -323,7 +323,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_polybuild_face_at_cursor"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); ot = WM_operatortype_append_macro("MESH_OT_polybuild_split_at_cursor_move", @@ -332,7 +332,7 @@ void ED_operatormacros_mesh(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_polybuild_split_at_cursor"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); RNA_boolean_set(otmacro->ptr, "mirror", false); } diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index 4de277901f4..c203ca56d74 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -59,7 +59,7 @@ void ED_operatormacros_metaball(void) OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MBALL_OT_duplicate_metaelems"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); } void ED_keymap_metaball(wmKeyConfig *keyconf) diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 8e3f916b2e4..afc0297cb01 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -271,7 +271,7 @@ void ED_operatormacros_object(void) if (ot) { WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); } /* grr, should be able to pass options on... */ @@ -283,7 +283,7 @@ void ED_operatormacros_object(void) otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); RNA_boolean_set(otmacro->ptr, "linked", true); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); } } diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index b91ac3c39a3..cba86ac5131 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -102,7 +102,7 @@ void ED_operatormacros_action(void) WM_operatortype_macro_define(ot, "ACTION_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); - RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); } /* ************************** registration - keymaps **********************************/ diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 79df4760939..5c7035a4c04 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -494,7 +494,7 @@ void ED_operatormacros_graph(void) WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); - RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); } /* ************************** registration - keymaps **********************************/ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c80a0eaa597..edbc0f90a7d 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2101,20 +2101,16 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } } - /* convert flag to enum */ - switch (t->flag & T_PROP_EDIT_ALL) { - case T_PROP_EDIT: - proportional = PROP_EDIT_ON; - break; - case (T_PROP_EDIT | T_PROP_CONNECTED): - proportional = PROP_EDIT_CONNECTED; - break; - case (T_PROP_EDIT | T_PROP_PROJECTED): - proportional = PROP_EDIT_PROJECTED; - break; - default: - proportional = PROP_EDIT_OFF; - break; + if (t->flag & T_PROP_EDIT_ALL) { + if (t->flag & T_PROP_EDIT) { + proportional |= PROP_EDIT_USE; + } + if (t->flag & T_PROP_CONNECTED) { + proportional |= PROP_EDIT_CONNECTED; + } + if (t->flag & T_PROP_PROJECTED) { + proportional |= PROP_EDIT_PROJECTED; + } } // If modal, save settings back in scene if not set as operator argument @@ -2123,7 +2119,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) /* skip saving proportional edit if it was not actually used */ if (!(t->options & CTX_NO_PET)) { - if ((prop = RNA_struct_find_property(op->ptr, "proportional")) && + if ((prop = RNA_struct_find_property(op->ptr, "use_proportional_edit")) && !RNA_property_is_set(op->ptr, prop)) { if (t->spacetype == SPACE_GRAPH) { ts->proportional_fcurve = proportional; @@ -2132,13 +2128,13 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) ts->proportional_action = proportional; } else if (t->obedit_type != -1) { - ts->proportional = proportional; + ts->proportional_edit = proportional; } else if (t->options & CTX_MASK) { - ts->proportional_mask = (proportional != PROP_EDIT_OFF); + ts->proportional_mask = proportional != 0; } else { - ts->proportional_objects = (proportional != PROP_EDIT_OFF); + ts->proportional_objects = proportional != 0; } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 7f049f480d7..d3079aebd00 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1239,16 +1239,17 @@ void resetTransRestrictions(TransInfo *t) static int initTransInfo_edit_pet_to_flag(const int proportional) { - switch (proportional) { - case PROP_EDIT_ON: - return T_PROP_EDIT; - case PROP_EDIT_CONNECTED: - return T_PROP_EDIT | T_PROP_CONNECTED; - case PROP_EDIT_PROJECTED: - return T_PROP_EDIT | T_PROP_PROJECTED; - default: - return 0; + int flag = 0; + if (proportional & PROP_EDIT_USE) { + flag |= T_PROP_EDIT; } + if (proportional & PROP_EDIT_CONNECTED) { + flag |= T_PROP_CONNECTED; + } + if (proportional & PROP_EDIT_PROJECTED) { + flag |= T_PROP_PROJECTED; + } + return flag; } void initTransDataContainers_FromObjectData(TransInfo *t, @@ -1651,9 +1652,16 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } /* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */ - if (op && (prop = RNA_struct_find_property(op->ptr, "proportional"))) { + if (op && (prop = RNA_struct_find_property(op->ptr, "use_proportional_edit"))) { if (RNA_property_is_set(op->ptr, prop)) { - t->flag |= initTransInfo_edit_pet_to_flag(RNA_property_enum_get(op->ptr, prop)); + int proportional = PROP_EDIT_USE; + if (RNA_boolean_get(op->ptr, "use_proportional_connected")) { + proportional |= PROP_EDIT_CONNECTED; + } + if (RNA_boolean_get(op->ptr, "use_proportional_projected")) { + proportional |= PROP_EDIT_PROJECTED; + } + t->flag |= initTransInfo_edit_pet_to_flag(proportional); } else { /* use settings from scene only if modal */ @@ -1666,16 +1674,16 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional_action); } else if (t->obedit_type != -1) { - t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional); + t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional_edit); } else if (t->options & CTX_GPENCIL_STROKES) { - t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional); + t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional_edit); } else if (t->options & CTX_MASK) { if (ts->proportional_mask) { t->flag |= T_PROP_EDIT; - if (ts->proportional == PROP_EDIT_CONNECTED) { + if (ts->proportional_edit & PROP_EDIT_CONNECTED) { t->flag |= T_PROP_CONNECTED; } } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index b4c539fba8e..0c2f77852a3 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -547,10 +547,9 @@ static bool transform_poll_property(const bContext *UNUSED(C), /* Proportional Editing. */ { - PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "proportional"); - if (prop_pet && (prop_pet != prop) && - (RNA_property_enum_get(op->ptr, prop_pet) == PROP_EDIT_OFF)) { - if (STRPREFIX(prop_id, "proportional")) { + PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "use_proportional_edit"); + if (prop_pet && (prop_pet != prop) && (RNA_property_boolean_get(op->ptr, prop_pet) == false)) { + if (STRPREFIX(prop_id, "proportional") || STRPREFIX(prop_id, "use_proportional")) { return false; } } @@ -610,12 +609,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) } if (flags & P_PROPORTIONAL) { - RNA_def_enum(ot->srna, - "proportional", - rna_enum_proportional_editing_items, - 0, - "Proportional Editing", - ""); + RNA_def_boolean(ot->srna, "use_proportional_edit", 0, "Proportional Editing", ""); prop = RNA_def_enum(ot->srna, "proportional_edit_falloff", rna_enum_proportional_falloff_items, @@ -633,6 +627,9 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) "", 0.001f, 100.0f); + + RNA_def_boolean(ot->srna, "use_proportional_connected", 0, "Connected", ""); + RNA_def_boolean(ot->srna, "use_proportional_projected", 0, "Projected (2D)", ""); } if (flags & P_SNAP) { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 28eb481ffd4..e3285a510ac 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1467,7 +1467,7 @@ typedef struct ToolSettings { char snap_target; char snap_transform_mode_flag; - char proportional, prop_mode; + char proportional_edit, prop_mode; /** Proportional edit, object mode. */ char proportional_objects; /** Proportional edit, mask editing. */ @@ -2078,11 +2078,12 @@ enum { #define PROP_INVSQUARE 7 #define PROP_MODE_MAX 8 -/* ToolSettings.proportional */ -#define PROP_EDIT_OFF 0 -#define PROP_EDIT_ON 1 -#define PROP_EDIT_CONNECTED 2 -#define PROP_EDIT_PROJECTED 3 +/** #ToolSettings.proportional_edit & similarly named members. */ +enum { + PROP_EDIT_USE = (1 << 0), + PROP_EDIT_CONNECTED = (1 << 1), + PROP_EDIT_PROJECTED = (1 << 2), +}; /* ToolSettings.weightuser */ enum { diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 463d612094e..56791542fbd 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -44,7 +44,6 @@ extern const EnumPropertyItem rna_enum_metaelem_type_items[]; extern const EnumPropertyItem rna_enum_proportional_falloff_items[]; extern const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[]; -extern const EnumPropertyItem rna_enum_proportional_editing_items[]; extern const EnumPropertyItem rna_enum_snap_target_items[]; extern const EnumPropertyItem rna_enum_snap_element_items[]; extern const EnumPropertyItem rna_enum_snap_node_element_items[]; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 8802eb07149..bb42c044c6d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -148,22 +148,6 @@ const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[] = { {0, NULL, 0, NULL, NULL}, }; -const EnumPropertyItem rna_enum_proportional_editing_items[] = { - {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"}, - {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"}, - {PROP_EDIT_PROJECTED, - "PROJECTED", - ICON_PROP_PROJECTED, - "Projected (2D)", - "Proportional Editing using screen space locations"}, - {PROP_EDIT_CONNECTED, - "CONNECTED", - ICON_PROP_CON, - "Connected", - "Proportional Editing using connected geometry only"}, - {0, NULL, 0, NULL, NULL}, -}; - /* keep for operators, not used here */ const EnumPropertyItem rna_enum_mesh_select_mode_items[] = { {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"}, @@ -2798,19 +2782,29 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* Transform */ - prop = RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "proportional"); - RNA_def_property_enum_items(prop, rna_enum_proportional_editing_items); - RNA_def_property_ui_text(prop, - "Proportional Editing", - "Proportional Editing mode, allows transforms with distance fall-off"); + prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "proportional_edit", PROP_EDIT_USE); + RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode"); + RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0); RNA_def_property_ui_text( prop, "Proportional Editing Objects", "Proportional editing object mode"); - RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1); + RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ + + prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "proportional_edit", PROP_EDIT_PROJECTED); + RNA_def_property_ui_text( + prop, "Projected from View", "Proportional Editing using screen space locations"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ + + prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "proportional_edit", PROP_EDIT_CONNECTED); + RNA_def_property_ui_text( + prop, "Connected Only", "Proportional Editing using connected geometry only"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE); |