diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-04 21:06:22 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-04 22:22:31 +0300 |
commit | b2e2db94bdae25b4505df563ae9e56a37d89cb7a (patch) | |
tree | e454893e7bc7215de93262f7bb9bad9b62ca7908 /intern/cycles/blender/blender_sync.cpp | |
parent | 59d0582a750cf61c98368dc66277e788dcf6f502 (diff) |
Fix T60379: Cycles viewport adaptive subdivision hangs after updates.
The camera world to raster computation was using wrong values. Also fixes
update when changing subdivision scene settings.
Diffstat (limited to 'intern/cycles/blender/blender_sync.cpp')
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index de41258ca51..063a2cd4d16 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -85,10 +85,11 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) * so we can do it later on if doing it immediate is not suitable. */ bool has_updated_objects = b_depsgraph.id_type_updated(BL::DriverTarget::id_type_OBJECT); - bool dicing_prop_changed = false; if(experimental) { + /* Mark all meshes as needing to be exported again if dicing changed. */ PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); + bool dicing_prop_changed = false; float updated_dicing_rate = preview ? RNA_float_get(&cscene, "preview_dicing_rate") : RNA_float_get(&cscene, "dicing_rate"); @@ -104,6 +105,15 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) max_subdivisions = updated_max_subdivisions; dicing_prop_changed = true; } + + if(dicing_prop_changed) { + for(const pair<void*, Mesh*>& iter: mesh_map.key_to_scene_data()) { + Mesh *mesh = iter.second; + if(mesh->subdivision_type != Mesh::SUBDIVISION_NONE) { + mesh_map.set_recalc(iter.first); + } + } + } } /* Iterate over all IDs in this depsgraph. */ @@ -133,7 +143,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) if(object_is_mesh(b_ob)) { if(updated_geometry || - (dicing_prop_changed && object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE)) + (object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE)) { BL::ID key = BKE_object_is_modified(b_ob)? b_ob: b_ob.data(); mesh_map.set_recalc(key); |