Fix #121008: Paint undo causes uncolored mesh
Update PBVH GPU argument initialization to prefer using the PBVH mesh attributes instead of the evaluated mesh attributes for color. The values can be out of sync due to differences with the evaluated and original mesh data. Pull Request: https://projects.blender.org/blender/blender/pulls/122850
This commit is contained in:
@@ -2599,13 +2599,16 @@ static blender::draw::pbvh::PBVH_GPU_Args pbvh_draw_args_init(const Mesh &mesh,
|
||||
|
||||
args.pbvh_type = pbvh.header.type;
|
||||
|
||||
/* Occasionally, the evaluated and original meshes are out of sync. Prefer using the pbvh mesh in
|
||||
* these cases. See #115856 and #121008 */
|
||||
args.face_sets_color_default = pbvh.mesh ? pbvh.mesh->face_sets_color_default :
|
||||
mesh.face_sets_color_default;
|
||||
args.face_sets_color_seed = pbvh.mesh ? pbvh.mesh->face_sets_color_seed :
|
||||
mesh.face_sets_color_seed;
|
||||
|
||||
args.active_color = mesh.active_color_attribute;
|
||||
args.render_color = mesh.default_color_attribute;
|
||||
args.active_color = pbvh.mesh ? pbvh.mesh->active_color_attribute : mesh.active_color_attribute;
|
||||
args.render_color = pbvh.mesh ? pbvh.mesh->default_color_attribute :
|
||||
mesh.default_color_attribute;
|
||||
|
||||
switch (pbvh.header.type) {
|
||||
case PBVH_FACES:
|
||||
|
||||
Reference in New Issue
Block a user