[Bf-blender-cvs] [d0ef442] render-layers: Rename: collections > scene/layer_collections

Dalai Felinto noreply at git.blender.org
Mon Dec 5 22:03:49 CET 2016


Commit: d0ef44218ea076a4b247d7334fa1b17cf7761fe8
Author: Dalai Felinto
Date:   Mon Dec 5 20:43:02 2016 +0100
Branches: render-layers
https://developer.blender.org/rBd0ef44218ea076a4b247d7334fa1b17cf7761fe8

Rename: collections > scene/layer_collections

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

M	source/blender/blenkernel/intern/collection.c
M	source/blender/blenkernel/intern/layer.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/makesdna/DNA_layer_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 1a78084..f53d8be 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -48,9 +48,9 @@ SceneCollection *BKE_collection_add(Scene *scene, SceneCollection *sc_parent, co
 	SceneCollection *sc_master = BKE_collection_master(scene);
 
 	BLI_strncpy(sc->name, name, sizeof(sc->name));
-	BLI_uniquename(&sc_master->collections, sc, DATA_("Collection"), '.', offsetof(SceneCollection, name), sizeof(sc->name));
+	BLI_uniquename(&sc_master->scene_collections, sc, DATA_("Collection"), '.', offsetof(SceneCollection, name), sizeof(sc->name));
 
-	BLI_addtail(&sc_parent->collections, sc);
+	BLI_addtail(&sc_parent->scene_collections, sc);
 
 	TODO_LAYER_SYNC;
 	return sc;
@@ -67,20 +67,20 @@ static void collection_free(SceneCollection *sc)
 		id_us_min(link->data);
 	}
 
-	for (SceneCollection *nsc = sc->collections.first; nsc; nsc = nsc->next) {
+	for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
 		collection_free(nsc);
 	}
-	BLI_freelistN(&sc->collections);
+	BLI_freelistN(&sc->scene_collections);
 }
 
 /* unlink the collection recursively
  * return true if unlinked */
 static bool collection_remlink(SceneCollection *sc_parent, SceneCollection *sc_gone)
 {
-	for (SceneCollection *sc = sc_parent->collections.first; sc; sc = sc->next)
+	for (SceneCollection *sc = sc_parent->scene_collections.first; sc; sc = sc->next)
 	{
 		if (sc == sc_gone) {
-			BLI_remlink(&sc_parent->collections, sc_gone);
+			BLI_remlink(&sc_parent->scene_collections, sc_gone);
 			return true;
 		}
 
@@ -98,7 +98,7 @@ static void layer_collection_remove(SceneLayer *sl, ListBase *lb, const SceneCol
 {
 	LayerCollection *lc = lb->first;
 	while(lc) {
-		if (lc->collection == sc) {
+		if (lc->scene_collection == sc) {
 			BKE_layer_collection_free(sl, lc);
 			BLI_remlink(lb, lc);
 
@@ -109,13 +109,13 @@ static void layer_collection_remove(SceneLayer *sl, ListBase *lb, const SceneCol
 			/* only the "top-level" layer collections may have the
 			 * same SceneCollection in a sibling tree.
 			 */
-			if (lb != &sl->collections) {
+			if (lb != &sl->layer_collections) {
 				return;
 			}
 		}
 
 		else {
-			layer_collection_remove(sl, &lc->collections, sc);
+			layer_collection_remove(sl, &lc->layer_collections, sc);
 			lc = lc->next;
 		}
 	}
@@ -143,7 +143,7 @@ bool BKE_collection_remove(Scene *scene, SceneCollection *sc)
 
 	/* check all layers that use this collection and clear them */
 	for (SceneLayer *sl = scene->render_layers.first; sl; sl = sl->next) {
-		layer_collection_remove(sl, &sl->collections, sc);
+		layer_collection_remove(sl, &sl->layer_collections, sc);
 		sl->active_collection = 0;
 	}
 
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 6a2b889..2e60902 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -62,7 +62,7 @@ SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name)
 	BLI_uniquename(&scene->render_layers, sl, DATA_("SceneLayer"), '.', offsetof(SceneLayer, name), sizeof(sl->name));
 
 	SceneCollection *sc = BKE_collection_master(scene);
-	layer_collection_add(sl, &sl->collections, sc);
+	layer_collection_add(sl, &sl->layer_collections, sc);
 
 	return sl;
 }
@@ -85,7 +85,7 @@ bool BKE_scene_layer_remove(Main *bmain, Scene *scene, SceneLayer *sl)
 
 	BLI_freelistN(&sl->object_bases);
 	//layer_collections_free(rl, &rl->collection_bases);
-	BLI_freelistN(&sl->collections);
+	BLI_freelistN(&sl->layer_collections);
 
 	MEM_freeN(sl);
 
@@ -152,7 +152,7 @@ static ObjectBase *object_base_add(SceneLayer *sl, Object *ob)
  */
 void BKE_layer_collection_free(SceneLayer *sl, LayerCollection *lc)
 {
-	for (LayerCollection *nlc = lc->collections.first; nlc; nlc = nlc->next) {
+	for (LayerCollection *nlc = lc->layer_collections.first; nlc; nlc = nlc->next) {
 		for (LinkData *link = nlc->object_bases.first; link; link = link->next) {
 			scene_layer_object_base_unref(sl, link->data);
 		}
@@ -172,7 +172,7 @@ static LayerCollection *collection_from_index(ListBase *lb, const int number, in
 
 		(*i)++;
 
-		LayerCollection *lc_nested = collection_from_index(&lc->collections, number, i);
+		LayerCollection *lc_nested = collection_from_index(&lc->layer_collections, number, i);
 		if (lc_nested) {
 			return lc_nested;
 		}
@@ -186,7 +186,7 @@ static LayerCollection *collection_from_index(ListBase *lb, const int number, in
 LayerCollection *BKE_layer_collection_active(SceneLayer *sl)
 {
 	int i = 0;
-	return collection_from_index(&sl->collections, sl->active_collection, &i);
+	return collection_from_index(&sl->layer_collections, sl->active_collection, &i);
 }
 
 /*
@@ -196,7 +196,7 @@ static int collection_count(ListBase *lb)
 {
 	int i = 0;
 	for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
-		i += collection_count(&lc->collections) + 1;
+		i += collection_count(&lc->layer_collections) + 1;
 	}
 	return i;
 }
@@ -207,7 +207,7 @@ static int collection_count(ListBase *lb)
  */
 int BKE_layer_collection_count(SceneLayer *sl)
 {
-	return collection_count(&sl->collections);
+	return collection_count(&sl->layer_collections);
 }
 
 /* Recursively get the index for a given collection */
@@ -220,7 +220,7 @@ static int index_from_collection(ListBase *lb, LayerCollection *lc, int *i)
 
 		(*i)++;
 
-		int i_nested = index_from_collection(&lcol->collections, lc, i);
+		int i_nested = index_from_collection(&lcol->layer_collections, lc, i);
 		if (i_nested != -1) {
 			return i_nested;
 		}
@@ -234,7 +234,7 @@ static int index_from_collection(ListBase *lb, LayerCollection *lc, int *i)
 int BKE_layer_collection_findindex(SceneLayer *sl, LayerCollection *lc)
 {
 	int i = 0;
-	return index_from_collection(&sl->collections, lc, &i);
+	return index_from_collection(&sl->layer_collections, lc, &i);
 }
 
 /*
@@ -243,7 +243,7 @@ int BKE_layer_collection_findindex(SceneLayer *sl, LayerCollection *lc)
  */
 LayerCollection *BKE_collection_link(SceneLayer *sl, SceneCollection *sc)
 {
-	LayerCollection *lc = layer_collection_add(sl, &sl->collections, sc);
+	LayerCollection *lc = layer_collection_add(sl, &sl->layer_collections, sc);
 	return lc;
 }
 
@@ -255,7 +255,7 @@ void BKE_collection_unlink(SceneLayer *sl, LayerCollection *lc)
 {
 	BKE_layer_collection_free(sl, lc);
 
-	BLI_remlink(&sl->collections, lc);
+	BLI_remlink(&sl->layer_collections, lc);
 	MEM_freeN(lc);
 	sl->active_collection = 0;
 }
@@ -285,8 +285,8 @@ static void layer_collection_populate(SceneLayer *sl, LayerCollection *lc, Scene
 	object_base_populate(sl, lc, &sc->objects);
 	object_base_populate(sl, lc, &sc->filter_objects);
 
-	for (SceneCollection *nsc = sc->collections.first; nsc; nsc = nsc->next) {
-		layer_collection_add(sl, &lc->collections, nsc);
+	for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
+		layer_collection_add(sl, &lc->layer_collections, nsc);
 	}
 }
 
@@ -295,7 +295,7 @@ LayerCollection *layer_collection_add(SceneLayer *sl, ListBase *lb, SceneCollect
 	LayerCollection *lc = MEM_callocN(sizeof(LayerCollection), "Collection Base");
 	BLI_addtail(lb, lc);
 
-	lc->collection = sc;
+	lc->scene_collection = sc;
 	lc->flag = COLLECTION_VISIBLE + COLLECTION_SELECTABLE + COLLECTION_FOLDED;
 
 	layer_collection_populate(sl, lc, sc);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b518e56..73d49b4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5242,7 +5242,7 @@ static void lib_link_scene_collection(FileData *fd, Library *lib, SceneCollectio
 		BLI_assert(link->data);
 	}
 
-	for (SceneCollection *nsc = sc->collections.first; nsc; nsc = nsc->next) {
+	for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
 		lib_link_scene_collection(fd, lib, nsc);
 	}
 }
@@ -5519,8 +5519,8 @@ static void direct_link_scene_collection(FileData *fd, SceneCollection *sc)
 		link->data = newdataadr(fd, link->data);
 	}
 
-	link_list(fd, &sc->collections);
-	for (SceneCollection *nsc = sc->collections.first; nsc; nsc = nsc->next) {
+	link_list(fd, &sc->scene_collections);
+	for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
 		direct_link_scene_collection(fd, nsc);
 	}
 }
@@ -5536,7 +5536,7 @@ static void direct_link_layer_collections(FileData *fd, ListBase *lb)
 			link->data = newdataadr(fd, link->data);
 		}
 
-		direct_link_layer_collections(fd, &lc->collections);
+		direct_link_layer_collections(fd, &lc->layer_collections);
 	}
 }
 
@@ -5787,7 +5787,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
 	for (sl = sce->render_layers.first; sl; sl = sl->next) {
 		link_list(fd, &sl->object_bases);
 		sl->basact = newdataadr(fd, sl->basact);
-		direct_link_layer_collections(fd, &sl->collections);
+		direct_link_layer_collections(fd, &sl->layer_collections);
 	}
 }
 
@@ -9062,7 +9062,7 @@ static void expand_layer_collection(FileData *fd, Main *mainvar, SceneCollection
 		expand_doit(fd, mainvar, link->data);
 	}
 
-	for (SceneCollection *nsc= sc->collections.first; nsc; nsc = nsc->next) {
+	for (SceneCollection *nsc= sc->scene_collections.first; nsc; nsc = nsc->next) {
 		expand_layer_collection(fd, mainvar, nsc);
 	}
 }
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 2f3d2d0..db1619e 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -85,7 +85,7 @@ void blo_do_versions_280_after_linking(FileData *fd, Library *UNUSED(lib), Main
 						BKE_scene_layer_engine_set(sl, scene->r.engine);
 
 						if (srl->mat_override) {
-							BKE_collection_override_datablock_add((LayerCollection *)sl->collections.first, "material", (ID *)srl->mat_override);
+							BKE_collection_override_datablock_add((LayerCollection *)sl->layer_collections.first, "material", (ID *)srl->mat_override);
 						}
 
 						if (srl->light_override && BKE_scene_uses_blender_internal(scene)) {
@@ -95,7 +95,7 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list