Fix T74095: crash deleting all faces in edit mode with Cycles rendering
This commit is contained in:
parent
e0085bfd24
commit
7463da6c72
Notes:
blender-bot
2023-04-14 09:18:04 +02:00
Referenced by issue #74095, Cycles crash deleting (all) geometry in editmode [no bvh rebuild, tries to refit bvh instead]
|
@ -1154,7 +1154,10 @@ void BlenderSync::sync_particle_hair(
|
|||
}
|
||||
}
|
||||
|
||||
void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BL::Object b_ob, Geometry *geom)
|
||||
void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph,
|
||||
BL::Object b_ob,
|
||||
Geometry *geom,
|
||||
const vector<Shader *> &used_shaders)
|
||||
{
|
||||
Hair *hair = (geom->type == Geometry::HAIR) ? static_cast<Hair *>(geom) : NULL;
|
||||
Mesh *mesh = (geom->type == Geometry::MESH) ? static_cast<Mesh *>(geom) : NULL;
|
||||
|
@ -1172,6 +1175,9 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BL::Object b_ob, Geometry
|
|||
oldtriangles.steal_data(mesh->triangles);
|
||||
}
|
||||
|
||||
geom->clear();
|
||||
geom->used_shaders = used_shaders;
|
||||
|
||||
if (view_layer.use_hair && scene->curve_system_manager->use_curves) {
|
||||
/* Particle hair. */
|
||||
bool need_undeformed = geom->need_attribute(scene, ATTR_STD_GENERATED);
|
||||
|
|
|
@ -117,20 +117,18 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
|||
|
||||
geometry_synced.insert(geom);
|
||||
|
||||
geom->clear();
|
||||
geom->used_shaders = used_shaders;
|
||||
geom->name = ustring(b_ob_data.name().c_str());
|
||||
|
||||
if (use_particle_hair) {
|
||||
sync_hair(b_depsgraph, b_ob, geom);
|
||||
sync_hair(b_depsgraph, b_ob, geom, used_shaders);
|
||||
}
|
||||
else if (object_fluid_gas_domain_find(b_ob)) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
sync_volume(b_ob, mesh);
|
||||
sync_volume(b_ob, mesh, used_shaders);
|
||||
}
|
||||
else {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
sync_mesh(b_depsgraph, b_ob, mesh);
|
||||
sync_mesh(b_depsgraph, b_ob, mesh, used_shaders);
|
||||
}
|
||||
|
||||
return geom;
|
||||
|
|
|
@ -941,7 +941,10 @@ static void sync_mesh_fluid_motion(BL::Object &b_ob, Scene *scene, Mesh *mesh)
|
|||
}
|
||||
}
|
||||
|
||||
void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *mesh)
|
||||
void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph,
|
||||
BL::Object b_ob,
|
||||
Mesh *mesh,
|
||||
const vector<Shader *> &used_shaders)
|
||||
{
|
||||
array<int> oldtriangles;
|
||||
array<Mesh::SubdFace> oldsubd_faces;
|
||||
|
@ -950,6 +953,9 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *me
|
|||
oldsubd_faces.steal_data(mesh->subd_faces);
|
||||
oldsubd_face_corners.steal_data(mesh->subd_face_corners);
|
||||
|
||||
mesh->clear();
|
||||
mesh->used_shaders = used_shaders;
|
||||
|
||||
mesh->subdivision_type = Mesh::SUBDIVISION_NONE;
|
||||
|
||||
if (view_layer.use_surfaces) {
|
||||
|
|
|
@ -137,14 +137,20 @@ class BlenderSync {
|
|||
bool *use_portal);
|
||||
|
||||
/* Volume */
|
||||
void sync_volume(BL::Object &b_ob, Mesh *mesh);
|
||||
void sync_volume(BL::Object &b_ob, Mesh *mesh, const vector<Shader *> &used_shaders);
|
||||
|
||||
/* Mesh */
|
||||
void sync_mesh(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *mesh);
|
||||
void sync_mesh(BL::Depsgraph b_depsgraph,
|
||||
BL::Object b_ob,
|
||||
Mesh *mesh,
|
||||
const vector<Shader *> &used_shaders);
|
||||
void sync_mesh_motion(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *mesh, int motion_step);
|
||||
|
||||
/* Hair */
|
||||
void sync_hair(BL::Depsgraph b_depsgraph, BL::Object b_ob, Geometry *geom);
|
||||
void sync_hair(BL::Depsgraph b_depsgraph,
|
||||
BL::Object b_ob,
|
||||
Geometry *geom,
|
||||
const vector<Shader *> &used_shaders);
|
||||
void sync_hair_motion(BL::Depsgraph b_depsgraph,
|
||||
BL::Object b_ob,
|
||||
Geometry *geom,
|
||||
|
|
|
@ -80,10 +80,13 @@ static void sync_smoke_volume(Scene *scene, BL::Object &b_ob, Mesh *mesh, float
|
|||
}
|
||||
}
|
||||
|
||||
void BlenderSync::sync_volume(BL::Object &b_ob, Mesh *mesh)
|
||||
void BlenderSync::sync_volume(BL::Object &b_ob, Mesh *mesh, const vector<Shader *> &used_shaders)
|
||||
{
|
||||
bool old_has_voxel_attributes = mesh->has_voxel_attributes();
|
||||
|
||||
mesh->clear();
|
||||
mesh->used_shaders = used_shaders;
|
||||
|
||||
/* Smoke domain. */
|
||||
sync_smoke_volume(scene, b_ob, mesh, b_scene.frame_current());
|
||||
|
||||
|
|
Loading…
Reference in New Issue