Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting Q&A => Topic started by: garry23 on February 27, 2016, 08:25:23 AM

Title: Help with Lua event.post_shoot
Post by: garry23 on February 27, 2016, 08:25:23 AM
Has anyone used the Lua post_shoot event handler?

I've tried both post and pre and can't seem to get them to pick up on an image capture. My fear is I'm using them wrong, but I don't trigger a runtime error.

Here's the relevant code:


event.post_shoot = function(arg)
if keymenu.submenu["Turn On/Off"].value == "On" then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end


The above code runs OK inside an event.keypress handler.
Title: Re: Help with Lua event.post_shoot
Post by: dmilligan on February 27, 2016, 02:07:49 PM
They were never implemented in the ML core, only defined. They don't work at all.

You can use property.GUI_STATE:handler() to detect QR mode, which is pretty close.
Title: Re: Help with Lua event.post_shoot
Post by: garry23 on February 27, 2016, 03:23:27 PM
David

Thanks  :)

I thought I was going mad :'(

As I get more understanding of Lua, I'm obviously pushing myself into areas where ML-Lua is not fully fit yet.

Thanks for your prompt feedback as usual - especially at the weekend as I sit down to watch the Six Nations  ;)

BTW have you any idea when the lens movement release will be pushed out. My next iteration is to write the bracketing script to run automatically, ie one button push.

Cheers

Garry