Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - garry23

#1676
Tutorials and Creative Uses / Re: EOS-M wired remote
March 07, 2016, 12:42:02 AM
I guess the difference is that the video implies you need the TriggerTrap hardware, which my experiments confirmed you don't. Just a cheap audio jack to audio jack cable that goes to, say, your iPhone and to the EOS-M.

The TriggerTrap software is a free download :)
#1677
Tutorials and Creative Uses / EOS-M wired remote
March 06, 2016, 01:26:55 PM
My apologies if this has been mentioned before, however, I had a 'brainwave' and thought I would share it with ML colleagues.

The EOS-M doesn't have a wired remote, but it does have an audio/mic socket.

So all you need to do is use an audio-2-audio cable to connect the EOS-M to, say, your iPhone; and switch on the Audio Remote in ML.

Then simply use the free TriggerTrap App to fire your EOS-M.

Although the audio remote option works via the EOS-M mics, it will trigger off noise. With the wire and TriggerTrap, you have full control.

Job done :)


#1678
Many are drawn to the EOS-M because of the ML-enhanced videography: I am not one of those :)

As a photographer I was attracted to the EOS-M, because I missed ML when I brought my first mirrorless, an A6000, and, after years with ML on my 5D3 and IR-converted 50D, I simply wanted ML on a mirrorless. So last week I grabbed a used EOS-M and M-2-EF adapter on ebay.

The EOS-M, with it's 18-55mm kit lens is a great package. My first 'add-on' was an Neweer grip, which greatly helps with handling the EOS-M.

The real 'downside' of the EOS-M, however, is the lack of buttons. Like many photographers, we get used to our buttons and we know their position instinctively. Our workflow is button-base, eg back-button focus and ML-ETTR via the SET button etc.

In addition to lacking the buttons, the EOS-M, because of its touch screen UI, brings in other 'complication', eg the touch screen and various 'missing' ML features. For example, the ML EOS-M version doesn't allow one to ETTR from the SET button. Also, you can not have ML ETTR (double half shutter) and ML Advanced bracketing on at the same time, so you are forced to keep going into the ML menu to change ML features: which on the EOS-M can be fiddly.

Because of the above, I have written a Lua 'helper script', specifically aimed at the EOS-M landscape photographer, that I hope some EOS-M users may get value out of, and use as a basis for your own 'personalisation', eg the 'ML feature toggler idea'.

The usual caveats apply, eg: it works for me; you use it at you own risk etc etc.

In addition, I have only tested it with all the Lua demo scripts removed, and you are advised to do this. That is, I haven't tested script-2-script (in)compatibility.

Once you put the script in the ML script folder, the script will start up automatically on camera start up. NOTE: once running you will lose the Main Dial's top toggle functionality. To get this back to normal, switch off the script under the ML Shoot Menu.

NOTE also that the EOS-M (nothing to do with my script) suffers from a 'feature' that means the shutter can fail to work sometimes. If you get this, simply switch the camera off and on quickly.

The script provides two coloured feedback areas that appear in the top ML bar on the right. When you first switch your camera on you will see one of these, a blue rectangle with "off" showing, which tells you the script is running, but that none of the script functionality is in use.

To use the script simply use the Main Dial top-toggle. Each time you toggle the top of the Main Dial the blue rectangle will show you are accessing a different ML extended functionality, eg ML ETTR or ML bracketing. In addition, for my workflow, I have added in a dark-image feature (yes I know I could put my hand in front of the camera).

As soon as you take your first image, the second area of the script feedback comes into being. This is the area that gives you visual info for focus stacking in landscape mode. As with the bracketing and ETTR functionality, make sure you have all the ML settings to you liking, eg I use these setting: all SNR ETTRs setting to zero, DoF diffraction aware on and Advanced bracketing to Auto etc etc (you decide what you want).

As an example workflow, consider a focus (lens must report focus) bracket capture session:

1.Ensure all ML background settings are correct, eg ETTR, DoF, Bracketing.
2.Press the Main Dial top toggle until you see "ETTR" in the Blue Box.
3.Do a double half shutter press to get a starting ETTR exposure and adjust as you see fit, eg using the ML Histo Bar (which I always have in ETTR Hint mode.
4.Fine compose (and ETTR again if required) and focus on the closest thing that you need for your capture, eg using the EOS-M touch focus functionality.
5.Toggle through the top of the Main Dial until you see "-BE" (for dark BookEnd) and grab an image.
6.Toggle to "+BE" to return to the correct exposure and grab your first image. This will show a yellow box to the left of the blue box, telling you that your next image needs to be taken more towards the infinity end.
7.Focus the lens towards the infinity end until you see either a green or red box. Green means take a picture, red means back off to 'just' yellow, ie you may not always get a green. The green 'tolerance' can be adjusted in the script's menu and provides an indication of positive overlap, ie the default is 20%.
8.Take another image and repeat 7 until you see INF in the left hand box, which means that DoF Far is at infinity, Consider taking an insurance shot beyond this, eg focus at infinity.
9.Toggle to "-BE" and take another bookend image. You now have a focus bracket set with two dark frames as bookends to help you identify these in post processing.

If you wanted to also take a set of exposure brackets at each focus point, you simple toggle over until you see "Auto" and press the shutter to grab an ML auto bracket set (or a numbered bracket set if you set that option). Note you should consider toggling to the "-BE" to insert a dark frame between the exposure brackets. I also put two dark frames at the beginning and end of a focus/exposure set, to differentiate this complex set in post.

As I say, I wrote this script for my workflow, and the EOS-M ML-enhanced mirrorless camera for landscape photography. The EOS-M, with a few batteries, the lens adapter and a small tripod, represents the lowest weight I can imagine in the field.

Finally, here is the script (modified 7th March 2016):

--[[
Manual Landscape bracketing helper script
Version 0.1.0 for EOS-M
Garry George March 2016
http://photography.grayheron.net/
Workflow helper script for focus and exposure bracketing for the EOS-M
Toggle through the workflow using the top of the main dial.
Yellow means move more towards the infinity end, Red means move more towards macro end,
Green means at the sweet spot. If Green not seen, move to just being in the Yellow from being in the Red.
--]]
factor = 0.2
b1 = lens.dof_far
fp = lens.focal_distance
c1 = b1 - (b1 - fp*10)*factor
inf = 1000000
started = false
current_tv = 0
play = 0

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
started = false
return true
elseif key == 12
then
play = play + 1
if play == 5 then play = 0 end
return false
elseif key == KEY.FULLSHUTTER
then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end

lv.info
{
    name = "Info 1",
    value = "",
    priority = 100,
    update = function(this)
    this.value = ""
    if keymenu.submenu["Turn On/Off"].value == "On" and started and fp ~= 0
    then
this.foreground = COLOR.BLACK
a2 = lens.dof_near
if a2 > b1 then
this.background = COLOR.RED
elseif a2 < c1 then
this.background = COLOR.YELLOW
else
this.background = COLOR.GREEN1
end
if lens.dof_far >= inf then
this.value = "INF"
else
this.value = "   "
end
else
this.value = ""
end
end
}

lv.info
{
    name = "Info 2",
    priority = 100,
    value = "",
    update = function(this)
    if keymenu.submenu["Turn On/Off"].value == "On" then
    i = menu.set("Shoot","Advanced Bracket",0)
i = menu.set("Expo","Auto ETTR",0)
this.foreground = COLOR.YELLOW
this.background = COLOR.BLUE
if keymenu.submenu["Turn On/Off"].value == "On" then
if play == 0 then
current_tv = camera.shutter.ms
this.value = " Off"
elseif play == 1 then
this.value = "-BE "
camera.shutter.ms = 1
i = menu.set("Shoot","Advanced Bracket",0)
elseif play == 2 then
this.value = "BE+ "
camera.shutter.ms = current_tv
elseif play == 3 then
this.value = "ETTR"
i = menu.set("Expo","Auto ETTR",1)
i = menu.set("Auto ETTR","Trigger mode",3)
elseif play == 4 then
this.value = "Auto"
i = menu.set("Shoot","Advanced Bracket",1)
else
this.value = ""
end
end
end
end
}

keymenu = menu.new
{
parent = "Shoot",
name = "Landscape Helper",
help = "Toggle through workflow using top of main dial",
help2 = "Grab exposure or take picture as required",
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Simply enables additional button functionality",
choices = {"On","Off"},
},
{
name = "Bracket to bracket overlap",
help = "Amount to overlap each bracket",
help2 = "% of FP-2-DoF(far) distance",
choices = {"20","10", "5"},
update = function(this)
factor = tonumber(keymenu.submenu["Bracket to bracket overlap"].value)/100
end,
}
}
}


#1679
Scripting Q&A / Re: Lua Key Press question
March 05, 2016, 08:11:33 AM
Of course: how stupid of me.

The Lua key.press will call the event handler, that's running!!!

I was trying to see if I could use Lua to reprogram functionality to the PLAY key.

My thought was to reprogam PLAY to operate like the ETTR SET, which, unfortunately is not in the ML EOS-M version.

Once again, thanks for the (obvious  :-[) pointer.
#1680
Scripting Q&A / Re: Lua Key Press question
March 04, 2016, 10:49:26 PM
David

Sorry, still getting confused.

Why does this create errors?

event.keypress = function(key)
if key == KEY.PLAY then
key.press(KEY.PLAY)
return false
else
return true
end
end
#1681
Scripting Q&A / Lua Key Press question
March 04, 2016, 09:11:53 PM
David  :)

I have this simple test script: but it doesn't respond as I would expect:

event.keypress = function(key)
if key == KEY.PLAY then
display.notify_box (key,3000)
return false
else
return true
end
end


I would expect the notify to display only if PLAY is pressed, ie value 24; and play is not enacted by Canon, ie return false.

What seems to happen is notify is called every time a key is pressed.

Any hints what I'm missing?
#1682
@chadxo

Have you looked at Lua scripting?

Take a look at: http://davidmilligan.github.io/ml-lua/
#1683
A1ex

Because on my 5D3 I use the SET for ETTR, which I sadly can't do on the EOS-M, I had never noticed this before.

However, I have just confirmed the same issue exists on the 5D3, ie ETTR doesn't work if you have ML bracketing on AND use the double half press.

Bottom line: it appears the double half press is the thing that is killing ETTR.

Cheers

Garry
#1684
Alex

If I simply have ETTR enabled, and no bracketing enabled, ie it is off, ETTR works as expected.

If I then turn on bracketing (auto or a selected number of brackets), ETTR stops working.

If I turn off bracketing, ETTR works again.

Cheers

Garry
#1685
General Help Q&A / EOS-M + ETTR + Auto Bracketing
March 04, 2016, 01:59:46 PM
On my 5D3 I often combine an ETTR & Bracketing workflow, eg ETTR first then ML bracket 'down' from the hightlight ETTR exposure.

When I try this on the EOS-M, you can't ETTR (I use double half) AND have bracketing on.

ETTR works if I switch bracketing off, and stops working when I switch bracketing on.

I am using the latest nightly.

Is it me? Or a 'feature' of the EOS-M?
#1686
Scripting Q&A / Re: Help with Lua event.post_shoot
February 27, 2016, 03:23:27 PM
David

Thanks  :)

I thought I was going mad :'(

As I get more understanding of Lua, I'm obviously pushing myself into areas where ML-Lua is not fully fit yet.

Thanks for your prompt feedback as usual - especially at the weekend as I sit down to watch the Six Nations  ;)

BTW have you any idea when the lens movement release will be pushed out. My next iteration is to write the bracketing script to run automatically, ie one button push.

Cheers

Garry
#1687
Scripting Q&A / Re: Lua Help!!!!
February 27, 2016, 02:51:01 PM
David

Sorry!!!!!!!!!!!

Of course, it just dawned on me, that the script is loaded at camera start up BEFORE LV gets enabled.

I understand the zero now  :) :) :) :) :)

Cheers

Garry
#1688
Scripting Q&A / Re: Lua Help!!!!
February 27, 2016, 02:10:30 PM
David

I am in LV  :)

Also all the lens.dof_x calls reports OK when I call them again inside my code.

It seems to just be zero at the beginning, ie when set as a global, ie a1 = lens.dof_near

Strange.
#1689
Scripting Q&A / Lua: Global vs Local confusion
February 27, 2016, 01:26:48 PM
David (I hope you find time to read this  ;) )

I'm seeing some strangeness with, what I believe are global variables.

This is part of my script, that I think sets up a few global variables and set up an event handler.

--[[
Manual Landscape bracketing helper script
Version 0.3.5
Garry George Feb 2016
http://photography.grayheron.net/
Workflow helper script for focus and exposure bracketing.
Try using ML follow focus to control the lens, as opposed to rotating lens by hand.
Yellow means move more towards the infinity end, Red means move more towards macro end,
Green means at the sweet spot. If Green not seen, move to just being in the Yellow from being in the Red.
************************
* Must be in liveview! *
************************
--]]

b1 = lens.dof_far
a1 = lens.dof_near
fp = lens.focal_distance
factor = .2
c1 = b1 - (b1 - fp*10)*factor
a2 = lens.dof_near
inf = 1000000
started = false
bookended = true
current_tv = camera.shutter.apex


event.keypress = function(key)
if key == KEY.RATE and keymenu.submenu["Turn On/Off"].value == "On" then
started = true
if started then display.notify_box (a1.."+"..b1.."+"..a2.."+"..factor) end
if keymenu.submenu["Bookends"].value == "yes"
then
if bookended then
current_tv = camera.shutter.apex
camera.shutter.apex = 100
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",0) end
bookended = false
else
camera.shutter.apex = current_tv
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",1) end
bookended = true
end
return false
else
return true
end
else
return true
end
end


variable factor (that is set in a menu) changes and I see that when I print the notify_box,

Variables a1, 2 and b1 all are zero, but I set them to non-zero when the script runs, eg a1 = lens.dof_near

What am I missing?

Cheers

Garry
#1690
Scripting Q&A / Help with Lua event.post_shoot
February 27, 2016, 08:25:23 AM
Has anyone used the Lua post_shoot event handler?

I've tried both post and pre and can't seem to get them to pick up on an image capture. My fear is I'm using them wrong, but I don't trigger a runtime error.

Here's the relevant code:


event.post_shoot = function(arg)
if keymenu.submenu["Turn On/Off"].value == "On" then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end


The above code runs OK inside an event.keypress handler.
#1691
Scripting Q&A / Re: Lua: Lens to Lens variation
February 25, 2016, 10:46:18 PM
David

Further testing and I think I have a hypothesis regarding why I sometimes see semaphore errors with a Sigma lens, but not my 24-105 F4/L lens.

The theory goes like this: the current script change shutter and aperture, and I get errors...sometimes.

If I only change shutter, like this, I don't get semaphore errors, even with the Sigma.

if key == KEY.RATE then
if keymenu.submenu["Bookends"].value == "yes"
then
if bookended then
current_tv = camera.shutter.apex
camera.shutter.apex = 100
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",0) end
bookended = false
else
camera.shutter.apex = current_tv
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",1) end
bookended = true
end
return false
else
return true
end
end


My theory is that the Sigma lens aperture change is taking longer than the Canon, and thus the process is taking too long inside the event.keypress function.

Bottom line: my script's functionality still works with only the shutter toggle, so I'm going with that.

Just thought I would report my theory, based on my experiments.
#1692
Scripting Corner / Re: Lua Scripting (lua.mo)
February 25, 2016, 08:24:41 AM
Walter

I can confirm that the scripts run on start-up.

For example, my script to provide a focus and exposure bracketing helper is by default switched off in the menu, but by changing the default to "On" in the script, it will be running, ready for use when the camera is switch on.

Cheers

Garry
#1693
Scripting Corner / Re: Lua Scripting (lua.mo)
February 25, 2016, 07:30:03 AM
David

BTW I see the nightlies were updated the other day, but I couldn't see any Lua tweaks.

Do you know when your Lua fixes will be incorporated ?

I'm particularly keen to see the lens move function working in both directions ;-)

Cheers

Garry
#1694
Scripting Q&A / Re: Lua: Lens to Lens variation
February 23, 2016, 11:21:15 PM
David

Thanks!!!!  :)

I know you must think me stupid and a pain in the $@#%

I took your advice and stripped the event.keypress handler down to a minimum, ie trying to speed it up. And of course removed those task.yield calls.

The script appears stable now and seems to work with both the Canon and Sigma lenses.

For completeness here it is. BTW I still am a little confused regarding the update call. Have I used the 'correct' format for the bracket-to-bracket menu, ie setting the global variable called 'factor'

Once again: thanks - I'm so pleased to have got this, my first script, running -- thanks to you and your support.

Cheers

Garry

--[[
Manual Landscape bracketing helper script
Version 0.3.5
Garry George Feb 2016
http://photography.grayheron.net/
Workflow helper script for focus and exposure bracketing.
Try using ML follow focus to control the lens, as opposed to rotating lens by hand.
Yellow means move more towards the infinity end, Red means move more towards macro end,
Green means at the sweet spot. If Green not seen, move to just being in the Yellow from being in the Red.
************************
* Must be in liveview! *
************************
--]]
a1 = lens.dof_near
b1 = lens.dof_far
c1 = 0
fp = lens.focal_distance
inf = 1000000
started = false
bookended = true
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
factor = .2

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
started = false
return true
else
if key == KEY.RATE then
if keymenu.submenu["Bookends"].value == "yes"
then
if bookended then
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
camera.aperture.apex = 90
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",0) end
bookended = false
else
camera.aperture.apex = current_av
camera.shutter.apex = current_tv
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",1) end
bookended = true
end
return false
else
return true
end
end
if fp ~= 0 then
if key == KEY.FULLSHUTTER
then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end
end
end

lv.info
{
    name = "Landscape Stacker Info",
    value = "",
    priority = 100,
    update = function(this)
    this.value = ""
if fp == 0 then
this.value = ""
else
    if keymenu.submenu["Turn On/Off"].value == "On"
    then
    if started then
a2 = lens.dof_near
this.value = ""
if a2 > b1 then
this.background = COLOR.RED
elseif a2 < c1 then
this.background = COLOR.YELLOW
this.foreground = COLOR.BLACK
else
this.background = COLOR.GREEN1
end
if lens.dof_far >= inf then
this.value = "Inf"
else
this.value = "   "
end
end
else
this.value = ""
end
end
end
}

keymenu = menu.new
{
parent = "Audio",
name = "Landscape Stacking Helper",
help = "First focus at nearest point in bracket set",
help2 = "and take first picture",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Simply enables addition button functionality",
depends_on = DEPENDS_ON.LIVEVIEW,
choices = {"Off","On"},
},
{
name = "Bracket to bracket overlap",
help = "Amount to overlap each bracket",
help2 = "% of FP-2-DoF(far) distance",
choices = {"20","10", "5"},
update = function(this)
factor = tonumber(keymenu.submenu["Bracket to bracket overlap"].value)/100
end,
},
{
name = "Bookends",
help = "Toggles a dark frame",
choices = {"no","yes"},
},
{
name = "Exposure bracketing",
help = "Set options in the ML bracketing menu",
choices = {"None","From here", "From ETTR"},
update = function(this)
if keymenu.submenu["Exposure bracketing"].value == "None" then
i = menu.set("Shoot","Advanced Bracket",0)
else
i = menu.set("Shoot","Advanced Bracket",1)
if keymenu.submenu["Exposure bracketing"].value == "From ETTR" then i = menu.set("Advanced Bracket","Sequence",2) end
if keymenu.submenu["Exposure bracketing"].value == "From here" then i = menu.set("Advanced Bracket","Sequence",1) end
end
end
}
}
}
#1695
Scripting Q&A / Lua: Lens to Lens variation
February 23, 2016, 07:55:42 AM
I thought some may be interested in the results of some Lua script-based testing I have been doing with 5D3, a Canon 24-105 F/4L and a Sigma 12-24 F4.5-5.6 II DG.

Both lenses behave well with ML, eg reporting position and DoF etc.

Using this script with both gives different results:

--[[
Manual Landscape bracketing helper script
Version 0.3.4
Garry George Feb 2016
http://photography.grayheron.net/
Workflow helper script for focus and exposure bracketing.
Try using ML follow focus to control the lens, as opposed to rotating lens by hand.
Yellow means move more towards the infinity end, Red means move more towards macro end,
Green means at the sweet spot. If Green not seen, move to just being in the Yellow from being in the Red.
************************
* Must be in liveview! *
************************
--]]
a1 = lens.dof_near
b1 = lens.dof_far
c1 = 0
fp = lens.focal_distance
inf = 1000000
started = false
bookended = true
current_tv = camera.shutter.apex
current_av = camera.aperture.apex

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
return true
else
if key == KEY.RATE then
if keymenu.submenu["Bookends"].value == "yes"
then
if bookended then
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
camera.aperture.apex = 90
task.yield(100)
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",0) end
bookended = false
else
camera.aperture.apex = current_av
camera.shutter.apex = current_tv
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",1) end
task.yield(100)
bookended = true
end
return false
else
return true
end
end
if keymenu.submenu["Turn On/Off"].value == "Off" then started = false end
if fp ~= 0 then
if key == KEY.FULLSHUTTER
then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
if keymenu.submenu["Bracket to bracket overlap"].value == "20%" then
factor = .2
elseif keymenu.submenu["Bracket to bracket overlap"].value == "10%" then
factor = .1
else
factor = .05
end
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end
end
end

lv.info
{
    name = "Landscape Stacker Info",
    value = "",
    priority = 100,
    update = function(this)
    this.value = ""
if fp == 0 then
this.value = ""
else
    if keymenu.submenu["Turn On/Off"].value == "On"
    then
    if started then
a2 = lens.dof_near
this.value = ""
if a2 > b1 then
this.background = COLOR.RED
elseif a2 < c1 then
this.background = COLOR.YELLOW
this.foreground = COLOR.BLACK
else
this.background = COLOR.GREEN1
end
if lens.dof_far >= inf then
this.value = "Inf"
else
this.value = "   "
end
end
else
this.value = ""
end
end
end
}

keymenu = menu.new
{
parent = "Audio",
name = "Landscape Stacking Helper",
help = "First focus at nearest point in bracket set",
help2 = "and take first picture",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Simply enables addition button functionality",
depends_on = DEPENDS_ON.LIVEVIEW,
choices = {"Off","On"},
},
{
name = "Bracket to bracket overlap",
help = "Amount to overlap each bracket",
help2 = "% of FP-2-DoF(far) distance",
choices = {"20%","10%", "5%"},
},
{
name = "Bookends",
help = "Toggles a dark frame",
choices = {"no","yes"},
},
{
name = "Exposure bracketing",
help = "Set options in the ML bracketing menu",
choices = {"None","From here", "From ETTR"},
update = function(this)
if keymenu.submenu["Exposure bracketing"].value == "None" then
i = menu.set("Shoot","Advanced Bracket",0)
else
i = menu.set("Shoot","Advanced Bracket",1)
if keymenu.submenu["Exposure bracketing"].value == "From ETTR" then i = menu.set("Advanced Bracket","Sequence",2) end
if keymenu.submenu["Exposure bracketing"].value == "From here" then i = menu.set("Advanced Bracket","Sequence",1) end
end
end
}
}
}


The Canon lens 'only' generates random (ie non predictable) Semaphore errors (which is down to my script and my ignorance at how to handle the complexities of semaphore handling).

When I attach the Sigma, this block of code, round line 40, does strange things:


camera.aperture.apex = current_av
camera.shutter.apex = current_tv


The shutter always changes to the previously stored current value, but the aperture doesn't.

As I say, both Tv and Av values change with a Canon lens.

BTW the Sigma also generates the 'random' semaphore errors.

As I say, just some feedback from the field  ;)

#1696
Scripting Q&A / Re: Lua Help!!!!
February 21, 2016, 06:10:01 PM
David

A Sunday, so more Lua testing/experimenting  :)

Your insight into semaphores has helped me appreciate the issues, but not how to resolve the problems.

Of course, maybe there are no work arounds to the like of script I have created, eg this one:

--[[
Manual Landscape bracketing helper script
Version 0.3.4
Garry George Feb 2016
http://photography.grayheron.net/
Workflow helper script for focus and exposure bracketing.
Try using ML follow focus to control the lens, as opposed to rotating lens by hand.
Yellow means move more towards the infinity end, Red means move more towards macro end,
Green means at the sweet spot. If Green not seen, move to just being in the Yellow from being in the Red.
************************
* Must be in liveview! *
************************
--]]
a1 = lens.dof_near
b1 = lens.dof_far
c1 = 0
fp = lens.focal_distance
inf = 1000000
started = false
bookend = true
current_tv = camera.shutter.apex
current_av = camera.aperture.apex

function do_bookend()
task.create(function()
if bookend then
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
task.yield(50)
camera.aperture.apex = 90
task.yield(50)
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",0) end
bookend = false
else
camera.aperture.apex = current_av
task.yield(50)
camera.shutter.apex = current_tv
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",1) end
task.yield(50)
bookend = true
end
end)
end

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
return true
else
if key == KEY.RATE then
if keymenu.submenu["Bookends"].value == "yes"
then
do_bookend()
return false
else
return true
end
end
if keymenu.submenu["Turn On/Off"].value == "Off" then started = false end
if fp ~= 0 then
if key == KEY.FULLSHUTTER
then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
if keymenu.submenu["Bracket to bracket overlap"].value == "20%" then
factor = .2
elseif keymenu.submenu["Bracket to bracket overlap"].value == "10%" then
factor = .1
else
factor = .05
end
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end
end
end

lv.info
{
    name = "Landscape Stacker Info",
    value = "",
    priority = 100,
    update = function(this)
    this.value = ""
if fp == 0 then
this.value = ""
else
    if keymenu.submenu["Turn On/Off"].value == "On"
    then
    if started then
a2 = lens.dof_near
this.value = ""
if a2 > b1 then
this.background = COLOR.RED
elseif a2 < c1 then
this.background = COLOR.YELLOW
this.foreground = COLOR.BLACK
else
this.background = COLOR.GREEN1
end
if lens.dof_far >= inf then
this.value = "Inf"
else
this.value = "   "
end
end
else
this.value = ""
end
end
end
}

keymenu = menu.new
{
parent = "Audio",
name = "Landscape Stacking Helper",
help = "First focus at nearest point in bracket set",
help2 = "and take first picture",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Simply enables addition button functionality",
depends_on = DEPENDS_ON.LIVEVIEW,
choices = {"Off","On"},
},
{
name = "Bracket to bracket overlap",
help = "Amount to overlap each bracket",
help2 = "% of FP-2-DoF(far) distance",
choices = {"20%","10%", "5%"},
},
{
name = "Bookends",
help = "Toggles a dark frame",
choices = {"no","yes"},
},
{
name = "Exposure bracketing",
help = "Set options in the ML bracketing menu",
choices = {"None","From here", "From ETTR"},
update = function(this)
if keymenu.submenu["Exposure bracketing"].value == "None" then
i = menu.set("Shoot","Advanced Bracket",0)
else
i = menu.set("Shoot","Advanced Bracket",1)
if keymenu.submenu["Exposure bracketing"].value == "From ETTR" then i = menu.set("Advanced Bracket","Sequence",2) end
if keymenu.submenu["Exposure bracketing"].value == "From here" then i = menu.set("Advanced Bracket","Sequence",1) end
end
end
}
}
}


It seems to me, and rather simplistically, it would be 'nice' if, when a script is running, it could take control or suspend 'semaphore' handling etc.

As I say, I'm most probably ignorant and I have to accept I can't do what I want. BTW the above code words fine sometimes, then every now an then it open the console and gives those damn semaphore errors  :(
#1697
Scripting Q&A / Re: Lua Help!!!!
February 21, 2016, 12:17:22 AM
 :)
#1698
John

I also came to that conclusion and that is the reason I use SET.

I find half-shutter too 'finicky' as you say  :)

Cheers

Garry
#1699
Scripting Q&A / Re: Lua Help!!!!
February 20, 2016, 07:16:18 PM
David (hope you are scanning  :))

In a previous post http://www.magiclantern.fm/forum/index.php?topic=16614.msg162054#msg162054 you indicated that to 'steal' a keypress from the Lua event you should "...return true from the handler, it blocks all those other things from receiving the keypress. In the example above we always return false, so we're not "stealing" any keypress, we are just intercepting them and printing out the key, before they continue on their way and get processed by other things."

However, having spent hours testing various scripts the following will steal a key press. To not steal a key press, ie do my stuff and let the 'backend' carry on using the key press I would return true.

event.keypress = function(key)
    -- do my stuff
    return false
end


Bottom line: if I wish to 'steal' a keypress inside the event.keypress handler I would return false, if I wanted the key to be used 'as normal', ie not steal it, I would return true, ie letting ML access/use the keypress.

Or am I off base?
#1700
UPDATED

If you have been following my previous posts, you will know I've been trying to write a Lua script to help with both focus and exposure bracketing. My goal remains to write an automatic script for this, ie one button push: but until the Lua and ML coding gets 'fixed', I've decided to settle on a manual-based 'helper script'.

At first, I thought I could achieve more than I have, but even the might of the ML gurus (David Milligan et al) could 'educate' me enough to sort out the 'complexities' of semaphore errors :-)

I thus offer the following as a user-driven, 'workflow helper script'. It is aimed at those that are interested in landscape (sic) focus AND exposure bracketing, ie together.

The script assumes your lens reports position and depth of field and is in Live View. You, obviously, must have the Lua module loaded.

In addition, the user needs to ensure that ML ETTR is switch on (I prefer to trigger from the SET button) and that ML exposure settings preference is set, eg 3 x 2Ev. The script provides the option to switch bracketing from current exposure, ie symmetrically about the current exposure, or, following an ETTR SET exposure, from the ETTR. The script switches to the correct sequence, according to if ETTR is used or not.

In addition the script provides a convenient way to take a 'bookend' exposure, ie a dark frame, which is toggled on and off via the RATE button (the user can change the button in the script). This also handles exposure bracketing to allow a single frame capture, even if you are doing exposure bracketing (see below).

The workflow that I use with this script goes like this:

Setup Phase
1.Ensure ML-ETTR enabled (I personally use the SET button);
2.Ensure the number of frames (Auto or a number) and Ev delta is set in the ML-Bracketing menu. Note bracketing doesn't need to be switched on at this stage;
3.Go the the Landscape Stacking Helper (by default positioned in the Audio ML Menu, but this can be changed in the script);
4.Select the Exposure bracketing strategy you need, ie 'None', symmetrically 'From here' or 'From ETTR' exposure;
5.Select the bracket to bracket focus overlap. This is an addition helper feature that attempts to show you are x% overlapping, but note, according to the lens it doesn't always show/work;
6.Select if you wish to use image 'bookends', which will allow you to quickly take a dark frame or two dark frames to help differentiate between various bracket sets;
7.Finally, in the script menu, turn on the script and do a half shutter press to get rid of the menu or go to LV to remove the script's menu;

Use Case 1 - Simple Focus Bracketing (without bookends)
1.Switch on Live View, compose, set exposure and focus on the nearest point in your focus stack;
2.Press shutter (eg with your choice of delay etc in the normal Canon menu, or use a remote) and grab the first image;
3.In the top right of the ML top bar you will see a yellow rectangle, indicating the next bracket needs to be moved towards infinity;
4.Rotate the lens (or use ML Follow Focus) to move the lens towards infinity until the yellow box turns Green or Red;
5.If it turns Green this indicates you are in the % overlap region. If it turns red this means you have negative overlap, ie a focus gap, and you should move the lens towards the macro end until it goes green or just yellow. According to the lens, focus point or aperture settings, you may not see green;
6.Press the shutter and grab the next image;
7.Repeat the above until Inf (infinity) is seen in the coloured box (consider taking an insurance image beyond this point if you wish, ie focus point actually at or near infinity;
8.To start another bracket set, simply move the lens to the closest object and take the first image to reset the helper and repeat as above.

Use Case 2 - Simple Focus Bracketing (with bookends)
1.The 'problem' with the above (simple) workflow is that if subsequent bracket sets are similar, ie no change in composition, you may have problems in post differentiating the bracket sets (unless you remember how many images in each set. For this reason I have included a simple 'bookend' tool;
2.To use the bookend tool, ensure it is switched on, in the helper menu;
3.At the start of the focus bracketing, simple press the RATE button (unless you have changed this in the script). The LV image will go black. Press the shutter, to grab this dark 'bookend' image, and then press RATE again, to toggle back to the correct/original exposure;
4.Carry on as in Use Case 2 until the final focus bracket is reached;
5.Press RATE to switch to dark frame mode, grab a final bookend image, and press RATE to reset the exposure. You now have a focus set bookended by dark frames, thus allowing you to easily differentiate this set in post processing.

Use Case 3 - Focus and Exposure Bracketing (with bookends)
6.Ensure bookends are enabled and that the required exposure bracketing strategy has been set up in the ML menu (let's assume we are going to take three brackets from an initial ETTR exposure);
7.Press SET to set the ETTR base exposure;
8.Focus on the closest focus point;
9.Press RATE and take two (sic) dark frames (as we will need to differentiate an exposure bracket set within a focus bracket set. This become especially important if you decide to use Auto bracketing, where the exposure bracket may change between different focus sets. Also note that if using auto bracketing, you will need to give a half-shutter press to clear the auto bracketing screen feedback - I have put in a feature request to 'fix this', ie return the screen after an auto bracketing capture);
10.Press RATE to return to the ETTR base exposure;
11.Press the shutter (or remote) to take the first exposure bracket set at the first focus bracket point;
12.Press RATE, Press the shutter/remote and Press RATE to bookend the first focus set;
13.Move the lens to the next focus point using the colour indicator;
14.Press RATE, Press shutter and Press RATE to bookend the start of the next focus/exposure set;
15.Press the shutter/remote to take the exposure bracket set at the this focus bracket point;
16.Keep doing the above until Infinity reached (consider grabbing an insurance focus/exposure set with the focus point at or near infinity (note the infinity warning is when Depth of Field Far reaches infinity);
17.Finally, press RATE, Press shutter twice (sic) and Press RATE to bookend the entire set. You will now have a set of images on your card with a pattern like this:

Dark
Dark
Focus1/Exposure1
Focus1/Exposure2
Focus1/Exposure3
Dark
Focus2/Exposure1
Focus2/Exposure2
Focus3/Exposure3
Dark
Dark

Finally, the usual caveats: you use the script at your own risk. I have tested it with my 5D3 and a 24-105 F/4L lens; and I welcome feedback regarding making the script better.

--[[
Manual Landscape bracketing helper script
Version 0.3.5
Garry George Feb 2016
http://photography.grayheron.net/
Workflow helper script for focus and exposure bracketing.
Try using ML follow focus to control the lens, as opposed to rotating lens by hand.
Yellow means move more towards the infinity end, Red means move more towards macro end,
Green means at the sweet spot. If Green not seen, move to just being in the Yellow from being in the Red.
************************
* Must be in liveview! *
************************
--]]
a1 = lens.dof_near
b1 = lens.dof_far
c1 = 0
fp = lens.focal_distance
inf = 1000000
started = false
bookended = true
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
factor = .2

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
started = false
return true
else
if key == KEY.RATE then
if keymenu.submenu["Bookends"].value == "yes"
then
if bookended then
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
camera.aperture.apex = 90
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",0) end
bookended = false
else
camera.aperture.apex = current_av
camera.shutter.apex = current_tv
if keymenu.submenu["Exposure bracketing"].value ~= "None" then i = menu.set("Shoot","Advanced Bracket",1) end
bookended = true
end
return false
else
return true
end
end
if fp ~= 0 then
if key == KEY.FULLSHUTTER
then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
end
end
end
end

lv.info
{
    name = "Landscape Stacker Info",
    value = "",
    priority = 100,
    update = function(this)
    this.value = ""
if fp == 0 then
this.value = ""
else
    if keymenu.submenu["Turn On/Off"].value == "On"
    then
    if started then
a2 = lens.dof_near
this.value = ""
if a2 > b1 then
this.background = COLOR.RED
elseif a2 < c1 then
this.background = COLOR.YELLOW
this.foreground = COLOR.BLACK
else
this.background = COLOR.GREEN1
end
if lens.dof_far >= inf then
this.value = "Inf"
else
this.value = "   "
end
end
else
this.value = ""
end
end
end
}

keymenu = menu.new
{
parent = "Audio",
name = "Landscape Stacking Helper",
help = "First focus at nearest point in bracket set",
help2 = "and take first picture",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Simply enables addition button functionality",
depends_on = DEPENDS_ON.LIVEVIEW,
choices = {"Off","On"},
},
{
name = "Bracket to bracket overlap",
help = "Amount to overlap each bracket",
help2 = "% of FP-2-DoF(far) distance",
choices = {"20","10", "5"},
update = function(this)
factor = tonumber(keymenu.submenu["Bracket to bracket overlap"].value)/100
end,
},
{
name = "Bookends",
help = "Toggles a dark frame",
choices = {"no","yes"},
},
{
name = "Exposure bracketing",
help = "Set options in the ML bracketing menu",
choices = {"None","From here", "From ETTR"},
update = function(this)
if keymenu.submenu["Exposure bracketing"].value == "None" then
i = menu.set("Shoot","Advanced Bracket",0)
else
i = menu.set("Shoot","Advanced Bracket",1)
if keymenu.submenu["Exposure bracketing"].value == "From ETTR" then i = menu.set("Advanced Bracket","Sequence",2) end
if keymenu.submenu["Exposure bracketing"].value == "From here" then i = menu.set("Advanced Bracket","Sequence",1) end
end
end
}
}
}