Cleanup: use `rna_enum_` prefix for RNA enums
[blender.git] / source / blender / editors / transform / transform_ops.c
index 013e47886ebe190c11200b2ab2df723735413fac..454fffd69267d16f0dd6ab670b0bfa9efb0671de 100644 (file)
@@ -33,7 +33,7 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
-#include "BLF_translation.h"
+#include "BLT_translation.h"
 
 #include "BKE_context.h"
 #include "BKE_global.h"
@@ -122,7 +122,7 @@ static TransformModeItem transform_modes[] =
        {NULL, 0}
 };
 
-EnumPropertyItem transform_mode_types[] =
+EnumPropertyItem rna_enum_transform_mode_types[] =
 {
        {TFM_INIT, "INIT", 0, "Init", ""},
        {TFM_DUMMY, "DUMMY", 0, "Dummy", ""},
@@ -524,10 +524,10 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
 
 
        if (flags & P_PROPORTIONAL) {
-               RNA_def_enum(ot->srna, "proportional", proportional_editing_items, 0, "Proportional Editing", "");
-               prop = RNA_def_enum(ot->srna, "proportional_edit_falloff", proportional_falloff_items, 0,
+               RNA_def_enum(ot->srna, "proportional", rna_enum_proportional_editing_items, 0, "Proportional Editing", "");
+               prop = RNA_def_enum(ot->srna, "proportional_edit_falloff", rna_enum_proportional_falloff_items, 0,
                                    "Proportional Editing Falloff", "Falloff type for proportional editing mode");
-               RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
+               RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
                RNA_def_float(ot->srna, "proportional_size", 1, 0.00001f, FLT_MAX, "Proportional Size", "", 0.001, 100);
        }
 
@@ -536,7 +536,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
                RNA_def_property_flag(prop, PROP_HIDDEN);
 
                if (flags & P_GEO_SNAP) {
-                       prop = RNA_def_enum(ot->srna, "snap_target", snap_target_items, 0, "Target", "");
+                       prop = RNA_def_enum(ot->srna, "snap_target", rna_enum_snap_target_items, 0, "Target", "");
                        RNA_def_property_flag(prop, PROP_HIDDEN);
                        prop = RNA_def_float_vector(ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
                        RNA_def_property_flag(prop, PROP_HIDDEN);
@@ -643,8 +643,6 @@ static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot)
 
 static void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
 {
-       PropertyRNA *prop;
-
        /* identifiers */
        ot->name   = "Trackball";
        ot->description = "Trackball style rotation of selected items";
@@ -659,16 +657,13 @@ static void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
        ot->poll   = ED_operator_screenactive;
 
        /* Maybe we could use float_vector_xyz here too? */
-       prop = RNA_def_float_vector(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
-       RNA_def_property_subtype(prop, PROP_ANGLE);
+       RNA_def_float_rotation(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
 
        Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT);
 }
 
 static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
 {
-       PropertyRNA *prop;
-
        /* identifiers */
        ot->name = "Rotate";
        ot->description = "Rotate selected items";
@@ -682,8 +677,7 @@ static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
        ot->cancel = transform_cancel;
        ot->poll   = ED_operator_screenactive;
 
-       prop = RNA_def_float(ot->srna, "value", 0.0f, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
-       RNA_def_property_subtype(prop, PROP_ANGLE);
+       RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
 
        Transform_Properties(ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT);
 }
@@ -857,6 +851,12 @@ static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
 
        prop = RNA_def_boolean(ot->srna, "single_side", false, "Single Side", "");
        RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
+       RNA_def_boolean(ot->srna, "use_even", false, "Even",
+                       "Make the edge loop match the shape of the adjacent edge loop");
+       RNA_def_boolean(ot->srna, "flipped", false, "Flipped",
+                       "When Even mode is active, flips between the two adjacent edge loops");
+       RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp",
+                       "Clamp within the edge extents");
 
        Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV);
 }
@@ -877,6 +877,12 @@ static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot)
        ot->poll   = ED_operator_editmesh_region_view3d;
 
        RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f);
+       RNA_def_boolean(ot->srna, "use_even", false, "Even",
+                       "Make the edge loop match the shape of the adjacent edge loop");
+       RNA_def_boolean(ot->srna, "flipped", false, "Flipped",
+                       "When Even mode is active, flips between the two adjacent edge loops");
+       RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp",
+                       "Clamp within the edge extents");
 
        Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV);
 }
@@ -979,7 +985,7 @@ static void TRANSFORM_OT_transform(struct wmOperatorType *ot)
        ot->cancel = transform_cancel;
        ot->poll   = ED_operator_screenactive;
 
-       prop = RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
+       prop = RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", "");
        RNA_def_property_flag(prop, PROP_HIDDEN);
 
        RNA_def_float_vector(ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX);