[Bf-blender-cvs] [88bb29dea66] master: Fix T82617: artifacts in Cycles viewport when changing subdivision attributes
Kévin Dietrich
noreply at git.blender.org
Thu Nov 12 09:17:51 CET 2020
Commit: 88bb29dea668df8cc46aa7f55895f229748bdbb4
Author: Kévin Dietrich
Date: Thu Nov 12 08:55:18 2020 +0100
Branches: master
https://developer.blender.org/rB88bb29dea668df8cc46aa7f55895f229748bdbb4
Fix T82617: artifacts in Cycles viewport when changing subdivision attributes
The old attributes were not cleared when synchronizing the geometries, this could also lead to crashes in other cases.
Ref T82608.
===================================================================
M intern/cycles/blender/blender_curves.cpp
M intern/cycles/blender/blender_mesh.cpp
===================================================================
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 8344684ac64..964241e9904 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -855,6 +855,7 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BL::Object b_ob, Hair *ha
hair->set_value(socket, new_hair, socket);
}
+ hair->attributes.clear();
foreach (Attribute &attr, new_hair.attributes.attributes) {
hair->attributes.attributes.push_back(std::move(attr));
}
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index 4bd4baec2e4..e85b4ee1fc6 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -1073,10 +1073,12 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *me
mesh->set_value(socket, new_mesh, socket);
}
+ mesh->attributes.clear();
foreach (Attribute &attr, new_mesh.attributes.attributes) {
mesh->attributes.attributes.push_back(std::move(attr));
}
+ mesh->subd_attributes.clear();
foreach (Attribute &attr, new_mesh.subd_attributes.attributes) {
mesh->subd_attributes.attributes.push_back(std::move(attr));
}
More information about the Bf-blender-cvs
mailing list