From 83f2012300acadafd359307e7a00bd71e67e3fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= <lukas.toenne@gmail.com> Date: Mon, 24 Mar 2014 12:53:36 +0100 Subject: [PATCH] Fix T39341: Cycles Rendered view laggy while using particles. There are a couple of bugs that come together here: * Particle hacks: extra modifier stack evaluation just for particles in rna_Object_create_duplilist. This is where the primary issue stems from, the "for_render" setting replaced the G.is_rendering flag in threaded depsgraph. This causes particles to recalculate the entire modifier stack with _render_ settings instead of viewport settings now. Fixed by taking the 'preview' parameter in Cycles into account. * Buggy skin modifier: The skin modifier generates a different amount of vertices and faces **on every execution**. This must be looked at separately, but it could be another reason why cycles constantly restarted the sync process. * Particles get re-distributed randomly every time (changing seed). This could be caused just by the broken skin modifier, but might still be an issue when simply rendering with cycles, since the psys will be evaluated for render settings, if just temporarily. --- intern/cycles/blender/blender_object.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 2ea0b27dff8..ec53ebe520b 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -432,6 +432,11 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion) /* object loop */ BL::Scene::objects_iterator b_ob; BL::Scene b_sce = b_scene; + /* modifier result type (not exposed as enum in C++ API) + * 1 : eModifierMode_Realtime + * 2 : eModifierMode_Render + */ + bool dupli_settings = preview ? 1 : 2; bool cancel = false; @@ -446,7 +451,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion) if(b_ob->is_duplicator() && !object_render_hide_duplis(*b_ob)) { /* dupli objects */ - b_ob->dupli_list_create(b_scene, 2); + b_ob->dupli_list_create(b_scene, dupli_settings); BL::Object::dupli_list_iterator b_dup; -- GitLab