Script command to change the camera focus mode. - Script Writing - CHDK Forum

Script command to change the camera focus mode.

  • 3 Replies
  • 3390 Views
Script command to change the camera focus mode.
« on: 27 / September / 2011, 06:02:34 »
Advertisements
Hi,

is there a command that (the command) can change the focus mode of the camera?
I'm using A590 IS, the camera has three focus modes:
- Normal
- Macro
- MF (Manual Focus)

//edit: I ask because even if the camera uses autofocus feature (i.e. during shoot_half), still, there is a difference in (auto)focusing in Normal / Macro focus modes.

Regards.
« Last Edit: 27 / September / 2011, 06:04:32 by trismarck »

*

Offline reyalp

  • ******
  • 14125
Re: Script command to change the camera focus mode.
« Reply #1 on: 27 / September / 2011, 22:34:46 »
You can do this with scripted key presses, reading back PROPCASE_FOCUS_MODE to figure out when you are in the right mode.

You may be able to set PROPCASE_FOCUS_MODE directly on some cameras, IIRC it didn't work when I tried it.
Don't forget what the H stands for.

Re: Script command to change the camera focus mode.
« Reply #2 on: 30 / September / 2011, 15:55:14 »
Ok, here is the code I tested.
The better approach would probably be to use keypresses.

Code (a590 IS):
Code: [Select]
@title set focus mode to Macro Mode
rem Let's suppose I change the value of
rem some property. It is a good practice
rem to remember the old value of the property
rem and restore the property value at the
rem end of the script. Otherwise unexpected
rem results can happen. Like the one below.

rem   Changing the focus mode to Macro Mode
rem   works through set_prop. The camera icon
rem   for focus mode doesn't update itself
rem   after the change.
rem   Also, it seems that after the change,
rem   the camera is locked in the mode, that
rem   (the mode) I've set through set_prop.
rem   Camera is locked even when I change the
rem   focus mode through the camera buttons.
rem   Or maybe not locked (after switching to
rem   Manual Focus mode)

get_prop 6 o
set_prop 6 1
get_prop 6 p
print "Focus mode is:", p
shoot

rem   Set the old value of the focus property
rem   after taking a picture.
set_prop 6 o

end

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Script command to change the camera focus mode.
« Reply #3 on: 30 / September / 2011, 16:27:59 »
You can only read propcase 6 (focus mode). Writing does not work. Make a key click loop and ask the propcase 6 for the right value.

Code: [Select]
rem click down key until MF
do
    click "down"
until 4=get_prop 6

msl
CHDK-DE:  CHDK-DE links

 

Related Topics


SimplePortal © 2008-2014, SimplePortal