First merge with 2.5 branch.
[blender.git] / source / blender / editors / animation / anim_filter.c
index 881d2d95ca4b6c30cae9a4a2de1ca7086e3c9c6b..93bdadc27d388186f083650960548dbe15e23598 100644 (file)
@@ -1195,7 +1195,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
                if (base->object) {
                        Object *ob= base->object;
                        Key *key= ob_get_key(ob);
-                       short actOk, keyOk, dataOk, matOk;
+                       short actOk=1, keyOk=1, dataOk=1, matOk=1;
                        
                        /* firstly, check if object can be included, by the following fanimors:
                         *      - if only visible, must check for layer and also viewport visibility
@@ -1204,8 +1204,8 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
                         */
                        // TODO: if cache is implemented, just check name here, and then 
                        if (filter_mode & ANIMFILTER_VISIBLE) {
-                               /* layer visibility */
-                               if ((ob->lay & sce->lay)==0) continue;
+                               /* layer visibility - we check both object and base, since these may not be in sync yet */
+                               if ((sce->lay & (ob->lay|base->lay))==0) continue;
                                
                                /* outliner restrict-flag */
                                if (ob->restrictflag & OB_RESTRICT_VIEW) continue;