[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51371] trunk/blender/intern/cycles/ blender/blender_object.cpp: Fix for second bug reported in #32846: Particle emitters are still shown for secondary instances with " show emitter" disabled.

Lukas Toenne lukas.toenne at googlemail.com
Tue Oct 16 17:38:52 CEST 2012


Revision: 51371
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51371
Author:   lukastoenne
Date:     2012-10-16 15:38:52 +0000 (Tue, 16 Oct 2012)
Log Message:
-----------
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" ...

Modified Paths:
--------------
    trunk/blender/intern/cycles/blender/blender_object.cpp

Modified: trunk/blender/intern/cycles/blender/blender_object.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_object.cpp	2012-10-16 15:20:18 UTC (rev 51370)
+++ trunk/blender/intern/cycles/blender/blender_object.cpp	2012-10-16 15:38:52 UTC (rev 51371)
@@ -340,8 +340,19 @@
 						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);
 						}
 						




More information about the Bf-blender-cvs mailing list