CHDK Forum

CHDK Development => General Discussion and Assistance => Topic started by: NovaJeff on 23 / July / 2011, 22:33:48

Title: set_focus command not working on SX130 1.01c
Post by: NovaJeff on 23 / July / 2011, 22:33:48
Hello fellow CHDK lovers, especially those who love the ability to use/write scripts!

I think I found a little but nasty bug with the SX130 version of CHDK:

Many scripts that I love have an option to set focus to infinity at the beginning of a shoot session, then lock it there for the rest of the shooting. I think mainly about some nice intervalometers.

Unfortunately, the set_focus command does not seem to have any effect.

So please, try this little test script I wrote, tell me if you experience the same problem as I do.

So maybe some guru will spend few minutes fixing this thing for us, poor humans.  :haha

Thank you all!

Jeff
Title: Re: set_focus command not working on SX130 1.01c
Post by: esmail on 31 / October / 2011, 08:13:17
Hi,

Did anything come of this? Just curious.

Esmail
Title: Re: set_focus command not working on SX130 1.01c
Post by: philmoz on 31 / October / 2011, 17:45:24
http://chdk.setepontos.com/index.php?topic=5691.msg70733#msg70733 (http://chdk.setepontos.com/index.php?topic=5691.msg70733#msg70733)
Title: Re: set_focus command not working on SX130 1.01c
Post by: esmail on 31 / October / 2011, 17:55:52
http://chdk.setepontos.com/index.php?topic=5691.msg70733#msg70733 (http://chdk.setepontos.com/index.php?topic=5691.msg70733#msg70733)

Thanks Phil - I do have a question about the semantics of set_aflock 1. Your post that you referenced said:

"Try putting the 'set_aflock 1' before the 'set_focus 65535' ..."

The way I understood it what  set_af_lock does based in its name, it locks the current focus, so it would have made sense to me to set the focus first to what you want, and then lock it.

However, the way you have it, suggests that set_aflock 1 really disables autofocus, so that if you set focus to something else it won't change from that - is that correct? So wouldn't set_disable_af be a more accurate name for this operation, or am I misunderstanding something? The name doesn't matter to me here so much, I just want to be sure I'm good on how this works.

I was looking here: http://chdk.wikia.com/wiki/Script_commands (http://chdk.wikia.com/wiki/Script_commands)

"You can use it like this: halfpress (so autofocus is set), then call aflock(1), the focus is now FIXED, meaning another halfpress will NOT refocus (the AF lamp doesnt turn on even). When you dont need the fixed focus anymore, call set_aflock(0)."


Thanks,

Esmail
Title: Re: set_focus command not working on SX130 1.01c
Post by: philmoz on 31 / October / 2011, 18:34:24
As you've noted, set_aflock doesn't lock the focus.
It locks/unlocks the autofocus (AF) mechanism so the camera stops trying to refocus and allowing manual focus settings.

The function names were set a long time ago (in a galaxy far far away...) and aren't likely to change.

Phil.
Title: Re: set_focus command not working on SX130 1.01c
Post by: esmail on 31 / October / 2011, 18:51:58
As you've noted, set_aflock doesn't lock the focus.
It locks/unlocks the autofocus (AF) mechanism so the camera stops trying to refocus and allowing manual focus settings.

The function names were set a long time ago (in a galaxy far far away...)


 :)

Quote
and aren't likely to change.

Phil.

No, I understand and wouldn't expect the names to change, just wanted to nail down the semantics, especially since the description

"You can use it like this: halfpress (so autofocus is set), then call aflock(1), the focus is now FIXED, .."

seems to imply focus first, then lock.

Thanks for clarifying this.

Esmail