Merging r50049 through r50076 from trunk into soc-2011-tomato
[blender.git] / source / blender / blenkernel / intern / scene.c
index 22cb202e0193f2bc98c407b6535f10aab0028f90..fc261d48132e74ff5d0f66521622c853e5c69c89 100644 (file)
@@ -247,7 +247,7 @@ Scene *BKE_scene_copy(Scene *sce, int type)
                if (sce->ed) {
                        scen->ed = MEM_callocN(sizeof(Editing), "addseq");
                        scen->ed->seqbasep = &scen->ed->seqbase;
-                       seqbase_dupli_recursive(sce, scen, &scen->ed->seqbase, &sce->ed->seqbase, SEQ_DUPE_ALL);
+                       BKE_sequence_base_dupli_recursive(sce, scen, &scen->ed->seqbase, &sce->ed->seqbase, SEQ_DUPE_ALL);
                }
        }
 
@@ -563,14 +563,7 @@ Scene *BKE_scene_add(const char *name)
 
 Base *BKE_scene_base_find(Scene *scene, Object *ob)
 {
-       Base *base;
-       
-       base = scene->base.first;
-       while (base) {
-               if (base->object == ob) return base;
-               base = base->next;
-       }
-       return NULL;
+       return BLI_findptr(&scene->base, ob, offsetof(Base, object));
 }
 
 void BKE_scene_set_background(Main *bmain, Scene *scene)
@@ -595,10 +588,10 @@ void BKE_scene_set_background(Main *bmain, Scene *scene)
 
        /* group flags again */
        for (group = bmain->group.first; group; group = group->id.next) {
-               go = group->gobject.first;
-               while (go) {
-                       if (go->ob) go->ob->flag |= OB_FROMGROUP;
-                       go = go->next;
+               for (go = group->gobject.first; go; go = go->next) {
+                       if (go->ob) {
+                               go->ob->flag |= OB_FROMGROUP;
+                       }
                }
        }
 
@@ -652,7 +645,7 @@ void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce)
                        sce1->set = NULL;
        
        /* check all sequences */
-       clear_scene_in_allseqs(bmain, sce);
+       BKE_sequencer_clear_scene_in_allseqs(bmain, sce);
 
        /* check render layer nodes in other scenes */
        clear_scene_in_nodes(bmain, sce);