2.5/Modes:
[blender.git] / source / blender / makesrna / intern / rna_object.c
index 105d08f237ff13bdabc92d4e2e9ff6f5b8ac3f87..2e40765935d9bc912107277f2f522be361049373 100644 (file)
 
 #include "WM_types.h"
 
+
+EnumPropertyItem object_mode_items[] = {
+       {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object", ""},
+       {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit", ""},
+       {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt", ""},
+       {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
+       {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""},
+       {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
+       {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""},
+       {OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose", ""},
+       {0, NULL, 0, NULL, NULL}};
+
 static EnumPropertyItem parent_type_items[] = {
        {PAROBJECT, "OBJECT", 0, "Object", ""},
        {PARCURVE, "CURVE", 0, "Curve", ""},
@@ -968,17 +980,6 @@ static void rna_def_object(BlenderRNA *brna)
                {OB_ARMATURE, "ARMATURE", 0, "Armature", ""},
                {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", ""},
-               {OB_MODE_POSE, "POSE", 0, "Pose", ""},
-               {0, NULL, 0, NULL, NULL}};
-
        static EnumPropertyItem empty_drawtype_items[] = {
                {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
                {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
@@ -1049,7 +1050,8 @@ static void rna_def_object(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "mode");
-       RNA_def_property_enum_items(prop, mode_items);
+       RNA_def_property_enum_items(prop, object_mode_items);
+       RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Mode", "Object interaction mode.");
 
        prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_NONE);