Two in one:

- 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
This commit is contained in:
Ton Roosendaal
2007-01-15 12:44:45 +00:00
parent a8a339b26e
commit c01aaac311
5 changed files with 28 additions and 10 deletions

View 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

View 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) {

View 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

View 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];
}

View 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);