Fix T79074: Mesh Topology info not being updated after changes
All these data arrays are created for a specific topology, so they should be freed and updated when the PBVH rebuilds. Previously, this was only happening when freeing the SculptSession, but it also needs to happen in BKE_sculpt_update_object_before_eval to avoid reusing out of date data. Reviewed By: sergey Maniphest Tasks: T79074 Differential Revision: https://developer.blender.org/D8357
This commit is contained in:
@@ -1314,6 +1314,13 @@ static void sculptsession_free_pbvh(Object *object)
|
||||
|
||||
MEM_SAFE_FREE(ss->preview_vert_index_list);
|
||||
ss->preview_vert_index_count = 0;
|
||||
|
||||
MEM_SAFE_FREE(ss->preview_vert_index_list);
|
||||
|
||||
MEM_SAFE_FREE(ss->vertex_info.connected_component);
|
||||
MEM_SAFE_FREE(ss->vertex_info.boundary);
|
||||
|
||||
MEM_SAFE_FREE(ss->fake_neighbors.fake_neighbor_index);
|
||||
}
|
||||
|
||||
void BKE_sculptsession_bm_to_me_for_render(Object *object)
|
||||
@@ -1366,13 +1373,6 @@ void BKE_sculptsession_free(Object *ob)
|
||||
MEM_SAFE_FREE(ss->deform_cos);
|
||||
MEM_SAFE_FREE(ss->deform_imats);
|
||||
|
||||
MEM_SAFE_FREE(ss->preview_vert_index_list);
|
||||
|
||||
MEM_SAFE_FREE(ss->vertex_info.connected_component);
|
||||
MEM_SAFE_FREE(ss->vertex_info.boundary);
|
||||
|
||||
MEM_SAFE_FREE(ss->fake_neighbors.fake_neighbor_index);
|
||||
|
||||
if (ss->pose_ik_chain_preview) {
|
||||
for (int i = 0; i < ss->pose_ik_chain_preview->tot_segments; i++) {
|
||||
MEM_SAFE_FREE(ss->pose_ik_chain_preview->segments[i].weights);
|
||||
|
||||
Reference in New Issue
Block a user