Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting Q&A => Topic started by: laniik on November 20, 2017, 08:02:18 PM

Title: Basic Focus Question
Post by: laniik on November 20, 2017, 08:02:18 PM
Hi, I am trying to move the focus from front to back. This is my current code:


    while lens.focus(-1) do end

    printf("Focus distance: %s\n",  lens.focus_distance)
    local lens_max = lens.focus_distance
   
    while lens.focus(1) do end
    printf("Focus distance: %s\n",  lens.focus_distance)
    local lens_min = lens.focus_distance


But, I can see in the live mode that the focus is fighting against something else, maybe the autofocus? So it never actually ends, it goes into an infinite look where the focus moves one way for .5 seconds and then moves the other.

Any tips? Thanks!