Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_engine.c
| Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | has_color = (CustomData_has_layer(cd_vdata, CD_PROP_COLOR) || | ||||
| CustomData_has_layer(cd_ldata, CD_PROP_COLOR) || | CustomData_has_layer(cd_ldata, CD_PROP_COLOR) || | ||||
| CustomData_has_layer(cd_ldata, CD_PROP_BYTE_COLOR)); | CustomData_has_layer(cd_ldata, CD_PROP_BYTE_COLOR)); | ||||
| } | } | ||||
| if (color_type == V3D_SHADING_TEXTURE_COLOR) { | if (color_type == V3D_SHADING_TEXTURE_COLOR) { | ||||
| if (ob->dt < OB_TEXTURE) { | if (ob->dt < OB_TEXTURE) { | ||||
| color_type = V3D_SHADING_MATERIAL_COLOR; | color_type = V3D_SHADING_MATERIAL_COLOR; | ||||
| } | } | ||||
| else if ((me == NULL) || !CustomData_has_layer(ldata, CD_MLOOPUV)) { | else if ((me == NULL) || !CustomData_has_layer(ldata, CD_PROP_FLOAT2)) { | ||||
| /* Disable color mode if data layer is unavailable. */ | /* Disable color mode if data layer is unavailable. */ | ||||
| color_type = V3D_SHADING_MATERIAL_COLOR; | color_type = V3D_SHADING_MATERIAL_COLOR; | ||||
| } | } | ||||
| } | } | ||||
| else if (color_type == V3D_SHADING_VERTEX_COLOR) { | else if (color_type == V3D_SHADING_VERTEX_COLOR) { | ||||
| if (!me) { | if (!me) { | ||||
| color_type = V3D_SHADING_OBJECT_COLOR; | color_type = V3D_SHADING_OBJECT_COLOR; | ||||
| } | } | ||||
| else { | else { | ||||
| if (!has_color) { | if (!has_color) { | ||||
| color_type = V3D_SHADING_OBJECT_COLOR; | color_type = V3D_SHADING_OBJECT_COLOR; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (r_sculpt_pbvh) { | if (r_sculpt_pbvh) { | ||||
| *r_sculpt_pbvh = is_sculpt_pbvh; | *r_sculpt_pbvh = is_sculpt_pbvh; | ||||
| } | } | ||||
| if (r_texpaint_mode) { | if (r_texpaint_mode) { | ||||
| *r_texpaint_mode = false; | *r_texpaint_mode = false; | ||||
| } | } | ||||
| if (!is_sculpt_pbvh && !is_render) { | if (!is_sculpt_pbvh && !is_render) { | ||||
| /* Force texture or vertex mode if object is in paint mode. */ | /* Force texture or vertex mode if object is in paint mode. */ | ||||
| if (is_texpaint_mode && me && CustomData_has_layer(ldata, CD_MLOOPUV)) { | if (is_texpaint_mode && me && CustomData_has_layer(ldata, CD_PROP_FLOAT2)) { | ||||
| color_type = V3D_SHADING_TEXTURE_COLOR; | color_type = V3D_SHADING_TEXTURE_COLOR; | ||||
| if (r_texpaint_mode) { | if (r_texpaint_mode) { | ||||
| *r_texpaint_mode = true; | *r_texpaint_mode = true; | ||||
| } | } | ||||
| } | } | ||||
| else if (is_vertpaint_mode && me && has_color) { | else if (is_vertpaint_mode && me && has_color) { | ||||
| color_type = V3D_SHADING_VERTEX_COLOR; | color_type = V3D_SHADING_VERTEX_COLOR; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 372 Lines • Show Last 20 Lines | |||||