From 3c953a1b09c9025086f38afdb60b02ba1b7d5970 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 3 Nov 2020 13:59:33 +0100 Subject: Fix T82074: Volume to Mesh normals are inverted OpenVDB seems to have a different winding order convention. Reviewers: brecht Differential Revision: https://developer.blender.org/D9434 --- source/blender/modifiers/intern/MOD_volume_to_mesh.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/modifiers/intern/MOD_volume_to_mesh.cc b/source/blender/modifiers/intern/MOD_volume_to_mesh.cc index ea292155d3c..8146c4ca84a 100644 --- a/source/blender/modifiers/intern/MOD_volume_to_mesh.cc +++ b/source/blender/modifiers/intern/MOD_volume_to_mesh.cc @@ -237,7 +237,8 @@ static Mesh *new_mesh_from_openvdb_data(Span verts, mesh->mpoly[i].loopstart = 3 * i; mesh->mpoly[i].totloop = 3; for (int j = 0; j < 3; j++) { - mesh->mloop[3 * i + j].v = tris[i][j]; + /* Reverse vertex order to get correct normals. */ + mesh->mloop[3 * i + j].v = tris[i][2 - j]; } } @@ -248,7 +249,8 @@ static Mesh *new_mesh_from_openvdb_data(Span verts, mesh->mpoly[poly_offset + i].loopstart = loop_offset + 4 * i; mesh->mpoly[poly_offset + i].totloop = 4; for (int j = 0; j < 4; j++) { - mesh->mloop[loop_offset + 4 * i + j].v = quads[i][j]; + /* Reverse vertex order to get correct normals. */ + mesh->mloop[loop_offset + 4 * i + j].v = quads[i][3 - j]; } } -- cgit v1.2.3 From 313086e2129721135e4eec1ce08fd9d12e197efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 3 Nov 2020 14:23:03 +0100 Subject: GL: Fix default framebuffers being bound using srgb Default backbuffers needs not to be bound with sRGB encoding enabled. This works when using `GPU_framebuffer_restore` but using `GPU_framebuffer_bind` would trigger the wrong behavior. This fix T81969 UI turns whiteish when playing video sequence based on a scene and moving in the image editor after saving --- source/blender/gpu/opengl/gl_framebuffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index cd87fc88144..a180aa270b0 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -288,7 +288,7 @@ void GLFrameBuffer::bind(bool enabled_srgb) if (context_->active_fb != this || enabled_srgb_ != enabled_srgb) { enabled_srgb_ = enabled_srgb; - if (enabled_srgb) { + if (enabled_srgb && srgb_) { glEnable(GL_FRAMEBUFFER_SRGB); } else { -- cgit v1.2.3 From e699546bdeccd79d28d14a04cfdf1849ff6caed0 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 3 Nov 2020 15:09:14 +0100 Subject: Fix T81756: relinking multiple links to group input removes links The links where added to the socket one after the other. However, the virtual socket had a link limit of 1, so whenever a new link was added, the previously added one was removed. There is not really a reason for why the link limit should be 1 instead of something higher. I'm setting it to the max value: `0xFFF`. I'm also setting the `input_link_limit` to that value. Blender does not need this currently, but addons might have input sockets that allow more than one incident link. --- source/blender/nodes/intern/node_socket.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/node_socket.cc b/source/blender/nodes/intern/node_socket.cc index 0cedc6597c8..116177a54b7 100644 --- a/source/blender/nodes/intern/node_socket.cc +++ b/source/blender/nodes/intern/node_socket.cc @@ -543,8 +543,8 @@ static bNodeSocketType *make_socket_type_virtual(void) ED_init_node_socket_type_virtual(stype); stype->use_link_limits_of_type = true; - stype->input_link_limit = 1; - stype->output_link_limit = 1; + stype->input_link_limit = 0xFFF; + stype->output_link_limit = 0xFFF; return stype; } -- cgit v1.2.3 From 0cf46631e11a819aceece60e3b23491d22e9d077 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Tue, 3 Nov 2020 16:38:43 +0100 Subject: Fix T82356: Gpencil merge freezes Blender The `gps_next` variable had a typo error and was wrongly used as `gps->next` --- source/blender/editors/gpencil/gpencil_merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c index ca93e8de844..3e63d644760 100644 --- a/source/blender/editors/gpencil/gpencil_merge.c +++ b/source/blender/editors/gpencil/gpencil_merge.c @@ -413,7 +413,7 @@ static int gpencil_analyze_strokes(tGPencilPointCache *src_array, BLI_ghash_free(strokes, NULL, NULL); /* add the stroke to array */ - if (gps->next != NULL) { + if (gps_next != NULL) { BLI_ghash_insert(all_strokes, gps_next, gps_next); last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps_next, reverse, last); /* replace last end */ -- cgit v1.2.3