diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-11-02 13:20:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-11-02 13:20:03 +0300 |
commit | 7a9693fa8ba2132e09a892dfa0e60736b741002a (patch) | |
tree | 3c233bf23a355ebeec87574b92097fb0e09fea29 /source/blender/blenkernel | |
parent | 56bcda8bc63fa8461c8abe05f1d501fd3f536f45 (diff) |
Library API: pass Main struct to unlink functions
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_group.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 3 |
5 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h index d856e90a340..9056e48cf50 100644 --- a/source/blender/blenkernel/BKE_group.h +++ b/source/blender/blenkernel/BKE_group.h @@ -41,7 +41,7 @@ struct Object; struct Scene; void BKE_group_free(struct Group *group); -void BKE_group_unlink(struct Group *group); +void BKE_group_unlink(struct Main *bmain, struct Group *group); struct Group *BKE_group_add(struct Main *bmain, const char *name); struct Group *BKE_group_copy(struct Group *group); bool BKE_group_object_add(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base); diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 45d14a35539..91ea55f07f9 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -79,7 +79,7 @@ void BKE_object_free_modifiers(struct Object *ob); void BKE_object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob); void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target); -void BKE_object_unlink(struct Object *ob); +void BKE_object_unlink(struct Main *bmain, struct Object *ob); bool BKE_object_exists_check(struct Object *obtest); bool BKE_object_is_in_editmode(struct Object *ob); bool BKE_object_is_in_editmode_vgroup(struct Object *ob); diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 3f68339be11..150226523f2 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -73,9 +73,8 @@ void BKE_group_free(Group *group) } } -void BKE_group_unlink(Group *group) +void BKE_group_unlink(Main *bmain, Group *group) { - Main *bmain = G.main; Material *ma; Object *ob; Scene *sce; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index d9439b53639..c618795eb52 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -406,11 +406,11 @@ bool id_unlink(ID *id, int test) break; case ID_GR: if (test) return true; - BKE_group_unlink((Group *)id); + BKE_group_unlink(mainlib, (Group *)id); break; case ID_OB: if (test) return true; - BKE_object_unlink((Object *)id); + BKE_object_unlink(mainlib, (Object *)id); break; } @@ -1205,7 +1205,11 @@ void BKE_libblock_free_us(Main *bmain, void *idv) /* test users */ else printf("ERROR block %s users %d\n", id->name, id->us); } if (id->us == 0) { - if (GS(id->name) == ID_OB) BKE_object_unlink((Object *)id); + switch (GS(id->name)) { + case ID_OB: + BKE_object_unlink(bmain, (Object *)id); + break; + } BKE_libblock_free(bmain, id); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b6fcb04f616..456791e99fc 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -478,9 +478,8 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec } } -void BKE_object_unlink(Object *ob) +void BKE_object_unlink(Main *bmain, Object *ob) { - Main *bmain = G.main; Object *obt; Material *mat; World *wrld; |