Lock focus in a script - Script Writing - CHDK Forum

Lock focus in a script

  • 20 Replies
  • 7177 Views
*

fma

Lock focus in a script
« on: 24 / February / 2010, 04:48:17 »
Advertisements
Hello,

Is there a way to lock the focus in a script?

I tried to start my script with a press "shoot_half", then set the focus distance, then use click "shoot_full", but the camera always refocus before shooting...

Thanks for your help!

*

fma

Re: Lock focus in a script
« Reply #1 on: 25 / February / 2010, 09:05:44 »
I also tried press/release "shoot_full", without success :(


*

fma

Re: Lock focus in a script
« Reply #2 on: 25 / February / 2010, 09:21:15 »
I found a dirty workarround. I first get the focus distance:

    get_focus f

then, in the loop, I do:

    press "shoot_half"
    set_focus f
    press "shoot_full"
    release "shoot_full"
    release "shoot_half"

but it is not very nice, because the camera tries to refocus at each shot, and if it can't, the lens makes a complete focus move. I would like to avoid this, as it is not good for the motor, neither for the batteries!

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Lock focus in a script
« Reply #3 on: 25 / February / 2010, 09:38:59 »


*

fma

Re: Lock focus in a script
« Reply #4 on: 25 / February / 2010, 10:48:25 »
Looks like what I need, but I can't make it work.

I have firmware 0.9.9-874 101a for a A570. Is it OK?

How should I use af_lock? Can I use shoot, or should I use press/release shoot_half/full?

Thanks,

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Lock focus in a script
« Reply #5 on: 25 / February / 2010, 11:58:59 »
On my a710 it works:

set_aflock(1)  -- makes AF scan and locks AF
shoot()   -- shoot without AF
set_aflock(0)  --unlock AF
shoot() -- shoot with AF

edit: Other solution for a570

press("shoot_half")
sleep(2000) -- waiting for AF
press("down")  -- locks AF
release("down")
release("shoot_half")  -- release all keys
shoot()
shoot()
cleep(1000)
click("down") -- release AF
« Last Edit: 25 / February / 2010, 12:13:03 by ewavr »

*

fma

Re: Lock focus in a script
« Reply #6 on: 25 / February / 2010, 12:14:28 »
Ok, it works with aflock! I didn't see that set_aflock(1) make an AF cycle...

Thank you very much :)
« Last Edit: 25 / February / 2010, 12:16:09 by fma »

Re: Lock focus in a script
« Reply #7 on: 25 / February / 2010, 20:35:12 »
However, if your A570 is like my A590, you'll find that even using aflock the camera still goes through the focusing process each time you take a picture, or at least a lot of it.  It ends up with the fixed focus you've set, but on my camera there is still a good bit of mechanical noise.  It's as though it goes through the autofocus process, but then discards that and uses the aflock value.  The only way I've found to avoid this and just have it click the shutter is to keep it in MF mode, which requires leaving the display activated.  I do that, and stick an unconnected plug into the A/V jack, which saves a little power, but not much.

Since my A590 is probably the last Canon P&S I'll be able to buy at a reasonable price which has full manual control, I'd like to do what I can to make it last.  So I'm willing to change the batteries more often if that will help.  But if there's another way to solve this problem and still turn off the display, I'd like to know about it.


*

Offline dvip

  • ****
  • 451
Re: Lock focus in a script
« Reply #8 on: 26 / February / 2010, 00:24:31 »
In my A590IS-101b this script locks the focus fine. I use it a lot in macro mode.
And when shooting raw I add some sleep time after shoot().


--[[
Lock focus and shoot
--]]
set_aflock(1)
sleep(1000)
shoot()
sleep(3800)
set_aflock(0)
exit_alt()

*

fma

Re: Lock focus in a script
« Reply #9 on: 26 / February / 2010, 03:08:08 »
Peabody, you're right, the set_aflock() does nothing if I turn off the display :( Grr!

Do you have a nice solution for an external battery?

 

Related Topics