Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting Q&A => Topic started by: Greg on March 03, 2013, 06:50:37 PM

Title: Focus infinity
Post by: Greg on March 03, 2013, 06:50:37 PM
The script is to be found infinity always in the same place. To assist it in focus stacking.
http://www.youtube.com/watch?v=BDrzvuJogSk

/*
@title Stacking - infinity
*/

if (!lv) { click(LV); sleep(2); }
printf("Focus Stacking - infinity\n");
focus_setup(3, 20, 1); // step size 3, delay 20ms, wait
sleep(0.1);

struct dof * C = get_dof();
int fs = C->focus_dist;
if (fs == 65535)
{
focus_setup(2, 20, 1); // step size 3, delay 20ms, wait
}

for (int j = 0; j < 3; j++)
{
if(j == 1)
{
focus_setup(1, 20, 1); // step size 1, delay 20ms, wait
}

struct dof * D = get_dof();
fs = D->focus_dist;

while (fs == 65535)
{
focus(1);
struct dof * E = get_dof();
fs = E->focus_dist;
}

while (fs != 65535)
{
focus(-1);
struct dof * F = get_dof();
fs = F->focus_dist;
sleep(0.2);
}
sleep(0.1);
}
focus(1); //need for 17-40L

printf("Focus distance : %d mm\n", fs);
Title: Re: Focus infinity
Post by: mk11174 on July 12, 2013, 02:54:31 PM
Can this be converted to TCC?
Title: Re: Focus infinity
Post by: gerk.raisen on July 12, 2013, 04:33:05 PM
The big problem is that we have to wait a TCC script module for run it. :(
After the current raw implementation TCC act only as a ELF loader for modules...
The "scripting" part has been removed.
Also the API are not existent at the moment.
I miss a lot at least PicoC scripting. :( :(
Title: Re: Focus infinity
Post by: mk11174 on July 12, 2013, 05:19:19 PM
Yeah, it would be nice to have a way to just press a button and have cam focus right to infinity no matter what zoom range your at. I have issues at night when doing night lightning and I have nothing to aim at that I can see to focus on, and trying to manually adjust to Infinity and just a little off makes lightning soft, it has to be right on or it don't look good. And during day time if you have a fast storm it is hard to focus on something really fast then set the cam to correct settings for the storm, I miss bolts this way.
Title: Re: Focus infinity
Post by: gerk.raisen on July 13, 2013, 06:42:42 PM
Absolutely agree...
I have exactly the same problems, especially at night.
Even better I think is to have the possibility to choose if map the button to infinity or hyperfocal