[Bf-blender-cvs] [1b5a594a052] tmp-workbench-rewrite2: Fix textures after D14365
Miguel Pozo
noreply at git.blender.org
Fri Jan 20 15:20:16 CET 2023
Commit: 1b5a594a0529bf696caa419f26ac34712b5caeb0
Author: Miguel Pozo
Date: Thu Jan 19 16:11:09 2023 +0100
Branches: tmp-workbench-rewrite2
https://developer.blender.org/rB1b5a594a0529bf696caa419f26ac34712b5caeb0
Fix textures after D14365
UVs are now stored as generic attributes.
===================================================================
M source/blender/draw/engines/workbench/workbench_state.cc
===================================================================
diff --git a/source/blender/draw/engines/workbench/workbench_state.cc b/source/blender/draw/engines/workbench/workbench_state.cc
index 5e0699d0192..8dd20684e71 100644
--- a/source/blender/draw/engines/workbench/workbench_state.cc
+++ b/source/blender/draw/engines/workbench/workbench_state.cc
@@ -257,8 +257,10 @@ ObjectState::ObjectState(const SceneState &scene_state, Object *ob)
CustomData_has_layer(cd_ldata, CD_PROP_COLOR) ||
CustomData_has_layer(cd_ldata, CD_PROP_BYTE_COLOR));
+ bool has_uv = CustomData_has_layer(cd_ldata, CD_PROP_FLOAT2);
+
if (color_type == V3D_SHADING_TEXTURE_COLOR) {
- if (ob->dt < OB_TEXTURE || !CustomData_has_layer(cd_ldata, CD_MLOOPUV)) {
+ if (ob->dt < OB_TEXTURE || !has_uv) {
color_type = V3D_SHADING_MATERIAL_COLOR;
}
}
@@ -275,7 +277,7 @@ ObjectState::ObjectState(const SceneState &scene_state, Object *ob)
if (is_vertpaint_mode && has_color) {
color_type = V3D_SHADING_VERTEX_COLOR;
}
- else if (is_texpaint_mode && CustomData_has_layer(cd_ldata, CD_MLOOPUV)) {
+ else if (is_texpaint_mode && has_uv) {
color_type = V3D_SHADING_TEXTURE_COLOR;
texture_paint_mode = true;
More information about the Bf-blender-cvs
mailing list