diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-10 15:52:00 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-10 15:52:00 +0300 |
commit | 87b974caa1e2b780c8031d67a42488039036c489 (patch) | |
tree | 6776b8d35f25b2c458f90e0ba4cfa497782ebc30 /source/blender/blenkernel/intern/lamp.c | |
parent | ae2033aca2047afbfe0bf449bcd01b5b79a124b8 (diff) |
Cleanup/Refactor: pass Main pointer to all ID copy functions.
Also allows us to get rid of a few _copy_ex() versions...
Diffstat (limited to 'source/blender/blenkernel/intern/lamp.c')
-rw-r--r-- | source/blender/blenkernel/intern/lamp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index 43396834650..7ab71938cf2 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -114,12 +114,12 @@ Lamp *BKE_lamp_add(Main *bmain, const char *name) return la; } -Lamp *BKE_lamp_copy(Lamp *la) +Lamp *BKE_lamp_copy(Main *bmain, Lamp *la) { Lamp *lan; int a; - lan = BKE_libblock_copy(&la->id); + lan = BKE_libblock_copy(bmain, &la->id); for (a = 0; a < MAX_MTEX; a++) { if (lan->mtex[a]) { @@ -132,13 +132,13 @@ Lamp *BKE_lamp_copy(Lamp *la) lan->curfalloff = curvemapping_copy(la->curfalloff); if (la->nodetree) - lan->nodetree = ntreeCopyTree(la->nodetree); + lan->nodetree = ntreeCopyTree(bmain, la->nodetree); if (la->preview) lan->preview = BKE_previewimg_copy(la->preview); if (ID_IS_LINKED_DATABLOCK(la)) { - BKE_id_lib_local_paths(G.main, la->id.lib, &lan->id); + BKE_id_lib_local_paths(bmain, la->id.lib, &lan->id); } return lan; @@ -200,7 +200,7 @@ void BKE_lamp_make_local(Lamp *la) id_clear_lib_data(bmain, &la->id); } else if (is_local && is_lib) { - Lamp *la_new = BKE_lamp_copy(la); + Lamp *la_new = BKE_lamp_copy(bmain, la); la_new->id.us = 0; /* Remap paths of new ID using old library as base. */ |