[WIP - lens.autofocusing, ...] Lua Property access

Started by garry23, November 04, 2017, 12:10:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

@A1ex or anyone

I'm trying to make use of a long halfshutter and need to differentiate it from a LV AF action.

I thought I could use the Lua property handler, eg accessing LV_FOCUS_STATE or another LV_FOCUS property, ie to handle the AF condition.

But the LV_FOCUS property handler always seems to return 0.

Does this mean it is not yet exposed in Lua?

Cheers

Garry

a1ex

It's PROP_LV_FOCUS_STATUS; value is 3 during autofocus (hopefully on all models) and 1 or 2 (depending on model) when idle.

What about adding a boolean field named lens.focusing ?

(sorry for being slow with Lua requests - it's just not something I use often, although I do see its value for the ML project)

garry23

@a1ex

You never have to apologize! Not with all the work you do and with all the knowledge you have.

I tried that prop and only got 0 returned on my EOSM.

Here is the test code:

my_key = 0

function check_requests()
        display.notify_box(tostring(my_key),2000)
        return true
end

function property.LV_FOCUS_STATUS:handler(value)
     my_key = value
end

event.shoot_task = check_requests

a1ex

The script works fine on 5D3, and likely on all other models that pass api_test.lua. EOS M is probably not one of them...

garry23

@a1ex

OK, I'll test tomorrow on the 5D3.

I need a way (tonight if possible) to test if image is being taken, via Lua.

Is there another way?

Cheers

Garry

a1ex

To test if an image is being taken, in order to do something during a long exposure? Or to do something after the image was taken?

The former is not exposed to Lua, but is doable. The latter is easier - see e.g. in api_test.lua: dryos.shooting_card.file_number gets incremented after a picture is taken.

garry23

@a1ex

Yes it's the long exposure test.

It would be great to be able to test if image taking started and image taking finished.

Cheers

Garry