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:
authorTon Roosendaal <ton@blender.org>2004-12-08 22:08:37 +0300
committerTon Roosendaal <ton@blender.org>2004-12-08 22:08:37 +0300
commitd8797f36f7c43959fed5ec3deb31fff12a0b161b (patch)
tree64326071e6199db9838bb0cbf465b4d01b31a470 /source/blender/blenloader
parentef4ac2b592a62b4c160b764acdffe5fa1d9a4b9b (diff)
Bug fix based on bug report Chris Burt, IRC.
Appending objects with constraints expands links to objects (according code) but doesn't give such objects a link to Scene. Apprently, somewhere in NaN days, someone commented a call, which already invoked comments... here's the full code + comments now: /* give a base to loose objects */ give_base_to_objects(G.scene, &(G.main->object)); /* has been removed... erm, why? (ton) */ /* 20040907: looks like they are give base already in append_named_part(); -Nathan L */ /* 20041208: put back. It only linked direct, not indirect objects (ton) */ :-)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d2551bf484d..1cd72598184 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5217,7 +5217,7 @@ static void expand_main(FileData *fd, Main *mainvar)
}
}
-#if 0
+
static void give_base_to_objects(Scene *sce, ListBase *lb)
{
Object *ob;
@@ -5229,28 +5229,22 @@ static void give_base_to_objects(Scene *sce, ListBase *lb)
if(ob->id.us==0) {
- if(ob->id.flag & LIB_NEEDLINK) {
-
- ob->id.flag -= LIB_NEEDLINK;
-
- if( ob->id.flag & LIB_INDIRECT ) {
-
- base= MEM_callocN( sizeof(Base), "add_ext_base");
- BLI_addtail(&(sce->base), base);
- base->lay= ob->lay;
- base->object= ob;
- ob->id.us= 1;
+ if( ob->id.flag & LIB_INDIRECT ) {
+ base= MEM_callocN( sizeof(Base), "add_ext_base");
+ BLI_addtail(&(sce->base), base);
+ base->lay= ob->lay;
+ base->object= ob;
+ ob->id.us= 1;
- ob->id.flag -= LIB_INDIRECT;
- ob->id.flag |= LIB_EXTERN;
+ ob->id.flag -= LIB_INDIRECT;
+ ob->id.flag |= LIB_EXTERN;
- }
}
}
ob= ob->id.next;
}
}
-#endif
+
static void append_named_part(FileData *fd, Main *mainvar, Scene *scene, char *name, int idcode, short flag)
{
@@ -5435,10 +5429,11 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
lib_link_all(fd, G.main);
/* give a base to loose objects */
- /* give_base_to_objects(G.scene, &(G.main->object)); */
+ give_base_to_objects(G.scene, &(G.main->object));
/* has been removed... erm, why? (ton) */
/* 20040907: looks like they are give base already in append_named_part(); -Nathan L */
-
+ /* 20041208: put back. It only linked direct, not indirect objects (ton) */
+
/* patch to prevent switch_endian happens twice */
if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
blo_freefiledata((FileData*) sfile->libfiledata);