diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-16 19:38:52 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-16 19:38:52 +0400 |
commit | 617cdb4642019f57ee657105a2a1307dcceedbdf (patch) | |
tree | 7d25a9d9326fa49b185b7a4a8ecef50c1e8af61b /intern | |
parent | 427a90d336144b4bdbff9f7ff72275d78005bcfd (diff) |
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" ...
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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_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)) { + 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); } |