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:
authorHans Goudey <h.goudey@me.com>2022-02-26 01:23:14 +0300
committerHans Goudey <h.goudey@me.com>2022-02-26 01:23:14 +0300
commit1598ab9639a8ccc6bbed3d12bd9faf7eab5ecbd8 (patch)
treea249602f8e1e3b5813e04d7c90fb72905e7cbe07 /source
parentbdf4e1596d4560c0bb1d79cd5344b3e6524e1037 (diff)
parent7aa0be4b32bdbee61ea732f43175c8bc6585fc98 (diff)
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_mesh.h6
-rw-r--r--source/blender/blenkernel/intern/subdiv_modifier.c4
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c6
-rw-r--r--source/blender/modifiers/intern/MOD_normal_edit.c4
4 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 5628992d415..949266c779d 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -405,6 +405,9 @@ void BKE_mesh_assert_normals_dirty_or_calculated(const struct Mesh *mesh);
* \note In order to clear the dirty flag, this function should be followed by a call to
* #BKE_mesh_vertex_normals_clear_dirty. This is separate so that normals are still tagged dirty
* while they are being assigned.
+ *
+ * \warning The memory returned by this function is not initialized if it was not previously
+ * allocated.
*/
float (*BKE_mesh_vertex_normals_for_write(struct Mesh *mesh))[3];
@@ -415,6 +418,9 @@ float (*BKE_mesh_vertex_normals_for_write(struct Mesh *mesh))[3];
* \note In order to clear the dirty flag, this function should be followed by a call to
* #BKE_mesh_poly_normals_clear_dirty. This is separate so that normals are still tagged dirty
* while they are being assigned.
+ *
+ * \warning The memory returned by this function is not initialized if it was not previously
+ * allocated.
*/
float (*BKE_mesh_poly_normals_for_write(struct Mesh *mesh))[3];
diff --git a/source/blender/blenkernel/intern/subdiv_modifier.c b/source/blender/blenkernel/intern/subdiv_modifier.c
index 48b3bb2acef..95a5946d7d3 100644
--- a/source/blender/blenkernel/intern/subdiv_modifier.c
+++ b/source/blender/blenkernel/intern/subdiv_modifier.c
@@ -60,8 +60,8 @@ bool BKE_subsurf_modifier_use_custom_loop_normals(const SubsurfModifierData *smd
CustomData_has_layer(&mesh->ldata, CD_CUSTOMLOOPNORMAL);
}
-bool subsurf_modifier_use_autosmooth_or_split_normals(const SubsurfModifierData *smd,
- const Mesh *mesh)
+static bool subsurf_modifier_use_autosmooth_or_split_normals(const SubsurfModifierData *smd,
+ const Mesh *mesh)
{
return (mesh->flag & ME_AUTOSMOOTH) || BKE_subsurf_modifier_use_custom_loop_normals(smd, mesh);
}
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index e9f1012f930..79a080cfccd 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -339,11 +339,7 @@ static void drw_mesh_attributes_merge(DRW_MeshAttributes *dst,
/* Return true if all requests in b are in a. */
static bool drw_mesh_attributes_overlap(DRW_MeshAttributes *a, DRW_MeshAttributes *b)
{
- if (a->num_requests != b->num_requests) {
- return false;
- }
-
- for (int i = 0; i < a->num_requests; i++) {
+ for (int i = 0; i < b->num_requests; i++) {
if (!has_request(a, b->requests[i])) {
return false;
}
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index e6aebbfeb56..3649808f4f0 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -535,8 +535,8 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd,
CustomData *ldata = &result->ldata;
- const float(*vert_normals)[3] = BKE_mesh_vertex_normals_ensure(mesh);
- const float(*poly_normals)[3] = BKE_mesh_poly_normals_ensure(mesh);
+ const float(*vert_normals)[3] = BKE_mesh_vertex_normals_ensure(result);
+ const float(*poly_normals)[3] = BKE_mesh_poly_normals_ensure(result);
clnors = CustomData_get_layer(ldata, CD_CUSTOMLOOPNORMAL);
if (use_current_clnors) {