This is my first script, though it's basically a mish-mash of different scripts with a few personal touches thrown in.
Some of the features here are irrelevant on most cameras (those with custom auto-timers), but they're necessary for my (6 year old) SD300.
It uses get_prop commands, so I suspect it's only for Digic II. If there are analogous commands, then I'm keen to hear them.
I'm not posting this in completed scripts for a couple of reasons. First, I can't be certain it's completed without feedback. Second, since most CHDK cameras have the built-in custom auto-timer, this script is probably of limited utility.Credit to:Nicolas Bertolissio
for his Bracketing and EV correction script
This served as the basis for my script, especially the nifty menu system for on-the-fly adjustment of script parameters.Primary modification:
Since I'm assuming use of CHDK's built-in Continuous Mode Bracketing, I'm using a half-press followed by holding down full-press instead of individual "shoot_full" commands. I've replaced his now-semi-redundant Ev bracketing with a start delay (to minimize camera shake for those of us without a remote).vine
for his Bracketing series
for his modifications to it (use of get_exp_count).
This was necessary since a half-press apparently initiates propcase 205, so I couldn't use get_prop 205 to determine when an exposure had completed. get_exp_count is more accurate than get_jpg_count or get_raw_count.Primary modification:
As rawhead noticed, occasionally get_exp_count will lurch unexpectedly putting the camera into an infinite loop. I simply put an error condition in for when this happens. I haven't actually seen it happen when the script was working properly, but when OTHER parts of the script were malfunctioning and it took multiple sets the error condition was occasionally activated. (I've just seen a single reference to propcase 118 - or 218, I think there's a typo in the post - that's described as "number of shots in continuous mode", which might be useful.)Alain, Divalent
for use of get_prop 67 for verifying successful focus
I like this method better than a generic "sleep" delay, as it verifies the camera actually focused on something before taking the set, moves on immediately after focus is obtained, and it allows for automatic refocus attempts when focusing fails.Primary modification:
First, I modified the logic to shrink it down a tad. Second, propcase 67 didn't give me the same values as it did Alain and Divalent. (Their observation was 0 when there was no focus, and 1 when focus was successfully obtained.) On my SD300, get_prop 67 gave me 0 when there was no focus, but higher numbers (in the 30s, 60s, and 100s, IIRC) when focus was obtained. I suspect this may because my camera has no manual focus mode. While I'm not sure, I think the numbers were higher the more AiAF brackets were locked. That said, all that was necessary was to test for get_prop 67 being greater than 0 rather than equal to 1.So what does it do?
- Takes a user-defined number of photos using CHDK's Continuous Mode Bracketing
- Allows a user-defined Ev offset (basically, defines the "center" exposure)
- Allows a user-defined start delay to minimize button-press camera shake
- Warns (and refuses to run) if Continuous Mode is Off or if the Flash is On
- Provides a convenient runtime menu for on-the-fly adjustment of Ev offset, # of shots, and start delay
Ok, so where is it?
- Through the CHDK menu, configure "Bracketing in Continuous Mode" as desired
- Set the Flash to "Off" and shooting mode to "Continuous"
- Start the script, which will bring up the runtime menu
- Click Up and Down to select a value to change, then Right and Left to modify it
- When ready, press SET to start
- The script will delay by the specified number of seconds and then attempt to focus.
- Once focus is achieved, the script will take the specified number of shots and return to the menu
- When finished, interrupt the script with the shutter, or press Disp to exit.
Oh, right...the script...
@param a Number of shots
@default a 5
@param c Ev Offset (1/3 EV) -12..12
@default c 0
@param b Delay (s)
@default b 1
get_prop 6 q
get_prop 16 r
if q<>1 or r<>2 then goto "wrongmode"
get_prop 25 w
get_prop 26 x
if a<1 then let a=1
if b<0 then let b=0
if c<-12 then let c=-12
if c>12 then let c=12
if y<1 then y=3
if y>3 then y=1
print "!!Verify Bracketing!!"
if y=1 then print " Shots: <",a,">" else print " Shots: ",a
if y=2 then print "Offset: <",c/3,c%3;"/3 >" else print "Offset: ",c/3,c%3;"/3"
if y=3 then print " Delay: <",b,"sec >" else print " Delay: ",b,"sec"
print "[Set]=Shoot [Disp]=exit"
if is_key "up" then let y=y-1
if is_key "down" then let y=y+1
if y=1 and is_key "left" then let a=a-1
if y=2 and is_key "left" then let c=c-1
if y=3 and is_key "left" then let b=b-1
if y=1 and is_key "right" then let a=a+1
if y=2 and is_key "right" then let c=c+1
if y=3 and is_key "right" then let b=b+1
if is_key "set" then z=1
if is_key "display" then z=2
if z=2 then goto "exit1"
set_prop 25 c*32
set_prop 26 c*32
if b>0 then print b,"sec delay"
for p=1 to 100
get_prop 67 j
if j>0 then goto "shoot"
print "Attempting refocus"
if e>d then gosub "ExpOver"
set_prop 25 w
set_prop 26 x
print "Exposure count asplode!"
if q<>1 then print "Continuous Mode Off"
if r<>2 then print "Flash On"