Fix T74095: crash deleting all faces in edit mode with Cycles rendering
This commit is contained in:
@@ -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;
|
Hair *hair = (geom->type == Geometry::HAIR) ? static_cast<Hair *>(geom) : NULL;
|
||||||
Mesh *mesh = (geom->type == Geometry::MESH) ? static_cast<Mesh *>(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);
|
oldtriangles.steal_data(mesh->triangles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
geom->clear();
|
||||||
|
geom->used_shaders = used_shaders;
|
||||||
|
|
||||||
if (view_layer.use_hair && scene->curve_system_manager->use_curves) {
|
if (view_layer.use_hair && scene->curve_system_manager->use_curves) {
|
||||||
/* Particle hair. */
|
/* Particle hair. */
|
||||||
bool need_undeformed = geom->need_attribute(scene, ATTR_STD_GENERATED);
|
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);
|
geometry_synced.insert(geom);
|
||||||
|
|
||||||
geom->clear();
|
|
||||||
geom->used_shaders = used_shaders;
|
|
||||||
geom->name = ustring(b_ob_data.name().c_str());
|
geom->name = ustring(b_ob_data.name().c_str());
|
||||||
|
|
||||||
if (use_particle_hair) {
|
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)) {
|
else if (object_fluid_gas_domain_find(b_ob)) {
|
||||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||||
sync_volume(b_ob, mesh);
|
sync_volume(b_ob, mesh, used_shaders);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||||
sync_mesh(b_depsgraph, b_ob, mesh);
|
sync_mesh(b_depsgraph, b_ob, mesh, used_shaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
return geom;
|
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<int> oldtriangles;
|
||||||
array<Mesh::SubdFace> oldsubd_faces;
|
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_faces.steal_data(mesh->subd_faces);
|
||||||
oldsubd_face_corners.steal_data(mesh->subd_face_corners);
|
oldsubd_face_corners.steal_data(mesh->subd_face_corners);
|
||||||
|
|
||||||
|
mesh->clear();
|
||||||
|
mesh->used_shaders = used_shaders;
|
||||||
|
|
||||||
mesh->subdivision_type = Mesh::SUBDIVISION_NONE;
|
mesh->subdivision_type = Mesh::SUBDIVISION_NONE;
|
||||||
|
|
||||||
if (view_layer.use_surfaces) {
|
if (view_layer.use_surfaces) {
|
||||||
|
|||||||
@@ -137,14 +137,20 @@ class BlenderSync {
|
|||||||
bool *use_portal);
|
bool *use_portal);
|
||||||
|
|
||||||
/* Volume */
|
/* 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 */
|
/* 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);
|
void sync_mesh_motion(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *mesh, int motion_step);
|
||||||
|
|
||||||
/* Hair */
|
/* 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,
|
void sync_hair_motion(BL::Depsgraph b_depsgraph,
|
||||||
BL::Object b_ob,
|
BL::Object b_ob,
|
||||||
Geometry *geom,
|
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();
|
bool old_has_voxel_attributes = mesh->has_voxel_attributes();
|
||||||
|
|
||||||
|
mesh->clear();
|
||||||
|
mesh->used_shaders = used_shaders;
|
||||||
|
|
||||||
/* Smoke domain. */
|
/* Smoke domain. */
|
||||||
sync_smoke_volume(scene, b_ob, mesh, b_scene.frame_current());
|
sync_smoke_volume(scene, b_ob, mesh, b_scene.frame_current());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user