Commit: a16c0ebc59033b0b26b8e1d832a28739cfbd9ecd
Author: Dalai Felinto
Date:   Mon Feb 19 11:10:19 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBa16c0ebc59033b0b26b8e1d832a28739cfbd9ecd

Fix warning after fix for crash on renaming group collections

Warning introduced on: 73079e01fd4.

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

M       source/blender/blenkernel/BKE_collection.h
M       source/blender/blenkernel/intern/collection.c
M       source/blender/makesrna/intern/rna_layer.c

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

diff --git a/source/blender/blenkernel/BKE_collection.h 
b/source/blender/blenkernel/BKE_collection.h
index 618e60550b7..3bf14346ccb 100644
--- a/source/blender/blenkernel/BKE_collection.h
+++ b/source/blender/blenkernel/BKE_collection.h
@@ -51,7 +51,7 @@ bool BKE_collection_remove(struct ID *owner_id, struct 
SceneCollection *sc);
 void BKE_collection_copy_data(struct SceneCollection *sc_dst, struct 
SceneCollection *sc_src, const int flag);
 struct SceneCollection *BKE_collection_duplicate(struct ID *owner_id, struct 
SceneCollection *scene_collection);
 struct SceneCollection *BKE_collection_master(const struct ID *owner_id);
-void BKE_collection_rename(const struct Scene *scene, struct SceneCollection 
*sc, const char *name);
+void BKE_collection_rename(const struct ID *owner_id, struct SceneCollection 
*sc, const char *name);
 void BKE_collection_master_free(struct ID *owner_id, const bool do_id_user);
 bool BKE_collection_object_add(const struct ID *owner_id, struct 
SceneCollection *sc, struct Object *object);
 void BKE_collection_object_add_from(struct Scene *scene, struct Object 
*ob_src, struct Object *ob_dst);
diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index 2f392271157..c92096efd07 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -94,7 +94,7 @@ static SceneCollection *collection_add(ID *owner_id, 
SceneCollection *sc_parent,
        }
 
        BLI_addtail(&sc_parent->scene_collections, sc);
-       BKE_collection_rename((Scene *)owner_id, sc, name);
+       BKE_collection_rename(owner_id, sc, name);
 
        if (name != name_custom) {
                MEM_freeN((char *)name);
@@ -345,9 +345,9 @@ static void collection_rename(const ID *owner_id, 
SceneCollection *sc, const cha
        BLI_uniquename(&sc_parent->scene_collections, sc, DATA_("Collection"), 
'.', offsetof(SceneCollection, name), sizeof(sc->name));
 }
 
-void BKE_collection_rename(const Scene *scene, SceneCollection *sc, const char 
*name)
+void BKE_collection_rename(const ID *owner_id, SceneCollection *sc, const char 
*name)
 {
-       collection_rename(&scene->id, sc, name);
+       collection_rename(owner_id, sc, name);
 }
 
 /**
diff --git a/source/blender/makesrna/intern/rna_layer.c 
b/source/blender/makesrna/intern/rna_layer.c
index 558b963a768..7a1c1710a87 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -97,7 +97,7 @@ static void rna_SceneCollection_name_set(PointerRNA *ptr, 
const char *value)
 {
        Scene *scene = (Scene *)ptr->id.data;
        SceneCollection *sc = (SceneCollection *)ptr->data;
-       BKE_collection_rename(scene, sc, value);
+       BKE_collection_rename(&scene->id, sc, value);
 }
 
 static PointerRNA rna_SceneCollection_objects_get(CollectionPropertyIterator 
*iter)
@@ -655,9 +655,9 @@ static int rna_LayerCollection_name_length(PointerRNA *ptr)
 
 static void rna_LayerCollection_name_set(PointerRNA *ptr, const char *value)
 {
-       Scene *scene = (Scene *)ptr->id.data;
+       ID *owner_id = (ID *)ptr->id.data;
        SceneCollection *sc = ((LayerCollection *)ptr->data)->scene_collection;
-       BKE_collection_rename(scene, sc, value);
+       BKE_collection_rename(owner_id, sc, value);
 }
 
 static PointerRNA rna_LayerCollection_objects_get(CollectionPropertyIterator 
*iter)

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to