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/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c86
1 files changed, 73 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 48585d6230f..ef33c0aa859 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3439,7 +3439,11 @@ static void lib_link_object(FileData *fd, Main *main)
if(ob->proxy->id.lib==NULL) {
ob->proxy->proxy_from= NULL;
ob->proxy= NULL;
- printf("Proxy lost from object %s lib %s\n", ob->id.name+2, ob->id.lib->name);
+
+ if (ob->id.lib)
+ printf("Proxy lost from object %s lib %s\n", ob->id.name+2, ob->id.lib->name);
+ else
+ printf("Proxy lost from object %s lib <NONE>\n", ob->id.name+2);
}
else {
/* this triggers object_update to always use a copy */
@@ -3883,9 +3887,6 @@ static void direct_link_object(FileData *fd, Object *ob)
/* weak weak... this was only meant as draw flag, now is used in give_base too */
ob->flag &= ~OB_FROMGROUP;
- /* editmode doesn't get saved in files, so should get cleared when reloading... */
- ob->mode &= ~(OB_MODE_EDIT|OB_MODE_PARTICLE_EDIT);
-
ob->disp.first=ob->disp.last= NULL;
ob->adt= newdataadr(fd, ob->adt);
@@ -4615,6 +4616,11 @@ static void lib_link_screen(FileData *fd, Main *main)
SpaceImage *sima= (SpaceImage *)sl;
sima->image= newlibadr_us(fd, sc->id.lib, sima->image);
+
+ /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
+ * so fingers crossed this works fine!
+ */
+ sima->gpd= newlibadr_us(fd, sc->id.lib, sima->gpd);
}
else if(sl->spacetype==SPACE_NLA){
SpaceNla *snla= (SpaceNla *)sl;
@@ -4753,7 +4759,10 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
View3D *v3d= (View3D*) sl;
BGpic *bgpic;
- v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
+ if(v3d->scenelock)
+ v3d->camera= NULL; /* always get from scene */
+ else
+ v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
if(v3d->camera==NULL)
v3d->camera= sc->scene->camera;
v3d->ob_centre= restore_pointer_by_name(newmain, (ID *)v3d->ob_centre, 1);
@@ -4829,6 +4838,17 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
SpaceImage *sima= (SpaceImage *)sl;
sima->image= restore_pointer_by_name(newmain, (ID *)sima->image, 1);
+
+ sima->scopes.waveform_1 = NULL;
+ sima->scopes.waveform_2 = NULL;
+ sima->scopes.waveform_3 = NULL;
+ sima->scopes.vecscope = NULL;
+ sima->scopes.ok = 0;
+
+ /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
+ * so assume that here we're doing for undo only...
+ */
+ sima->gpd= restore_pointer_by_name(newmain, (ID *)sima->gpd, 1);
}
else if(sl->spacetype==SPACE_NLA){
SpaceNla *snla= (SpaceNla *)sl;
@@ -5091,13 +5111,23 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
SpaceImage *sima= (SpaceImage *)sl;
sima->cumap= newdataadr(fd, sima->cumap);
- sima->gpd= newdataadr(fd, sima->gpd);
- if (sima->gpd)
- direct_link_gpencil(fd, sima->gpd);
if(sima->cumap)
direct_link_curvemapping(fd, sima->cumap);
+
sima->iuser.scene= NULL;
sima->iuser.ok= 1;
+ sima->scopes.waveform_1 = NULL;
+ sima->scopes.waveform_2 = NULL;
+ sima->scopes.waveform_3 = NULL;
+ sima->scopes.vecscope = NULL;
+ sima->scopes.ok = 0;
+
+ /* WARNING: gpencil data is no longer stored directly in sima after 2.5
+ * so sacrifice a few old files for now to avoid crashes with new files!
+ */
+ //sima->gpd= newdataadr(fd, sima->gpd);
+ //if (sima->gpd)
+ // direct_link_gpencil(fd, sima->gpd);
}
else if(sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;
@@ -8410,12 +8440,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if(main->versionfile <= 243) {
Object *ob= main->object.first;
- Camera *cam = main->camera.first;
Material *ma;
-
- for(; cam; cam= cam->id.next) {
- cam->angle= 360.0f * (float)atan(16.0f/cam->lens) / (float)M_PI;
- }
for(ma=main->mat.first; ma; ma= ma->id.next) {
if(ma->sss_scale==0.0f) {
@@ -9621,6 +9646,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
BLI_path_abs(str, G.sce);
seq->sound = sound_new_file(main, str);
}
+ /* don't know, if anybody used that
+ this way, but just in case, upgrade
+ to new way... */
+ if((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) &&
+ !(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR))
+ {
+
+ snprintf(seq->strip->proxy->dir,
+ FILE_MAXDIR, "%s/BL_proxy",
+ seq->strip->dir);
+ }
}
}
}
@@ -10712,6 +10748,30 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
do_version_old_trackto_to_constraints(ob);
}
+ if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 5)) {
+ bScreen *sc;
+
+ /* Image editor scopes */
+ for(sc= main->screen.first; sc; sc= sc->id.next) {
+ ScrArea *sa;
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
+ SpaceLink *sl;
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if(sl->spacetype==SPACE_IMAGE) {
+ SpaceImage *sima = (SpaceImage *)sl;
+ sima->scopes.accuracy = 30.0;
+ sima->scopes.hist.mode=HISTO_MODE_RGB;
+ sima->scopes.wavefrm_alpha=0.3;
+ sima->scopes.vecscope_alpha=0.3;
+ sima->scopes.wavefrm_height= 100;
+ sima->scopes.vecscope_height= 100;
+ sima->scopes.hist.height= 100;
+ }
+ }
+ }
+ }
+ }
+
/* put 2.50 compatibility code here until next subversion bump */
{