diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-10-26 14:15:52 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-10-26 14:31:01 +0300 |
commit | ae5fd92228f82270806b127facba1f6c052f9717 (patch) | |
tree | 801ec137fcc308b0a5316aa675affde113df025e /intern/cycles | |
parent | 6fc0d743f12d4a1e72748cdc423ddd04b500a93b (diff) |
Fix T81893: Cycles viewport crash changing mesh to smoke domain
Now that volume is a dedicated geometry type in Cycles, we need to re-allocate
the geometry when a mesh changes into a volume.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_geometry.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_id_map.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_geometry.cpp b/intern/cycles/blender/blender_geometry.cpp index 002f5e0fdb7..a665bd97a8d 100644 --- a/intern/cycles/blender/blender_geometry.cpp +++ b/intern/cycles/blender/blender_geometry.cpp @@ -50,11 +50,11 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph, /* Test if we can instance or if the object is modified. */ BL::ID b_ob_data = b_ob.data(); BL::ID b_key_id = (BKE_object_is_modified(b_ob)) ? b_ob_instance : b_ob_data; - GeometryKey key(b_key_id.ptr.data, use_particle_hair); BL::Material material_override = view_layer.material_override; Shader *default_shader = (b_ob.type() == BL::Object::type_VOLUME) ? scene->default_volume : scene->default_surface; Geometry::Type geom_type = determine_geom_type(b_ob, use_particle_hair); + GeometryKey key(b_key_id.ptr.data, geom_type); /* Find shader indices. */ vector<Shader *> used_shaders; diff --git a/intern/cycles/blender/blender_id_map.h b/intern/cycles/blender/blender_id_map.h index f9f201c2e4e..8ce1d23665d 100644 --- a/intern/cycles/blender/blender_id_map.h +++ b/intern/cycles/blender/blender_id_map.h @@ -19,6 +19,7 @@ #include <string.h> +#include "render/geometry.h" #include "render/scene.h" #include "util/util_map.h" @@ -230,9 +231,9 @@ struct ObjectKey { struct GeometryKey { void *id; - bool use_particle_hair; + Geometry::Type geometry_type; - GeometryKey(void *id, bool use_particle_hair) : id(id), use_particle_hair(use_particle_hair) + GeometryKey(void *id, Geometry::Type geometry_type) : id(id), geometry_type(geometry_type) { } @@ -242,7 +243,7 @@ struct GeometryKey { return true; } else if (id == k.id) { - if (use_particle_hair < k.use_particle_hair) { + if (geometry_type < k.geometry_type) { return true; } } |