diff options
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 5 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 13 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.h | 1 |
4 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 77c891ee82e..a25afeafaef 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1163,7 +1163,10 @@ static void copy_object_pose(Object *obn, Object *ob) ListBase targets = {NULL, NULL}; bConstraintTarget *ct; - if(con->ipo) { + /* note that we can't change lib linked ipo blocks. for making + * proxies this still works correct however because the object + * is changed to object->proxy_from when evaluating the driver. */ + if(con->ipo && !con->ipo->id.lib) { IpoCurve *icu; for(icu= con->ipo->curve.first; icu; icu= icu->next) { if(icu->driver && icu->driver->ob==ob) diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 5a75b5c8b11..e4bc6e3abb2 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -364,6 +364,9 @@ BlendFileData *BLO_read_from_memfile(const char *filename, MemFile *memfile, Ble if (fd) { strcpy(fd->filename, filename); + /* clear ob->proxy_from pointers in G.main */ + blo_clear_proxy_pointers_from_lib(fd); + /* separate libraries from G.main */ blo_split_main(&mainlist, G.main); /* add the library pointers in oldmap lookup */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3a9d0a6ae6a..acedf51e619 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1130,6 +1130,19 @@ static void change_idid_adr(ListBase *mainlist, FileData *basefd, void *old, voi } } +/* lib linked proxy objects point to our local data, we need + * to clear that pointer before reading the undo memfile since + * the object might be removed, it is set again in reading + * if the local object still exists */ +void blo_clear_proxy_pointers_from_lib(FileData *fd) +{ + Object *ob= G.main->object.first; + + for(;ob; ob= ob->id.next) + if(ob->id.lib) + ob->proxy_from= NULL; +} + /* assumed; G.main still exists */ void blo_make_image_pointer_map(FileData *fd) { diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index 7ddb1e361da..8547a4d9652 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -112,6 +112,7 @@ FileData *blo_openblenderfile( char *name, BlendReadError *error_r); FileData *blo_openblendermemory( void *buffer, int buffersize, BlendReadError *error_r); FileData *blo_openblendermemfile(struct MemFile *memfile, BlendReadError *error_r); +void blo_clear_proxy_pointers_from_lib(FileData *fd); void blo_make_image_pointer_map(FileData *fd); void blo_end_image_pointer_map(FileData *fd); void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd); |