Fix missing group duplicated by hair in render
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_nodes.cc
index 8d20a671202f3e5205e20711f4897cb764a51f62..1d18d6def8d3da2d7f492a63848d6014d63312d1 100644 (file)
@@ -661,32 +661,40 @@ void DepsgraphNodeBuilder::build_particles(Object *object)
         *     blackbox evaluation step for one particle system referenced by
         *     the particle systems stack. All dependencies link to this operation.
         */
-
-       /* component for all particle systems */
+       /* Component for all particle systems. */
        ComponentDepsNode *psys_comp =
                add_component_node(&object->id, DEG_NODE_TYPE_EVAL_PARTICLES);
-
        add_operation_node(psys_comp,
                           function_bind(BKE_particle_system_eval_init,
                                         _1,
                                         scene_,
                                         object),
                           DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
-
-       /* particle systems */
+       /* Build all particle systems. */
        BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                ParticleSettings *part = psys->part;
-
-               /* particle settings */
+               /* Particle settings. */
                // XXX: what if this is used more than once!
                build_animdata(&part->id);
-
-               /* this particle system */
+               /* This particle system evaluation. */
                // TODO: for now, this will just be a placeholder "ubereval" node
                add_operation_node(psys_comp,
                                   NULL,
                                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL,
                                   psys->name);
+               /* Visualization of particle system. */
+               switch (part->ren_as) {
+                       case PART_DRAW_OB:
+                               if (part->dup_ob != NULL) {
+                                       build_object(NULL, part->dup_ob);
+                               }
+                               break;
+                       case PART_DRAW_GR:
+                               if (part->dup_group != NULL) {
+                                       build_group(NULL, part->dup_group);
+                               }
+                               break;
+               }
        }
 
        /* pointcache */