Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-11-18 16:26:01 +0300
committerJeroen Bakker <jeroen@blender.org>2020-11-18 16:26:01 +0300
commitf132d74c7dc0eb7029ca67997469a03090c18324 (patch)
treeb8322f37b61f47b6ac7994ae724e514716d58596 /source
parentd2cddb1fda596193d609f53465545d9c718a42eb (diff)
parent549a1cac88a12193faf2251edb1134270e8a1360 (diff)
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/overlay/overlay_edit_uv.c12
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c13
2 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c
index e21b6b30d22..045a38ef374 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_uv.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c
@@ -268,11 +268,13 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
if (pd->edit_uv.do_tiled_image_overlay) {
/* Active tile border */
ImageTile *active_tile = BLI_findlink(&image->tiles, image->active_tile_index);
- obmat[3][0] = (float)((active_tile->tile_number - 1001) % 10);
- obmat[3][1] = (float)((active_tile->tile_number - 1001) / 10);
- grp = DRW_shgroup_create(sh, psl->edit_uv_tiled_image_borders_ps);
- DRW_shgroup_uniform_vec4_copy(grp, "color", selected_color);
- DRW_shgroup_call_obmat(grp, geom, obmat);
+ if (active_tile) {
+ obmat[3][0] = (float)((active_tile->tile_number - 1001) % 10);
+ obmat[3][1] = (float)((active_tile->tile_number - 1001) / 10);
+ grp = DRW_shgroup_create(sh, psl->edit_uv_tiled_image_borders_ps);
+ DRW_shgroup_uniform_vec4_copy(grp, "color", selected_color);
+ DRW_shgroup_call_obmat(grp, geom, obmat);
+ }
}
}
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 7217be106ae..8e23199430a 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -51,6 +51,8 @@
#include "BKE_mesh_tangent.h"
#include "BKE_modifier.h"
#include "BKE_object_deform.h"
+#include "BKE_paint.h"
+#include "BKE_pbvh.h"
#include "atomic_ops.h"
@@ -1310,6 +1312,17 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph,
return;
}
+ /* TODO(pablodp606): This always updates the sculpt normals for regular drawing (non-PBVH).
+ * This makes tools that sample the surface per step get wrong normals until a redraw happens.
+ * Normal updates should be part of the brush loop and only run during the stroke when the
+ * brush needs to sample the surface. The drawing code should only update the normals
+ * per redraw when smooth shading is enabled. */
+ const bool do_update_sculpt_normals = ob->sculpt && ob->sculpt->pbvh;
+ if (do_update_sculpt_normals) {
+ Mesh *mesh = ob->data;
+ BKE_pbvh_update_normals(ob->sculpt->pbvh, mesh->runtime.subdiv_ccg);
+ }
+
cache->batch_ready |= batch_requested;
const bool do_cage = (is_editmode &&