Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting API suggestions => Topic started by: garry23 on November 28, 2017, 11:21:23 PM

Title: Lua Properties: additional property request
Post by: garry23 on November 28, 2017, 11:21:23 PM
Using Lua property one can 'detect' changes in the shutter, aperture and ISO.

Could we also add a property to detect changes to focus distance and focal length?

Cheers

Garry
Title: Re: Lua Properties: additional property request
Post by: dmilligan on November 29, 2017, 02:27:30 AM
You mean the Canon prop handlers? We can’t add new Canon properties, Lua simply exposes a way for scrips to register callbacks for existing Canon properties. If there’s already a Canon property that fires when the focus distance or focal length changes, you can use those (I believe there are but there may be limitations). If not, a method for doing that will have to be developed in the ML core (possibly requiring some reverse engineering, see the thread about MPU/lens communication) and exposed to Lua (probably as an event).
Title: Re: Lua Properties: additional property request
Post by: garry23 on November 29, 2017, 07:44:31 AM
@dmilligan

Understood and not a priority.

I have already solved it by explicitly tracking and checking aperture, focus distance and focal length.

My use is in my focus bar script, as unless the above 'properties' change, there is no point updating the focus bar, i.e. wasted Lua cpu action.

Until I did the above, my script constantly was updating, i.e. every time my shoot_task event ran.

I just thought the property approach would be 'better'.

Thanks for the education.

Cheers

Garry