Help me with LUA

Started by jackyes, March 27, 2017, 08:17:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jackyes

Hi all,

i'm writing my first lua script but i have some question.

1) what is the lens.dof_far max value? (the value for infinity?)

2) i'm playing with focus stacking. Moving the focus point, sometime it say "Focus: soft limit reached" (i'm at the max/min focus point of the lens?)....there is a way to prevent or stop the script just before or when it happen?

garry23

@jackyes

In my lua scripts I define infinity as:


infinity = 655000


BTW you can access my scripts at: http://photography.grayheron.net/

These should give you some ideas.

Also look through the scrip area of the ML forum.

Cheers

Garry

jackyes

Thank you garry23,

is this https://davidmilligan.github.io/ml-lua/ the only official source of info for lua script  :o ?

a1ex

Main page -> Documentation -> Lua API
Main page -> Downloads -> Nightly builds -> Lua API

Suggestion for a better place for this link?

garry23

@A1ex

I think the Lua API link is accessible and visible, ie under the experimental tab.

I think the 'issue' is always going to be with us, ie you don't know what you don't know  ;)

Once you know where the Lua API link is, all is well with the world  :)

We also have the 'Scripting Corner' link.

Having been through the 'Lua development' (and I'm still learning), I think knowing you can ask questions, eg in the Scriptng Corner, to help in your personal development, is really of value.

From my perspective, having you, Daniel and David etc nudge me in the right direction, really helped me as I wrote my scripts.

Bottom line: I still believe the Lua environment is one of the ML 'star tools', and it still has more to offer as things get 'unlocked', eg refined focus position control etc.


jackyes

@A1ex
It is in the right place.
Sorry i have found that (old?) page searching "ML LUA API" on google =)

@garry23
Quote from: garry23 on March 27, 2017, 01:06:09 PM
Bottom line: I still believe the Lua environment is one of the ML 'star tools', and it still has more to offer as things get 'unlocked', eg refined focus position control etc.

I agree! it is a fantastic feature!

jackyes

i'm making some test with lua...i have write this miniscript to take 3 braketed shoot. i have used shoot(false) because i don't want to refocus each time.
The script in photo mode works great but in liveview refocus each time and take only 2 shoot.. i'm confused   :-\ ...


EDIT: solved using shoot(64, false)

keymenu = menu.new
{
    name   = "Take Bracket!",
    help   = "Bracket script.(Tv)",
    select = function(this) task.create(main) end,
}

function main()
    local shutterok = camera.shutter.value
    console.show()
    console.clear()
    print("First shot")
    msleep(750)
    shoot(false)
    msleep(750)
    camera.shutter.value = shutterok * 4
    console.clear()
    print("Second shot at 2EV ")
    msleep(750)
    shoot(false)
    msleep(750)
    camera.shutter.value = shutterok / 4
    console.clear()
    print("Third shot at -2EV ")
    msleep(750)
    shoot(false)
    camera.shutter.value = shutterok
    console.hide()
end

garry23

@jackyes

As Lua develops things get changed, and the shoot is one such change.

I would suggest you try using the latest nightly or the experimental Lua and check the API documentation on the download page.

If your script is working with shoot(64, false), then you are using an older ML build.