Revert "Objects: Remove Textured from object display type"
authorClément Foucault <foucault.clem@gmail.com>
Thu, 28 Feb 2019 15:51:10 +0000 (16:51 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 28 Feb 2019 15:51:24 +0000 (16:51 +0100)
This reverts commit 6a4a984ff731070d0702821fe1e67dea40e593b9.

source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/versioning_280.c
source/blender/draw/engines/workbench/workbench_materials.c
source/blender/makesrna/intern/rna_object.c

index b397ab3..1b4aad1 100644 (file)
@@ -832,7 +832,7 @@ void BKE_object_init(Object *ob)
        unit_m4(ob->constinv);
        unit_m4(ob->parentinv);
        unit_m4(ob->obmat);
-       ob->dt = OB_SOLID;
+       ob->dt = OB_TEXTURE;
        ob->empty_drawtype = OB_PLAINAXES;
        ob->empty_drawsize = 1.0;
        ob->empty_image_depth = OB_EMPTY_IMAGE_DEPTH_DEFAULT;
index c935091..89525cd 100644 (file)
@@ -2825,13 +2825,5 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                                }
                        }
                }
-
-               {
-                       for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
-                               /* texture mode disabled for now */
-                               if (ob->dt > OB_SOLID)
-                                       ob->dt = OB_SOLID;
-                       }
-               }
        }
 }
index fc1fa64..e721a4c 100644 (file)
@@ -211,10 +211,10 @@ int workbench_material_get_accum_shader_index(WORKBENCH_PrivateData *wpd, bool u
        return index;
 }
 
-int workbench_material_determine_color_type(WORKBENCH_PrivateData *wpd, Image *ima, Object *UNUSED(ob))
+int workbench_material_determine_color_type(WORKBENCH_PrivateData *wpd, Image *ima, Object *ob)
 {
        int color_type = wpd->shading.color_type;
-       if (color_type == V3D_SHADING_TEXTURE_COLOR && ima == NULL) {
+       if ((color_type == V3D_SHADING_TEXTURE_COLOR && ima == NULL) || (ob->dt < OB_TEXTURE)) {
                color_type = V3D_SHADING_MATERIAL_COLOR;
        }
        return color_type;
index fef8db1..a70c8a2 100644 (file)
@@ -2108,6 +2108,8 @@ static void rna_def_object(BlenderRNA *brna)
                {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Display the bounds of the object"},
                {OB_WIRE, "WIRE", 0, "Wire", "Display the object as a wireframe"},
                {OB_SOLID, "SOLID", 0, "Solid", "Display the object as a solid (if solid drawing is enabled in the viewport)"},
+               {OB_TEXTURE, "TEXTURED", 0, "Textured",
+                            "Display the object with textures (if textures are enabled in the viewport)"},
                {0, NULL, 0, NULL, NULL},
        };