Fix warning after fix for crash on renaming group collections

Warning introduced on: 73079e01fd.
This commit is contained in:
Dalai Felinto 2018-02-19 11:10:19 -03:00
parent 73079e01fd
commit a16c0ebc59
3 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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);
}
/**

View File

@ -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)