Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r--source/blender/blenkernel/intern/lattice.c14
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(&lt->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, &lt->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, &lt->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);