Magic Lantern Forum
Developing Magic Lantern => Scripting Corner => Scripting API suggestions => Topic started by: garry23 on November 04, 2017, 12:10:32 PM
-
@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
-
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)
-
@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
-
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...
-
@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
-
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 (https://bitbucket.org/hudson/magic-lantern/src/edbf5ee/scripts/api_test.lua?fileviewer=file-view-default#api_test.lua-835): dryos.shooting_card.file_number gets incremented after a picture is taken.
-
@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