2.5:
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 16 Aug 2009 02:49:37 +0000 (02:49 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 16 Aug 2009 02:49:37 +0000 (02:49 +0000)
* Updated object mode flags with Object and Edit.
* Updated RNA for that property

source/blender/editors/object/object_edit.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/intern/rna_object.c

index b849d57cc7d2c8ade3d8cdf695595f2de8442758..eb4150feb0c9178a7381534c316b487bf45ea2a1 100644 (file)
@@ -3732,6 +3732,7 @@ void ED_object_exit_editmode(bContext *C, int flag)
                WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene);
        }
 
+       obedit->mode &= ~OB_MODE_EDIT;
        ED_object_toggle_modes(C, obedit->restore_mode);
 }
 
@@ -3768,6 +3769,8 @@ void ED_object_enter_editmode(bContext *C, int flag)
 
        ob->restore_mode = ob->mode;
        ED_object_toggle_modes(C, ob->mode);
+
+       ob->mode |= OB_MODE_EDIT;
        
        if(ob->type==OB_MESH) {
                Mesh *me= ob->data;
index 6e6f53da882383717ed07239613d44e0fb92be25..b4d299a7aa10ee351f02aced25e1c5cef23800a8 100644 (file)
@@ -512,12 +512,13 @@ extern Object workob;
 #define OB_LOCK_SCALE  448
 
 /* ob->mode */
-#define OB_MODE_NONE            0
-#define OB_MODE_SCULPT          1
-#define OB_MODE_VERTEX_PAINT    2
-#define OB_MODE_WEIGHT_PAINT    4
-#define OB_MODE_TEXTURE_PAINT   8
-#define OB_MODE_PARTICLE_EDIT  16
+#define OB_MODE_OBJECT          0
+#define OB_MODE_EDIT            1
+#define OB_MODE_SCULPT          2
+#define OB_MODE_VERTEX_PAINT    4
+#define OB_MODE_WEIGHT_PAINT    8
+#define OB_MODE_TEXTURE_PAINT  16
+#define OB_MODE_PARTICLE_EDIT  32
 
 /* ob->softflag in DNA_object_force.h */
 
index 5ad59661eaaf12c9b46203dffdb1df0d50687f45..01cf7a77e194db2aa9a1dd5bd9326f302563e028 100644 (file)
@@ -969,9 +969,13 @@ static void rna_def_object(BlenderRNA *brna)
                {0, NULL, 0, NULL, NULL}};
 
        static EnumPropertyItem mode_items[] = {
+               {OB_MODE_OBJECT, "OBJECT", 0, "Object", ""},
+               {OB_MODE_EDIT, "EDIT", 0, "Edit", ""},
                {OB_MODE_SCULPT, "SCULPT", 0, "Sculpt", ""},
                {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", 0, "Vertex Paint", ""},
                {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", 0, "Weight Paint", ""},
+               {OB_MODE_WEIGHT_PAINT, "TEXTURE_PAINT", 0, "Texture Paint", ""},
+               {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", 0, "Particle Edit", ""},
                {0, NULL, 0, NULL, NULL}};
 
        static EnumPropertyItem empty_drawtype_items[] = {