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" ...
This commit is contained in:
Lukas Toenne 2012-10-16 15:38:52 +00:00
parent 427a90d336
commit 617cdb4642

@ -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);
}