Fix for cloth/smoke: Collision and flow objects always had to be on the same layer.
[blender.git] / source / blender / blenkernel / intern / collision.c
index 4641a02265a2997e3a8c0e3be4ee41631b2059f8..f0043d9fa77f27df45cc38c21efd103d3082e28b 100644 (file)
@@ -567,7 +567,9 @@ Object **get_collisionobjects(Scene *scene, Object *self, Group *group, unsigned
                Scene *sce_iter;
                /* add objects in same layer in scene */
                for (SETLOOPER(scene, sce_iter, base)) {
-                       if (base->lay & self->lay)
+                       /* Need to check for active layers, too.
+                       Otherwise this check fails if the objects are not on the same layer - DG */
+                       if ((base->lay & self->lay) || (base->lay & scene->lay))
                                add_collision_object(&objs, &numobj, &maxobj, base->object, self, 0, modifier_type);
 
                }