Revision: 21615
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21615
Author:   theeth
Date:     2009-07-16 05:16:03 +0200 (Thu, 16 Jul 2009)

Log Message:
-----------
Extrude along normals.

Note that this is on in all cases now, it needs to be restricted to face 
extrude only.

Some slight transform operator cleanup too.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/include/ED_transform.h
    branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
    branches/blender2.5/blender/source/blender/editors/transform/transform.c
    
branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
    branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c

Modified: 
branches/blender2.5/blender/source/blender/editors/include/ED_transform.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_transform.h   
2009-07-16 03:11:21 UTC (rev 21614)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_transform.h   
2009-07-16 03:16:03 UTC (rev 21615)
@@ -40,6 +40,7 @@
 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);

Modified: 
branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c    
2009-07-16 03:11:21 UTC (rev 21614)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c    
2009-07-16 03:16:03 UTC (rev 21615)
@@ -702,6 +702,7 @@
        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 @@
 
        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 @@
 
        /* to give to transform */
        Properties_Proportional(ot);
+       Properties_Constraints(ot);
        RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
 }
 

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform.c    
2009-07-16 03:11:21 UTC (rev 21614)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.c    
2009-07-16 03:16:03 UTC (rev 21615)
@@ -1170,7 +1170,7 @@
 
        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)
                {

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
   2009-07-16 03:11:21 UTC (rev 21614)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
   2009-07-16 03:16:03 UTC (rev 21615)
@@ -886,7 +886,7 @@
 
                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)
                        {

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c    
    2009-07-16 03:11:21 UTC (rev 21614)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c    
    2009-07-16 03:16:03 UTC (rev 21615)
@@ -81,6 +81,13 @@
                {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 @@
 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_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 @@
        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)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to