[DONE - camera.shoot updated] FRSP from with Lua

Started by garry23, May 03, 2016, 08:20:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

Has anyone worked out how to take a full res silent picture from within a Lua script?

I've looked at David's Lua documentation and at various posts, and I've tried various ways myself...but no luck.

Cheers

Garry

dmilligan

If you call shoot() with FRSP enabled and in LV, does it work?

garry23

David

No. If I enable FRSP and call Shoot(), it simply takes a normal .CR2 image with shutter action. Not even a duplicate DNG.

Cheers

Garry

garry23

David

I thought I was being 'clever' here: but this test script doesn't appear to work, ie FRSP not trigger  :'(

I have tried various times between the press() calls.

menu.new
{
  name = "Run",
  select = function() task.create(run_test) end,
  depends_on = DEPENDS_ON.M_MODE,
}

run_test = function()
lv.start()
msleep(2000)
key.press(KEY.HALFSHUTTER)
msleep(1000)
key.press(KEY.UNPRESS_HALFSHUTTER)
end

dmilligan

We need to expose take_a_pic() in shoot.c in the Lua API (not sure what to call it). I was thinking that's what Lua's shoot() called, but it actually calls lens_take_picture(). It would probably also be good to expose bulb_take_pic().

garry23

David

Based on what you say, may I assume that either you or A1ex will look into this the next time you do an update in the nightlies.

BTW why doesn't my key.press experiment work, as, to me, all I'm doing is sending the key presses I would do if I was manually trig going FRSP.

Cheers

Garry

a1ex

The keypress not working is also a a bug, because half-shutter events have to be sent with a different method: SW1 (unlike most other button codes).

garry23

A1ex

Thanks for the insight: I always worry about my incompetence  :-[

BTW once again thanks for getting the Lua scripting environment working.

I'm really happy with my focus+exposure bracketing script: although I know I could code it better if I looked at it more closely.

Last night I tested it in our local church and it worked faultlessly every time. I was using a 12-24mm Sigma, at 12mm, on my 5D3. I simply compose, moved the focus ring all the way to the macro end, set the exposure for the shadows and ran the script.

I'm a happy man  :)

a1ex

Quote from: dmilligan on May 04, 2016, 04:17:01 AM
We need to expose take_a_pic() in shoot.c in the Lua API (not sure what to call it). I was thinking that's what Lua's shoot() called, but it actually calls lens_take_picture().

I think it's best to have shoot() call take_a_pic() - even if the syntax changes slightly, it's easy to adjust the scripts. The first parameter (a timeout) doesn't make much sense to be exposed to scripts anyway, and the second one (should_af) is quite useful.

QuoteIt would probably also be good to expose bulb_take_pic().

This one appears to be already exposed - camera.bulb(duration_seconds).

dmilligan


garry23

@A1ex

I just tried camera.bulb (test script below) and no matter what, it only takes an image at 0.4s, ie instead of 50s.

Is it my scripting or a bug?

Cheers

Garry


menu.new
{
  name = "Run",
  select = function() task.create(run_test) end,
  depends_on = DEPENDS_ON.M_MODE,
}

run_test = function()
menu.close()
lv.start()
msleep(1000)
camera.bulb(50)
end

a1ex


garry23