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
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/include/ED_transform.h1
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c8
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_ops.c21
5 files changed, 23 insertions, 11 deletions
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 5719aa63234..de1294c9b2b 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -40,6 +40,7 @@ struct bContext;
struct Object;
struct uiLayout;
struct EnumPropertyItem;
+struct wmOperatorType;
void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid);
void transform_operatortypes(void);
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 6993efefe21..2e869933db9 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -702,6 +702,7 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event)
Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
+ int constraint_axis[3] = {0, 0, 1};
extrude_mesh(obedit,em, op);
@@ -712,6 +713,12 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_enum_set(op->ptr, "proportional", 0);
RNA_boolean_set(op->ptr, "mirror", 0);
+
+ /* the following two should only be set when extruding faces */
+ RNA_enum_set(op->ptr, "constraint_orientation", V3D_MANIP_NORMAL);
+ RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
+
+
WM_operator_name_call(C, "TFM_OT_translation", WM_OP_INVOKE_REGION_WIN, op->ptr);
return OPERATOR_FINISHED;
@@ -750,6 +757,7 @@ void MESH_OT_extrude(wmOperatorType *ot)
/* to give to transform */
Properties_Proportional(ot);
+ Properties_Constraints(ot);
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index d45a6f42232..c62ea07e398 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1170,7 +1170,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
if (RNA_struct_find_property(op->ptr, "constraint_axis"))
{
- RNA_int_set(op->ptr, "constraint_orientation", t->current_orientation);
+ RNA_enum_set(op->ptr, "constraint_orientation", t->current_orientation);
if (t->con.mode & CON_APPLY)
{
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 560b37caf0a..d1394d65f96 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -886,7 +886,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
if (op && RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_property_is_set(op->ptr, "constraint_orientation"))
{
- t->current_orientation = RNA_int_get(op->ptr, "constraint_orientation");
+ t->current_orientation = RNA_enum_get(op->ptr, "constraint_orientation");
if (t->current_orientation >= V3D_MANIP_CUSTOM + BIF_countTransformOrientation(C) - 1)
{
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index f2630f40c9c..f817776dbd8 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -81,6 +81,13 @@ EnumPropertyItem proportional_falloff_types[] = {
{0, NULL, 0, NULL, NULL}
};
+EnumPropertyItem orientation_items[]= {
+ {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""},
+ {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""},
+ {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""},
+ {V3D_MANIP_VIEW, "VIEW", 0, "View", ""},
+ {0, NULL, 0, NULL, NULL}};
+
char OP_TRANSLATION[] = "TFM_OT_translation";
char OP_ROTATION[] = "TFM_OT_rotation";
char OP_TOSPHERE[] = "TFM_OT_tosphere";
@@ -137,12 +144,6 @@ static EnumPropertyItem *select_orientation_itemf(bContext *C, PointerRNA *ptr,
void TFM_OT_select_orientation(struct wmOperatorType *ot)
{
PropertyRNA *prop;
- static EnumPropertyItem orientation_items[]= {
- {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""},
- {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""},
- {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""},
- {V3D_MANIP_VIEW, "VIEW", 0, "View", ""},
- {0, NULL, 0, NULL, NULL}};
/* identifiers */
ot->name = "Select Orientation";
@@ -293,8 +294,11 @@ void Properties_Snapping(struct wmOperatorType *ot, short align)
void Properties_Constraints(struct wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
- RNA_def_int(ot->srna, "constraint_orientation", 0, 0, INT_MAX, "Constraint Orientation", "", 0, INT_MAX);
+ prop= RNA_def_enum(ot->srna, "constraint_orientation", orientation_items, V3D_MANIP_GLOBAL, "Orientation", "DOC_BROKEN");
+ RNA_def_enum_funcs(prop, select_orientation_itemf);
}
void TFM_OT_translation(struct wmOperatorType *ot)
@@ -558,8 +562,7 @@ void TFM_OT_transform(struct wmOperatorType *ot)
Properties_Proportional(ot);
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
- RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
- RNA_def_int(ot->srna, "constraint_orientation", 0, 0, INT_MAX, "Constraint Orientation", "", 0, INT_MAX);
+ Properties_Constraints(ot);
}
void transform_operatortypes(void)