[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28314] branches/render25/source/blender/ blenloader/intern/readfile.c: excude the over cautiousness, removing changes unintentionally made -r28309, probably harmless but rather match trunk.
Campbell Barton
ideasman42 at gmail.com
Tue Apr 20 23:57:32 CEST 2010
Revision: 28314
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28314
Author: campbellbarton
Date: 2010-04-20 23:57:32 +0200 (Tue, 20 Apr 2010)
Log Message:
-----------
excude the over cautiousness, removing changes unintentionally made -r28309, probably harmless but rather match trunk.
Modified Paths:
--------------
branches/render25/source/blender/blenloader/intern/readfile.c
Modified: branches/render25/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/render25/source/blender/blenloader/intern/readfile.c 2010-04-20 21:38:55 UTC (rev 28313)
+++ branches/render25/source/blender/blenloader/intern/readfile.c 2010-04-20 21:57:32 UTC (rev 28314)
@@ -231,7 +231,6 @@
typedef struct OldNew {
void *old, *newp;
int nr;
- int refself;
} OldNew;
typedef struct OldNewMap {
@@ -340,7 +339,7 @@
if(entry) {
ID *id= entry->newp;
- if (id && (!lib || id->lib || entry->refself)) {
+ if (id && (!lib || id->lib)) {
return entry->newp;
}
}
@@ -1136,20 +1135,6 @@
return id;
}
-static void id_allow_self_ref(FileData *fd, void *oldp)
-{
- int i;
-
- for (i=0; i<fd->libmap->nentries; i++) {
- OldNew *entry= &fd->libmap->entries[i];
-
- if (entry->old == oldp) {
- entry->refself = 1;
- break;
- }
- }
-}
-
static void change_idid_adr_fd(FileData *fd, void *old, void *new)
{
int i;
@@ -1160,6 +1145,7 @@
if (old==entry->newp && entry->nr==ID_ID) {
entry->newp= new;
if(new) entry->nr= GS( ((ID *)new)->name );
+ break;
}
}
}
@@ -3438,7 +3424,7 @@
if (ob->id.properties) IDP_LibLinkProperty(ob->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
if (ob->adt) lib_link_animdata(fd, &ob->id, ob->adt);
-// XXX depreceated - old animat7ion system <<<
+// XXX depreceated - old animation system <<<
ob->ipo= newlibadr_us(fd, ob->id.lib, ob->ipo);
ob->action = newlibadr_us(fd, ob->id.lib, ob->action);
// >>> XXX depreceated - old animation system
@@ -10704,7 +10690,7 @@
wo->ao_env_energy *= 0.5f;
}
}
-
+
if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 17)) {
Scene *sce;
Sequence *seq;
@@ -11126,7 +11112,7 @@
bhead= find_bhead(fd, old);
if(bhead) {
- /* from another library? */
+ /* from another library? */
if(bhead->code==ID_ID) {
BHead *bheadlib= find_previous_lib(fd, bhead);
@@ -11150,35 +11136,10 @@
* user.blend, lib.blend and lib_indirect.blend - if user.blend alredy references a "tree" from
* lib_indirect.blend but lib.blend does too, linking in a Scene or Group from lib.blend can result in an
* empty without the dupli group referenced. Once you save and reload the group would appier. - Campbell */
-
/* This crashes files, must look further into it */
-
- //oldnewmap_insert(fd->libmap, bhead->old, id, 1);
-
- /*if linked file references something in the host .blend, insert it into the map.
- this exception should be safe to the "don't tun oldnewmap_insert here" problem. */
- /*oookkkkay this code needs the root fd to work, will have to work on it later.
- if (ptr == fd->mainlist.first) {
- int i = 0;
- OldNew *entry = NULL;
-
- for (i=0; i<fd->libmap->nentries; i++) {
- if (fd->libmap->entries[i].old == bhead->old) {
- entry = fd->libmap->entries + i;
- break;
- }
- }
-
- if (!entry) {
- oldnewmap_insert(fd->libmap, bhead->old, id, 1);
- }
-
- id_allow_self_ref(fd, bhead->old);
- }
- */
-
+ /*oldnewmap_insert(fd->libmap, bhead->old, id, 1);*/
+
change_idid_adr_fd(fd, bhead->old, id);
-
// commented because this can print way too much
// if(G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
}
@@ -12317,7 +12278,30 @@
BKE_reportf(basefd->reports, RPT_INFO, "read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name);
fd= blo_openblenderfile(mainptr->curlib->filename, basefd->reports);
+
+ /* allow typing in a new lib path */
+ if(G.rt==-666) {
+ while(fd==NULL) {
+ char newlib_path[240] = { 0 };
+ printf("Missing library...'\n");
+ printf(" current file: %s\n", G.sce);
+ printf(" absolute lib: %s\n", mainptr->curlib->filename);
+ printf(" relative lib: %s\n", mainptr->curlib->name);
+ printf(" enter a new path:\n");
+ scanf("%s", newlib_path);
+ strcpy(mainptr->curlib->name, newlib_path);
+ strcpy(mainptr->curlib->filename, newlib_path);
+ cleanup_path(G.sce, mainptr->curlib->filename);
+
+ fd= blo_openblenderfile(mainptr->curlib->filename, basefd->reports);
+
+ if(fd) {
+ printf("found: '%s', party on macuno!\n", mainptr->curlib->filename);
+ }
+ }
+ }
+
if (fd) {
fd->reports= basefd->reports;
@@ -12353,7 +12337,7 @@
append_id_part(fd, mainptr, id, &realid);
if (!realid) {
- printf("LIB ERROR: can't find %s\n", id->name);
+ printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
}
@@ -12389,9 +12373,8 @@
ID *idn= id->next;
if(id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
-
- printf("LIB ERROR: can't find %s\n", id->name);
- BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
+ printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
+ BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
change_idid_adr(mainlist, basefd, id, NULL);
MEM_freeN(id);
More information about the Bf-blender-cvs
mailing list