Commit: e6a26bf485018decf791197d54b2fdf603a30aee
Author: Julian Eisel
Date:   Sat Aug 13 01:49:13 2016 +0200
Branches: soc-2016-layer_manager
https://developer.blender.org/rBe6a26bf485018decf791197d54b2fdf603a30aee

Found & removed some more Scene.base usages

Also NULL the Base.next/prev pointers after version patching

===================================================================

M       source/blender/alembic/intern/abc_exporter.cc
M       source/blender/blenloader/intern/versioning_270.c
M       source/blender/collada/DocumentImporter.cpp

===================================================================

diff --git a/source/blender/alembic/intern/abc_exporter.cc 
b/source/blender/alembic/intern/abc_exporter.cc
index 127e885..5ccdf91 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -59,6 +59,7 @@ extern "C" {
 #include "BKE_idprop.h"
 #include "BKE_main.h"
 #include "BKE_modifier.h"
+#include "BKE_object.h"
 #include "BKE_particle.h"
 #include "BKE_scene.h"
 }
@@ -357,9 +358,8 @@ void AbcExporter::operator()(Main *bmain, float &progress, 
bool &was_canceled)
 
 void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx)
 {
-       Base *base = static_cast<Base *>(m_scene->base.first);
-
-       while (base) {
+       BKE_BASES_ITER_START(m_scene, base)
+       {
                Object *ob = base->object;
 
                if (export_object(&m_settings, ob)) {
@@ -375,25 +375,22 @@ void 
AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx)
                                        exploreTransform(eval_ctx, ob, 
ob->parent, NULL);
                        }
                }
-
-               base = base->next;
        }
+       BKE_BASES_ITER_END;
 }
 
 void AbcExporter::createTransformWritersFlat()
 {
-       Base *base = static_cast<Base *>(m_scene->base.first);
-
-       while (base) {
+       BKE_BASES_ITER_START(m_scene, base)
+       {
                Object *ob = base->object;
 
                if (export_object(&m_settings, ob) && object_is_shape(ob)) {
                        std::string name = get_id_name(ob);
                        m_xforms[name] = new AbcTransformWriter(ob, 
m_archive.getTop(), 0, m_trans_sampling_index, m_settings);
                }
-
-               base = base->next;
        }
+       BKE_BASES_ITER_END;
 }
 
 void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Object *ob, 
Object *parent, Object *dupliObParent)
@@ -461,14 +458,12 @@ void AbcExporter::createTransformWriter(Object *ob, 
Object *parent, Object *dupl
 
 void AbcExporter::createShapeWriters(EvaluationContext *eval_ctx)
 {
-       Base *base = static_cast<Base *>(m_scene->base.first);
-
-       while (base) {
+       BKE_BASES_ITER_START(m_scene, base)
+       {
                Object *ob = base->object;
                exploreObject(eval_ctx, ob, NULL);
-
-               base = base->next;
        }
+       BKE_BASES_ITER_END;
 }
 
 void AbcExporter::exploreObject(EvaluationContext *eval_ctx, Object *ob, 
Object *dupliObParent)
diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index a1bf33c..ac59a8c 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1336,6 +1336,7 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
                                for (Base *base = sce->base.first, *base_next; 
base; base = base_next) {
                                        base_next = base->next;
                                        BKE_objectlayer_base_assign_ex(base, 
litem, true, false);
+                                       base->prev = base->next = NULL;
                                }
                                BLI_listbase_clear(&sce->base);
                        }
diff --git a/source/blender/collada/DocumentImporter.cpp 
b/source/blender/collada/DocumentImporter.cpp
index 226f319..ff4df9f 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -266,7 +266,7 @@ void DocumentImporter::finish()
 
                        Base *base = BKE_scene_base_find(sce, ob);
                        if (base) {
-                               BLI_remlink(&sce->base, base);
+                               BKE_objectlayer_base_unassign(base);
                                BKE_libblock_free_us(G.main, base->object);
                                if (sce->basact == base)
                                        sce->basact = NULL;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to