Two in one:
authorTon Roosendaal <ton@blender.org>
Mon, 15 Jan 2007 12:44:45 +0000 (12:44 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 15 Jan 2007 12:44:45 +0000 (12:44 +0000)
- Bugfix #5714
  New option "Save changed images" didn't respect relative file names

- Bugfix #5621
  New camera (shiftx, shifty) was missing in IpoWindow as animatable option

source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/makesdna/DNA_ipo_types.h
source/blender/src/editipo_lib.c
source/blender/src/editsima.c

index ac0bc910dbda5769ee9762d87317153401b40cb8..0b4ec067e36820a2855ae5b2c501838845496893 100644 (file)
@@ -1072,7 +1072,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
        
        /* read ibuf */
        ibuf = IMB_loadiffname(name, IB_rect|IB_multilayer);
-       printf("loaded %s\n", name);
+       if(G.f & G_DEBUG) printf("loaded %s\n", name);
        
        if (ibuf) {
 #ifdef WITH_OPENEXR
index ec3f38d67f73907eaf2f0f65278d773a0e448728..b84410b12e78618fad553eb1afb1a93749d38af9 100644 (file)
@@ -166,7 +166,7 @@ int la_ar[LA_TOTIPO]= {
 /* yafray: aperture & focal distance curves added */
 /* qdn: FDIST now available to Blender as well for defocus node */
 int cam_ar[CAM_TOTIPO]= {
-       CAM_LENS, CAM_STA, CAM_END, CAM_YF_APERT, CAM_YF_FDIST
+       CAM_LENS, CAM_STA, CAM_END, CAM_YF_APERT, CAM_YF_FDIST, CAM_SHIFT_X, CAM_SHIFT_Y
 };
 
 int snd_ar[SND_TOTIPO]= {
@@ -1476,6 +1476,10 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type)
                        poin= &(ca->YF_aperture); break;
                case CAM_YF_FDIST:
                        poin= &(ca->YF_dofdist); break;
+               case CAM_SHIFT_X:
+                       poin= &(ca->shiftx); break;
+               case CAM_SHIFT_Y:
+                       poin= &(ca->shifty); break;
                }
        }
        else if(GS(id->name)==ID_SO) {
@@ -1757,6 +1761,13 @@ void set_icu_vars(IpoCurve *icu)
                case CAM_YF_FDIST:
                        icu->ymin = 0.0;
                        icu->ymax = 5000.0;
+                       break;
+                       
+               case CAM_SHIFT_X:
+               case CAM_SHIFT_Y:
+                       icu->ymin= -2.0f;
+                       icu->ymax= 2.0f;
+                       break;
                }
        }
        else if(icu->blocktype==ID_SO) {
index 0bea05bb634c7257ff3d286bc489fb3ad60d3a39..434d4f4926f681a4d97bff0eb5c71939225170e1 100644 (file)
@@ -272,16 +272,20 @@ typedef short IPO_Channel;
 /* ******************** */
 
 /* yafray: totipo & totnam +2 because of added curves */
-#define CAM_TOTIPO     5
-#define CAM_TOTNAM     5
+#define CAM_TOTIPO     7
+#define CAM_TOTNAM     7
 
 #define CAM_LENS       1
 #define CAM_STA                2
 #define CAM_END                3
+
 /* yafray aperture & focal distance curves */
 #define CAM_YF_APERT   4
 #define CAM_YF_FDIST   5
 
+#define CAM_SHIFT_X            6
+#define CAM_SHIFT_Y            7
+
 /* ******************** */
 
 #define SND_TOTIPO     4
index 4c6bb24a3da50e716c158986bdfbcab87620025f..f32e1816b2d085eaa7e9239369e6129c56b9ff40 100644 (file)
@@ -88,7 +88,7 @@ char *wo_ic_names[WO_TOTNAM] = { "HorR", "HorG", "HorB", "ZenR", "ZenG", "ZenB",
 char *la_ic_names[LA_TOTNAM] = { "Energ", "R", "G", "B", "Dist", "SpoSi", "SpoBl",
        "Quad1", "Quad2", "HaInt" };
 /* yafray: two curve names added, 'Apert' for aperture, and 'FDist' for focal distance */
-char *cam_ic_names[CAM_TOTNAM] = { "Lens", "ClSta", "ClEnd", "Apert", "FDist" };
+char *cam_ic_names[CAM_TOTNAM] = { "Lens", "ClSta", "ClEnd", "Apert", "FDist", "ShiftX", "ShiftY" };
 char *snd_ic_names[SND_TOTNAM] = { "Vol", "Pitch", "Pan", "Atten" };
 char *ac_ic_names[AC_TOTNAM] = {"LocX", "LocY", "LocZ", "ScaleX", "ScaleY",
        "ScaleZ", "QuatW", "QuatX", "QuatY", "QuatZ"};
@@ -187,9 +187,7 @@ char *getname_la_ei(int nr)
 
 char *getname_cam_ei(int nr)
 {
-       /* yafray: curves extended to CAM_YF_FDIST */
-       //if(nr>=CAM_LENS && nr<=CAM_END) return cam_ic_names[nr-1];
-       if(nr>=CAM_LENS && nr<=CAM_YF_FDIST) return cam_ic_names[nr-1];
+       if(nr>=CAM_LENS && nr<=CAM_SHIFT_Y) return cam_ic_names[nr-1];
        return ic_name_empty[0];
 }
 
index 8fa2396a6346bf2cfe42d327d7e8161515b0f8dd..b7a5c168f7ec762adfeee5bb1be315263b93a322 100644 (file)
@@ -1847,8 +1847,13 @@ void save_image_sequence_sima(void)
                
                for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next) {
                        if(ibuf->userflags & IB_BITMAPDIRTY) {
-                               if(0 == IMB_saveiff(ibuf, ibuf->name, IB_rect | IB_zbuf | IB_zbuffloat)) {
-                                       error("Could not write image", ibuf->name);
+                               char name[FILE_MAX];
+                               BLI_strncpy(name, ibuf->name, sizeof(name));
+                               
+                               BLI_convertstringcode(name, G.sce, 0);
+
+                               if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) {
+                                       error("Could not write image", name);
                                        break;
                                }
                                printf("Saved: %s\n", ibuf->name);