diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 13:53:27 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 13:53:27 +0300 |
commit | be57cf9b2a0e1be577211839487cacd288886c1a (patch) | |
tree | e5a9e80db484a2b1c71fc0acfc31a4591fff427e /source/blender/blenkernel | |
parent | 5508b572ea9bb2d3b758cae6898035005e8ebb2a (diff) |
Cleanup: remove moar G.main from BKE area.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_key.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/key.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 20 |
4 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index 5eef44ef896..2f953e57d71 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -50,7 +50,7 @@ extern "C" { void BKE_key_free(struct Key *sc); void BKE_key_free_nolib(struct Key *key); -struct Key *BKE_key_add(struct ID *id); +struct Key *BKE_key_add(struct Main *bmain, struct ID *id); void BKE_key_copy_data(struct Main *bmain, struct Key *key_dst, const struct Key *key_src, const int flag); struct Key *BKE_key_copy(struct Main *bmain, const struct Key *key); struct Key *BKE_key_copy_nolib(struct Key *key); diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 9d99a0ad84b..51cfc5b0087 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -245,7 +245,7 @@ int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float * int BKE_object_insert_ptcache(struct Object *ob); void BKE_object_delete_ptcache(struct Object *ob, int index); -struct KeyBlock *BKE_object_shapekey_insert(struct Object *ob, const char *name, const bool from_mix); +struct KeyBlock *BKE_object_shapekey_insert(struct Main *bmain, struct Object *ob, const char *name, const bool from_mix); bool BKE_object_shapekey_remove(struct Main *bmain, struct Object *ob, struct KeyBlock *kb); bool BKE_object_shapekey_free(struct Main *bmain, struct Object *ob); diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index fd42556067e..e63f7d7cefe 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -102,12 +102,12 @@ void BKE_key_free_nolib(Key *key) } } -Key *BKE_key_add(ID *id) /* common function */ +Key *BKE_key_add(Main *bmain, ID *id) /* common function */ { Key *key; char *el; - key = BKE_libblock_alloc(G.main, ID_KE, "Key", 0); + key = BKE_libblock_alloc(bmain, ID_KE, "Key", 0); key->type = KEY_NORMAL; key->from = id; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 875bc442f8a..9178b889062 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2816,7 +2816,7 @@ void BKE_object_delete_ptcache(Object *ob, int index) /* shape key utility function */ /************************* Mesh ************************/ -static KeyBlock *insert_meshkey(Object *ob, const char *name, const bool from_mix) +static KeyBlock *insert_meshkey(Main *bmain, Object *ob, const char *name, const bool from_mix) { Mesh *me = ob->data; Key *key = me->key; @@ -2824,7 +2824,7 @@ static KeyBlock *insert_meshkey(Object *ob, const char *name, const bool from_mi int newkey = 0; if (key == NULL) { - key = me->key = BKE_key_add((ID *)me); + key = me->key = BKE_key_add(bmain, (ID *)me); key->type = KEY_RELATIVE; newkey = 1; } @@ -2848,7 +2848,7 @@ static KeyBlock *insert_meshkey(Object *ob, const char *name, const bool from_mi return kb; } /************************* Lattice ************************/ -static KeyBlock *insert_lattkey(Object *ob, const char *name, const bool from_mix) +static KeyBlock *insert_lattkey(Main *bmain, Object *ob, const char *name, const bool from_mix) { Lattice *lt = ob->data; Key *key = lt->key; @@ -2856,7 +2856,7 @@ static KeyBlock *insert_lattkey(Object *ob, const char *name, const bool from_mi int newkey = 0; if (key == NULL) { - key = lt->key = BKE_key_add((ID *)lt); + key = lt->key = BKE_key_add(bmain, (ID *)lt); key->type = KEY_RELATIVE; newkey = 1; } @@ -2886,7 +2886,7 @@ static KeyBlock *insert_lattkey(Object *ob, const char *name, const bool from_mi return kb; } /************************* Curve ************************/ -static KeyBlock *insert_curvekey(Object *ob, const char *name, const bool from_mix) +static KeyBlock *insert_curvekey(Main *bmain, Object *ob, const char *name, const bool from_mix) { Curve *cu = ob->data; Key *key = cu->key; @@ -2895,7 +2895,7 @@ static KeyBlock *insert_curvekey(Object *ob, const char *name, const bool from_m int newkey = 0; if (key == NULL) { - key = cu->key = BKE_key_add((ID *)cu); + key = cu->key = BKE_key_add(bmain, (ID *)cu); key->type = KEY_RELATIVE; newkey = 1; } @@ -2926,16 +2926,16 @@ static KeyBlock *insert_curvekey(Object *ob, const char *name, const bool from_m return kb; } -KeyBlock *BKE_object_shapekey_insert(Object *ob, const char *name, const bool from_mix) +KeyBlock *BKE_object_shapekey_insert(Main *bmain, Object *ob, const char *name, const bool from_mix) { switch (ob->type) { case OB_MESH: - return insert_meshkey(ob, name, from_mix); + return insert_meshkey(bmain, ob, name, from_mix); case OB_CURVE: case OB_SURF: - return insert_curvekey(ob, name, from_mix); + return insert_curvekey(bmain, ob, name, from_mix); case OB_LATTICE: - return insert_lattkey(ob, name, from_mix); + return insert_lattkey(bmain, ob, name, from_mix); default: return NULL; } |