added mesh mirror flag, now store this per mesh
authorCampbell Barton <ideasman42@gmail.com>
Wed, 14 Oct 2009 14:28:05 +0000 (14:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 14 Oct 2009 14:28:05 +0000 (14:28 +0000)
button in mesh interface
also dont register operators that change context

release/scripts/modules/bpy_ops.py
release/scripts/ui/buttons_data_mesh.py
source/blender/editors/include/ED_mesh.h
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesrna/intern/rna_mesh.c

index 022c0581a81954ebe281e62db0f713ed5060ad33..0360964be3fba206d6f3c347cf1c987e9676063f 100644 (file)
@@ -157,9 +157,6 @@ class WM_OT_context_set(bpy.types.Operator):
        '''Set a context value.'''
        __idname__ = "wm.context_set"
        __label__ = "Context Set"
-       __register__ = True
-       __undo__ = True
-       
        __props__ = [
                bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
                bpy.props.StringProperty(attr="value", name="Value", description="Assignment value (as a string)", maxlen= 1024, default= "")
@@ -173,9 +170,6 @@ class WM_OT_context_toggle(bpy.types.Operator):
        '''Toggle a context value.'''
        __idname__ = "wm.context_toggle"
        __label__ = "Context Toggle"
-       __register__ = True
-       __undo__ = True
-       
        __props__ = [
                bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
        ]
@@ -188,9 +182,6 @@ class WM_OT_context_toggle_values(bpy.types.Operator):
        '''Toggle a context value.'''
        __idname__ = "wm.context_toggle_values"
        __label__ = "Context Toggle Values"
-       __register__ = True
-       __undo__ = True
-       
        __props__ = [
                bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
                bpy.props.StringProperty(attr="value_1", name="Value", description="Toggle value (as a string)", maxlen= 1024, default= ""),
@@ -205,9 +196,6 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
        '''Toggle a context value.'''
        __idname__ = "wm.context_cycle_enum"
        __label__ = "Context Enum Cycle"
-       __register__ = True
-       __undo__ = True
-       
        __props__ = [
                bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
                bpy.props.BoolProperty(attr="reverse", name="Reverse", description="Cycle backwards", default= False)
index 055cbb02e3fd62d9619fdf0d19d9cbcfee4e498f..78c675e618f4ff84447d844f7654efcebec83ed8 100644 (file)
@@ -60,6 +60,9 @@ class DATA_PT_settings(DataButtonsPanel):
                
                col = split.column()
                col.itemR(mesh, "texture_mesh")
+               
+               col = split.column()
+               col.itemR(mesh, "use_mirror_x")
 
 class DATA_PT_vertex_groups(DataButtonsPanel):
        __label__ = "Vertex Groups"
index ed8d366ab8b602ffbac4ec87550914d39ba1831c..50411c9d99898fb9a38e8ed5045a5a025ff7e74b 100644 (file)
@@ -66,7 +66,7 @@ struct Object;
 #define B_AUTOFGON                     0x20
 #define B_KNIFE                                0x80
 #define B_PERCENTSUBD          0x40
-#define B_MESH_X_MIRROR                0x100
+//#define B_MESH_X_MIRROR              0x100 // deprecated, use mesh
 #define B_JOINTRIA_UV          0x200
 #define B_JOINTRIA_VCOL                0X400
 #define B_JOINTRIA_SHARP       0X800
index c4f4cd48d53d493e9eb9e6f1d730ef42d9ecec89..288af7f7874fc29ca062d05d51a9c95ab8269e34 100644 (file)
@@ -4291,7 +4291,7 @@ static int smooth_vertex(bContext *C, wmOperator *op)
                if(eve->f & SELECT) {
                        if(eve->f1) {
                                
-                               if (ts->editbutflag & B_MESH_X_MIRROR) {
+                               if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
                                        eve_mir= editmesh_get_x_mirror_vert(obedit, em, eve->co);
                                }
                                
index 11789651d01903430a32f6468b417c40cf35f10d..47f76aab4ca3410ead6e509873b288522f417cb6 100644 (file)
@@ -974,7 +974,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        // Need stuff to take it from edit mesh or whatnot here
        else
        {
-               if (t->obedit && t->obedit->type == OB_MESH && ts->editbutflag & B_MESH_X_MIRROR)
+               if (t->obedit && t->obedit->type == OB_MESH && (((Mesh *)t->obedit->data)->editflag & ME_EDIT_MIRROR_X))
                {
                        t->flag |= T_MIRROR;
                }
index f7f1d3b53bd3e4598a8cfbb29c4f4f96a2281bc8..0f4dbaa821847ccc26be234cfa23386dd1f04fb6 100644 (file)
@@ -82,7 +82,7 @@ typedef struct Mesh {
         * the face does not need to be selected, -1 is inactive */
        int act_face; 
        
-       int texflag;
+       short texflag, editflag;
        
        /* texture space, copied as one block in editobject.c */
        float loc[3];
@@ -116,6 +116,11 @@ typedef struct TFace {
 /* texflag */
 #define AUTOSPACE      1
 
+/* me->editflag */
+#define ME_EDIT_MIRROR_X (1 << 0)
+#define ME_EDIT_MIRROR_Y (1 << 1) // unused so far
+#define ME_EDIT_MIRROR_Z (1 << 2) // unused so far
+
 /* me->flag */
 #define ME_ISDONE              1
 #define ME_NOPUNOFLIP  2
index 046f1ea1030ffae64496056ec959986f1bc88978..039109f75a1840e19b2e44f1b40ff7ff4a667cad 100644 (file)
@@ -1600,6 +1600,21 @@ static void rna_def_mesh(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 
+       /* editflag */
+       prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
+       RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
+
+       /*
+       prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
+       RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
+
+       prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
+       RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
+        */
+
        rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
 
        RNA_api_mesh(srna);