Almost there with grad ND script

Started by sbroos, June 29, 2013, 11:22:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sbroos

I am trying to write a script for use with an ND grad.
This script will first tell me to take a picture with the ND grad, it will also immediately record shutter, aperture and iso.
Then the script will tell the user to remove the grad filter and retake (it will retake the picture with the exact same settings as before). This way the user can correct some problems with the grad filter in post with the exact same exposure settings (overlapping trees etc).

The problem is, taking the first picture works perfectly, and the script will also report the correct settings afterwards.
However, the second picture, that is taken after a button press, is taken with the wrong settings (in Av or Tv modus, ofcourse it remains the same in M) altough I set the aperture, time and ISO to a different setting. To test I point the camera the second time at something with a completely different exposure. However, since I set the aperture, shutter and ISO, they should remain the same as in the first picture (at the moment they don't).

What is wrong?


/*
@title ND Grad script
*/

// Disable all canon stuff
int old_gdr = menu_get("Overlay", "Global Draw");
menu_set("Overlay", "Global Draw", 0);
set_canon_gui(0);
console_hide();
clrscr();

sleep(1);

// Print first text
bmp_printf(FONT(FONT_LARGE, COLOR_RED, COLOR_BLACK),
50, 200, "Take pic with ND");

// Take the picture
wait_pic();

// Taken on a tripod, focus should be consistent
set_af(0);

// Get all parameters
float cur_ap = get_aperture();
float cur_tv = get_shutter();
int cur_iso  = get_iso();

sleep(cur_tv+4);
clrscr();

// Display some other text
bmp_printf(FONT(FONT_LARGE, COLOR_GREEN1, COLOR_BLACK),
50, 125, "Settins recorded:\nap %f tv %f iso %d",cur_ap,cur_tv,cur_iso);
bmp_printf(FONT(FONT_LARGE, COLOR_RED, COLOR_BLACK),
50, 250, "Remove grad and press key\n to retake pic without grad");
beep();


// Wait for keypress
wait_key();

// Change settings and take pic
set_aperture(cur_ap);
set_shutter(cur_tv);
set_iso(cur_iso);
takepic();

// Restore af
reset_af(1);

// Restore canon views
menu_set("Overlay", "Global Draw", old_gdr);
set_canon_gui(1);