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
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2020-12-10 04:31:25 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2020-12-10 04:31:25 +0300
commit548e9624d0fe72f3a4a1f5d494f29b123f03bc20 (patch)
tree7bacd1dd2e98310267ac2d35710c37591a2533f6 /intern/cycles/blender
parentb379f9348487ad4e13650f10820a987deef76fe6 (diff)
Fix T82852: Cycles crashes when editing a mesh with adaptive subdivision
The issue is caused by stale data on the Mesh Node which is not cleared during synchronizing since the socket API refactor so that we can detect changes. However, synchronization only updates the sockets of the Mesh, so other properties were left with outdated values. This caused an underflow when computing attribute size for undisplaced coordinates as it was using the current number of vertices minus the previous count of subdivision vertices, which at this point should be 0. Added a simple method to clear non socket data. Also modified Mesh.add_undisplaced to always use an ATTR_PRIM_GEOMETRY as the data is not subdivided yet and it avoids any further issues regarding computing attribute sizes.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/blender_mesh.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index e85b4ee1fc6..3420025f472 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -1064,6 +1064,8 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *me
/* update original sockets */
+ mesh->clear_non_sockets();
+
for (const SocketType &socket : new_mesh.type->inputs) {
/* Those sockets are updated in sync_object, so do not modify them. */
if (socket.name == "use_motion_blur" || socket.name == "motion_steps" ||