From 617cdb4642019f57ee657105a2a1307dcceedbdf Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 16 Oct 2012 15:38:52 +0000 Subject: [PATCH] Fix for second bug reported in #32846: Particle emitters are still shown for secondary instances with "show emitter" disabled. This requires checking the duplicator visibility on dupli objects themselves after generating the dupli-list. The emitter visibility option is messy design, it makes such checks unnecessarily complicated. A better approach would be to allow non-mesh objects to carry particle data, these objects would just be invisible anyway without having to care about extra settings. However, this conflicts with the simplistic particle design of "owner is the emitter" ... --- intern/cycles/blender/blender_object.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index e10ffb3cf98..2c32c8ad83f 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -340,8 +340,19 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion) Transform tfm = get_transform(b_dup->matrix()); BL::Object b_dup_ob = b_dup->object(); bool dup_hide = (b_v3d)? b_dup_ob.hide(): b_dup_ob.hide_render(); + bool emitter_hide = false; - if(!(b_dup->hide() || dup_hide)) { + if(b_dup_ob.is_duplicator()) { + emitter_hide = true; /* duplicators hidden by default */ + + /* check if we should render or hide particle emitter */ + BL::Object::particle_systems_iterator b_psys; + for(b_dup_ob.particle_systems.begin(b_psys); b_psys != b_dup_ob.particle_systems.end(); ++b_psys) + if(b_psys->settings().use_render_emitter()) + emitter_hide = false; + } + + if(!(b_dup->hide() || dup_hide || emitter_hide)) { sync_object(*b_ob, b_index, *b_dup, tfm, ob_layer, motion, b_dup->particle_index() + particle_offset); }