diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-20 01:44:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-20 01:44:43 +0300 |
commit | ccb6e1904abf358c0f999019ffd62d407ecc920b (patch) | |
tree | 7bb8243349754a5add2bd8adaf8d6e99030eca05 /source/blender/blenloader | |
parent | 7165008b354ed1a47a4f2c8f9a384f995c899935 (diff) |
patch from Bjørnar Hansen (anachron)
Multiple background images displaying each on a different axis.
Changes made from the original patch.
- Use an enum rather then multiple booleans.
- Reduced the space taken up by the user interface.
- Made the image template compact display not show fields & premul options.
- Added readfile.c lines so old blendfile images are loaded.
- Option to hide BGpic UI (like modifiers & constraints)
- Use the index rather then a bgpic from the context for the remove operator.
note: could be good to use 1 image for both left+right, for eg, but for this to work as intended we would need to add image flipping depending on the axis so left this commented out for now.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 38 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 4 |
2 files changed, 33 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 96b2b793267..11a9a6efff5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4630,12 +4630,20 @@ static void lib_link_screen(FileData *fd, Main *main) for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; + BGpic *bgpic; v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera); v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre); + /* should be do_versions but not easy adding into the listbase */ if(v3d->bgpic) { - v3d->bgpic->ima= newlibadr_us(fd, sc->id.lib, v3d->bgpic->ima); + v3d->bgpic= newlibadr(fd, sc->id.lib, v3d->bgpic); + BLI_addtail(&v3d->bgpicbase, bgpic); + v3d->bgpic= NULL; + } + + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { + bgpic->ima= newlibadr_us(fd, sc->id.lib, bgpic->ima); } if(v3d->localvd) { v3d->localvd->camera= newlibadr(fd, sc->id.lib, v3d->localvd->camera); @@ -4809,14 +4817,15 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; + BGpic *bgpic; 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); - if(v3d->bgpic) { - v3d->bgpic->ima= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->ima, 1); + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { + bgpic->ima= restore_pointer_by_name(newmain, (ID *)bgpic->ima, 1); } if(v3d->localvd) { /*Base *base;*/ @@ -5089,10 +5098,22 @@ static void direct_link_screen(FileData *fd, bScreen *sc) if (sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; - v3d->bgpic= newdataadr(fd, v3d->bgpic); + BGpic *bgpic; + v3d->flag |= V3D_INVALID_BACKBUF; - if(v3d->bgpic) - v3d->bgpic->iuser.ok= 1; + + link_list(fd, &(v3d->bgpicbase)); + + /* should be do_versions except this doesnt fit well there */ + if(v3d->bgpic) { + bgpic= newdataadr(fd, v3d->bgpic); + BLI_addtail(&v3d->bgpicbase, bgpic); + v3d->bgpic= NULL; + } + + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) + bgpic->iuser.ok= 1; + if(v3d->gpd) { v3d->gpd= newdataadr(fd, v3d->gpd); direct_link_gpencil(fd, v3d->gpd); @@ -8350,8 +8371,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ((SpaceImage *)sl)->iuser.fie_ima= 2; else if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D *)sl; - if(v3d->bgpic) - v3d->bgpic->iuser.fie_ima= 2; + BGpic *bgpic; + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) + bgpic->iuser.fie_ima= 2; } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 4c9c54012f8..7064b8c380f 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2035,8 +2035,10 @@ static void write_screens(WriteData *wd, ListBase *scrbase) if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D *) sl; + BGpic *bgpic; writestruct(wd, DATA, "View3D", 1, v3d); - if(v3d->bgpic) writestruct(wd, DATA, "BGpic", 1, v3d->bgpic); + for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) + writestruct(wd, DATA, "BGpic", 1, bgpic); if(v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd); } else if(sl->spacetype==SPACE_IPO) { |