diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-09 15:44:48 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-09 16:44:12 +0300 |
commit | 9044ccec5f811fd380fc0348d91d1c53729eea22 (patch) | |
tree | ca49364eae2fba58bbc043ae9a72866e0f926588 /source/blender/blenkernel/intern/lattice.c | |
parent | 8bb7a339f76549b4820a670450c0799713d650f8 (diff) |
Cleanup to shapekeys' make_local (and copy) functions.
Mostly pass bmain and do not check for NULL key, keys' make_local is
suspiciously simple in fact, but think until those behave like real
full-featured IDs, it's doing enough!
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 53a3973f2c0..9bf417c6120 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -282,8 +282,10 @@ Lattice *BKE_lattice_copy(Lattice *lt) ltn = BKE_libblock_copy(<->id); ltn->def = MEM_dupallocN(lt->def); - ltn->key = BKE_key_copy(ltn->key); - if (ltn->key) ltn->key->from = (ID *)ltn; + if (lt->key) { + ltn->key = BKE_key_copy(ltn->key); + ltn->key->from = (ID *)ltn; + } if (lt->dvert) { int tot = lt->pntsu * lt->pntsv * lt->pntsw; @@ -339,7 +341,9 @@ void BKE_lattice_make_local(Lattice *lt) if (!ID_IS_LINKED_DATABLOCK(lt)) return; if (lt->id.us == 1) { id_clear_lib_data(bmain, <->id); - BKE_key_make_local(lt->key); + if (lt->key) { + BKE_key_make_local(bmain, lt->key); + } return; } @@ -352,7 +356,9 @@ void BKE_lattice_make_local(Lattice *lt) if (is_local && is_lib == false) { id_clear_lib_data(bmain, <->id); - BKE_key_make_local(lt->key); + if (lt->key) { + BKE_key_make_local(bmain, lt->key); + } } else if (is_local && is_lib) { Lattice *lt_new = BKE_lattice_copy(lt); |