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

Topics - garry23

#251
I've just started making more use of Magic Zoom in photo-mode LV, ie non-video.

I have the latest nightly and 5D3.

It is noticeable that moving the MZ box 'randomly' erases the Canon grid.

Has anyone else noticed this?

Cheers

Garry
#252
Scripting Corner / Toggler: Update
May 31, 2016, 06:45:15 PM
Like many ML photographers users, I need to switch between various ML settings, eg ETTR on/off, Dual-ISO on/off, FRSP on/off, Auto bracketing on/off.

For me the following script works.

All it does is toggle between the various settings that are important for me, ie those above.

The script is simple and easily extendable.

To use all you need to do is switch it on and toggle: in LV. The toggled state shows up in the top-right of the ML LV bar.

I have programmed the RATE button as my 'toggler': but this can be changed to another button, ie one you don't use a lot. In the case of my EOSM it uses the KEY.UP. The script detects the EOSM.

In the case of the FRSP, the toggler will check you are in the FRSP permissible range.

One final thing, make sure your ML settings are set to your needs, ie the Toggler simply switches the ML function on and off. For example: I use SET for ETTR and put SNRs and link to Dual to off; I set Dual-ISO to 100/800; enable Auto bracketing and use DNG capture in FRSP. But you choose what works for you.

As usual I welcome feedback.

Cheers

Garry

--[[
Still photography toggler script
Version 1.1 (should work on all ML enabled cameras with the Lua module)
Garry George May 2016
http://photography.grayheron.net/
Toggler script for ML settings.
Toggle through ML settings using the selected option ie a button you rarely use.
Must be in LV.
--]]

-- Declare some variables
play = 0
toggler = 0

-- Change toggler value to your choice of button, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants
-- Default is KEY.RATE for non-EOSM cameras. EOSM self selects upper toggle on main dial as the EOSM doesn't have many buttons!
if camera.model_short == "EOSM" then toggler = KEY.UP else toggler = KEY.RATE end -- Change RATE to your choice

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
return true -- Toggler does nothing
elseif key == toggler  -- user asking for a 'toggle'
then
play = play + 1
if play == 5 then play = 0 end
return false
end
end

lv.info
{
    name = "Info 1",
    priority = 100,
    value = "",
    update = function(this)
    if keymenu.submenu["Turn On/Off"].value == "On" then
this.foreground = COLOR.YELLOW
this.background = COLOR.BLUE
if play == 0 then
this.value = " Off"
menu.set("Shoot","Advanced Bracket",0)
menu.set("Expo","Auto ETTR",0)
menu.set("Expo","Dual ISO",0)
menu.set("Shoot","Silent Picture",0)
elseif play == 1 then
this.value = "ETTR"
menu.set("Shoot","Advanced Bracket",0)
menu.set("Expo","Auto ETTR",1)
menu.set("Expo","Dual ISO",0)
menu.set("Shoot","Silent Picture",0)
elseif play == 2 then
this.value = "Dual" 
menu.set("Shoot","Advanced Bracket",0)
menu.set("Expo","Auto ETTR",0)
menu.set("Expo","Dual ISO",1)
menu.set("Shoot","Silent Picture",0)
elseif play == 3 then
this.value = "Auto Bracket"
menu.set("Shoot","Advanced Bracket",1)
menu.set("Expo","Auto ETTR",0)
menu.set("Expo","Dual ISO",0)
menu.set("Shoot","Silent Picture",0)
elseif play == 4 then
this.value = "FRSP"
menu.set("Shoot","Advanced Bracket",0)
menu.set("Expo","Auto ETTR",0)
menu.set("Expo","Dual ISO",0)
if camera.shutter.value < 0.2 or camera.shutter.value > 14 then
this.foreground = COLOR.RED
menu.set("Shoot","Silent Picture",0)
else
this.foreground = COLOR.YELLOW
menu.set("Shoot","Silent Picture",1)
end
else
this.value = ""
end
else
this.value = ""
end
end
}

keymenu = menu.new
{
parent = "Shoot",
name = "Toggler",
help = "Toggle through various ML options",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
choices = {"On","Off"},
}
}
}

#253
As some will be aware, I have been putting some effort into writing a bracketing script for (non-macro) focus bracketing.

In this post I offer my latest version for testing and feedback.

I have tried to make the script 'robust' and have built in some error checking (but still read the comments at the start of the script).

The script will automatically do the following things:

  • Take a set of focus brackets from near to infinity
  • Take a set of exposure brackets from the user set shadow end exposure (hint use ML's RAW spotmeter), to the ETTR position
  • Take exposure and focus bracket sets together
  • Take a set of same exposure brackets, ie to simulate a longer ND time
  • Take a set of same exposure brackets, eg for post processing for super-res or eliminating people

The usual caveats apply, ie I wrote the script for my use and to run on my 5D3 with my lenses. However, I'm confident it should run on any non-EOSM camera that runs the ML Lua module. Note the lens must report AF.

Finally, I really would welcome feedback from others, ie to help me in my efforts and to make the script better.

Cheers

Garry

UPDATED: 29th May 2016

--[[
Auto Bracketing Script
Auto focus bracketing with exposure bracketing
Plus the script does both time and frame bracketing, ie for LE situations
Release 0.95
This version has some error detection, but the user must be aware of certain things:
* Check the correct DoF diffraction options are set in ML, eg diffraction aware is on for best data
* Must use a lens that reports focus distance and DoF can be calculated
* Lens must be in AF mode
* Must be in manual mode
* Switch stabalisation off as you will not be hand holding ;-)
* Must be in LV mode: script won't run unless in LV
* ETTR ON: settings recommended are - no link to dual, SNRs to OFF, highlights very low or zero (your choice_, and not Always On or Auto Snap
* as this may 'confuse' the script
* You can switch focus bracketing on/off in the menu, ie use LE and/or exposure mode alone. The script handles the logic, ie if LE mode is being used,
* then you can't use focus or exposure bracketing
* Image review must not be set to HOLD in Canon menu
* Assumes lens is focused at nearest point to start a focus stack, ie script moves to infinity
* Script takes last bracket with focus point at infinity
* When exposure bracketing, set base exposure to capture shadows (the script will calculate the ETTR of the scene)
* If ETTR fails, then try adjusting ETTR set time to give your camera more time (or experiment with less)
* Final thought: photography should be relaxing, hence I personally don't mind that this script takes time to run. As it's
* running, look around you and enjoy nature and the moment :-)
*******************************************************************************************************
*   *
* If you reference this script, please consider acknowledging me at http://photography.grayheron.net/ *
*   *
*******************************************************************************************************
--]]

-- Declare a few variables for the script whick load when camera switced on
a1 = 0
b1 = 0
a2 = 0
b2 = 0
fp = 0
inf = 100000
base_tv = 0
delay = 0
factor = 0
num_brackets = 0
ETTR_tv = 0
base_tv = 0
user_tv = 0
LE_brackets = 0
running = false
no_tv_error = true
brackets_requested = false
flash = true

function reset()  -- tidy up at the end
no_tv_error = true
brackets_requested = false
running = true
display.notify_box("***FINISHED***",4000)
beep (3, 200 , 1000)  -- notify end of script
display.clear()
end

function my_shoot()
if camera.shutter.apex < -4 then
camera.bulb(camera.shutter.value)
else
camera.shoot(64, false)
end
end

function check_bookend()
if keymenu.submenu["Bookends?"].value == "yes"
then
local tv = camera.shutter.ms
local av = camera.aperture.value
camera.shutter.ms = 1
camera.aperture.apex = 9
my_shoot()
camera.shutter.ms = tv
camera.aperture.value = av
end
end

function find_ETTR()
-- Find the ETTR shutter value: make sure you have set ML ETTR values correctly
local m = menu.get("Auto ETTR","Trigger mode")
menu.set("Auto ETTR","Trigger mode",0) -- set ETTR menu to get an ETTR exposure
local check_tv = 0
repeat -- hang around until ETTR value has stabilised
check_tv = camera.shutter.apex
msleep (keymenu.submenu["ETTR Set Time?"].value*1000)  -- adjust this for your camera. The time delay allows the ML ETTR process to settle down
until check_tv == camera.shutter.apex
ETTR_tv = camera.shutter.apex
menu.set("Auto ETTR","Trigger mode",m) -- reset to user ETTR menu setting
if ETTR_tv < base_tv
then -- base TV needs resetting
display.notify_box("Warning Shadow Tv < ETTR Tv",4000)
beep (3, 200 , 500)  -- warning message
no_tv_error = false
end
end

function calc_brackets()
if no_tv_error then
num_brackets = (ETTR_tv - base_tv)/factor
num_brackets = math.floor(math.abs(num_brackets))
if num_brackets <= 1 then num_brackets = 1 end
end
end

function check_LE()
-- Check to see if user has requested LE bracketing of some kind
if keymenu.submenu["LE mode?"].submenu["select"].value ~= 0
then
if keymenu.submenu["LE mode?"].submenu["Mode?"].value == "time"
then
LE_brackets = math.ceil(keymenu.submenu["LE mode?"].submenu["select"].value/camera.shutter.value)
else
LE_brackets = keymenu.submenu["LE mode?"].submenu["select"].value
end
brackets_requested = true
end
end

function take_brackets()
local i
if LE_brackets == 0
then
if no_tv_error and brackets_requested then -- take exposure brackets
camera.shutter.apex = ETTR_tv
my_shoot()
for i = 1, num_brackets , 1
do
camera.shutter.apex = camera.shutter.apex - factor
my_shoot()
end
if camera.shutter.apex > base_tv
then
camera.shutter.apex = base_tv
my_shoot()
end
else -- take a single image
camera.shutter.apex = base_tv
my_shoot()
end
else -- take some LE bracketing images
for i = 1, LE_brackets , 1
do
my_shoot()
end
-- if no_tv_error then check_bookend() end
end
end

function albs()
if brackets_requested and keymenu.submenu["LE mode?"].submenu["select"].value == 0 then
find_ETTR()
calc_brackets() -- number of exposure brackets
else
msleep(delay)
end
if no_tv_error then check_bookend() end
-- Get DoF info & take first(only) exposure(s)
a2 = lens.dof_near
b2 = lens.dof_far
if no_tv_error then take_brackets() end
-- take focus brackets to infinity if requested
if keymenu.submenu["Focus bracketing?"].value == "yes"
then -- do focus bracketing
if lens.focus_distance < inf and no_tv_error then
repeat
a1=a2
b1=b2
repeat
lens.focus(-1,1)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2 > b1 or fp >= inf
lens.focus(1,1) -- move back one step for focus bracket overlap
take_brackets()
until fp >= inf
end
end
if no_tv_error then check_bookend() end
reset()  -- do some tiding up beforing exiting
end

function setup() -- does some checking before calling the main function
menu.close()
factor = tonumber(keymenu.submenu["Ev bracket delta per image"].value) -- set exposure bracketing offset (0, 1 or 2)
if not lv.enabled then lv.start() end -- just in case
if camera.model_short == "EOSM" then
display.notify_box("Sorry doesn't work with the EOSM", 3000)
else
check_LE()
if factor ~= 0 then brackets_requested = true else brackets_requested = false end
if running -- then script has already been used since camera switched on
then -- reset some stuff...just to be sure :-)
no_tv_error = true
end
if lens.focus_distance ~= 0 and lens.af -- lens is OK
then -- fit to run the main function
base_tv = camera.shutter.apex
albs() 
else  -- lens not OK!
beep (3, 200 , 500)  -- warning message
display.notify_box("Check your lens", 5000)
end
end
end

keymenu = menu.new
{
    parent = "Shoot", -- change this to position the script into other ML menu locations
    name = "Auto Bracketing",
    help = "Remember: LV, DoF & AF on",
depends_on = DEPENDS_ON.LIVEVIEW,
warning = function(this)
if menu.get("Expo","Auto ETTR") == 0 then return "ETTR switched off" end
end,
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
warning = function(this)
flash = not flash
if not lv.enabled then return "LV not enabled" end
end,
select = function(this)
if menu.get("Expo","Auto ETTR") ~= 0 and lv.enabled then
task.create(setup)
end
end,
},
{
name = "Focus bracketing?",
help = "Switches focus bracketing mode on/off",
choices = {"no","yes"},
update = function(this)
if keymenu.submenu["LE mode?"].submenu["select"].value ~= 0 then
menu.set("Auto Bracketing","Focus bracketing?",0)
end
end,
warning = function(this)
flash = not flash
if keymenu.submenu["LE mode?"].submenu["select"].value ~= 0 then
if flash then
return "LE mode on"
else
return ""
end
end
end,
},
{
name = "Ev bracket delta per image",
help = "0 = no auto exposure bracketing",
min = 0,
max = 2,
update = function(this)
if keymenu.submenu["LE mode?"].submenu["select"].value ~= 0 then
menu.set("Auto Bracketing","Ev bracket delta per image",0) end
end,
warning = function(this)
if keymenu.submenu["LE mode?"].submenu["select"].value ~= 0 then
if flash then
return "LE mode on"
else
return ""
end
end
end
},
{
name = "LE mode?",
rinfo = function(this)
if keymenu.submenu["LE mode?"].submenu["select"].value == 0
then return "off"
else return "active"
end
end,
help = "In seconds or frames. Zero = no LE bracketing",
halp2 = "LE or frame bracketing trumps all other bracketing modes",
           submenu =
            {
                {
name = "select",
min = 0,
max = 120,
rinfo = function(this)
if keymenu.submenu["LE mode?"].submenu["Mode?"].value == "time" then return "secs" else return "frames" end
end,
update = function(this)
if keymenu.submenu["LE mode?"].submenu["select"].value ~= 0 then
menu.set("Auto Bracketing","Ev bracket delta per image",0)
menu.set("Auto Bracketing","Focus bracketing?",0)
end
end,
warning = function(this)
if keymenu.submenu["LE mode?"].submenu["Mode?"].value == "time" then
LE_brackets = math.ceil(keymenu.submenu["LE mode?"].submenu["select"].value/camera.shutter.value)
if LE_brackets == 0 then
return "LE bracket taking switched off"
else
return "Note: "..tostring(LE_brackets).." brackets will be taken"
end
end
end
                },
                {
name = "Mode?",
choices = {"time","# frames"},
help = "In seconds or #frames. Zero = no LE bracketing",
                }
            }
        },
{
name = "Bookends?",
help = "Places a dark frame at start and end of focus bracket set",
choices = {"no","yes"},
},
{
name = "Delay",
help = "Delays script start by stated number of secs",
choices = {"2","5","0"},
update = function(this)
delay = tonumber(keymenu.submenu["Delay"].value)*1000 -- delay in ms
end,
},
{
name = "ETTR Set Time?",
help = "A camera specific variable in seconds",
help2 = "Only change if ETTR fails to find a solution",
min = 2,
max = 8,
value = 4 -- set this to time that works in your camera
}
}
}
#254
Scripting Q&A / Negative ML values in Lua
May 26, 2016, 08:16:01 PM
David (if you pick this up)

I can't seem to get negatives to work in the Lua menu, ie


{name = "select",
min = -120,
max = 120,
},


The above just cycles from 0 to 120.

Are negatives not allowed in Lua menus?

Cheers

Garry
#255
General Help Q&A / Dual-ISI in LR Upgrade Help
May 24, 2016, 08:45:57 AM
I've just upgraded to Win 10 and am trying to ensure all my software is 'the latest', including Dual-ISO processing in LR.

Could on kind sole point me to the latest Dual-ISO LR version and the latest 20-bit processing version.

I have looked at the two relevant posts (A1ex etc), but I'm just not sure if these post point me to the latest version.

Any help gratefully received.

Cheers

Garry
#256
I have used LR version (Beta 3) of Dual-ISO for 'ever' and never had an issues.

Then tonight I was processing some Dual FRSP DNGs, which show in LR with no issue.

When I process the duals I get no processed image and an error (white text in a black box) that says "The file could not be found" and the image is greyed out.

As I say, I have never had a problem processing dual-ISOs until now and nothing has changed on my laptops.

Does anyone recognize this behavior?

Cheers

Garry
#257
In the spirit of sharing, I offer other ML users the following: http://photography.grayheron.net/2016/05/long-exposure-simulation-in-lightroom.html

As usual I welcome feedback.
#258
As a stills photographer I often wish to do long exposures, eg to smooth out skies or moving water, or 'eliminate' people from the scene.

Usually this would be where an ND filter would come into play. But what if you don't have an ND filter to hand, or that your ND filter doesn't give you the exposure time you desire for your artistic vision.

This is where the attached script might 'save the day'.

The usual caveats apply, eg I developed it for my workflow, it doesn't have much error checking and I've tested it on my gear, ie a 5D3.

The script makes use of the Full Res Silent Picture taking in ML and uses the Intervalometer, because at the moment I can't work out how to trigger FRSP in a Lua script, other than by using the Intervalometer  >:(

The script is limited (and checks) that the base exposure is set between 0.25 and 14 secs (to ensure it fits within the FRSP needs).

Before use, simply choose what format of FRSP you wish to use, ie DNG or MLV (remember with MLV you will need to load the MLV module and carry out MLV to DNG conversion in post). Todate I have personally stuck with DNG-FRSPs.

The script is not fast, ie it will not capture a 60 sec simulated exposure in 'real time'. But it will do all the work for you and not 'harm your shutter  ;)

To use, simply go into LV and you will find the LE Simulator under the Shoot menu.

Set the exposure (you can set Dual ISO on as well), eg manually or using ETTR auto or hints.

Choose bookends if you wish to add a DNG 'dark' frame at the beginning and end of the capture sequence, ie to help identify a bracket set in post.

Select the LE time you wish to simulate. Note if the LE time is less than the base exposure time, at least one image will be captured.

WARNING this is a LE simulator, thus, for example, if you wished to simulate a 60 second exposure with a base exposure of, say, 0.5s, you will need to capture some 120 images. So be prepared to wait for the script to do its stuff.

Because I could only get FRSP triggered via the intervalometer, the script will flash the LV on and of a few times, and you will see the ML menu flash on and off. If I can work out how to trigger FRSP from Lua without using the intervalometer, I'll update the script.

Once the script has finished (the LV will come back on) 'all' you need to do is to ingest your images in to your favorite post processing tool to process the LE bracket set. I personally use Photoshop-CC via a smart object and use medium or mean stacking.

Note: I set and reset ML menu items in the script.

As usual, I welcome any feedback to help me in my scripting developments and will respond to any suggestions to make the script better, ie I'm not really a programmer.

Cheers

Garry

--[[
LE simulation using shutterless, Full Res Silent Picture bracketing.
Creates (same exposure) brackets for post processing a simulated LE exposure, eg via PS-CC mean smart filter stack
User must re-select FRSP mode, ie DNG or MLV and Dual-ISO if required
Base exposure must be between 0.25-14 secs
Finally, because of my 'work arounds' for triggering the intervalomter function in Lua, the LV will flash on and off a few times
Version 0.5
*******************************************************************************************************
*   *
* If you reference this script, please consider acknowledging me: http://photography.grayheron.net/   *
*   *
*******************************************************************************************************
--]]

function my_shoot()
-- Grab a/some timelapse image(s)
lv.pause()  -- switch off LV, if on, but keep shutter open
menu.open()
menu.close()
repeat -- hang around until finished
msleep (300)
until interval.running == 0 -- when intervalometer has finished
end

function check_bookend()
if keymenu.submenu["Bookends?"].value == "yes"
then
lv.pause()  -- switch off LV, if on, but keep shutter open
local tv = camera.shutter.ms
local av = camera.aperture.value
menu.set("Expo","Expo. Override",1)
camera.shutter.value = 0.3
camera.aperture.value = 20
menu.set("Intervalometer","Start after",0)
menu.set("Shoot","Intervalometer",1)
menu.set("Intervalometer","Take Pics...",0)
menu.set("Intervalometer","Start trigger",0)
menu.set("Intervalometer","Stop after",1)
menu.set("Shoot","Silent Picture",1)
menu.set("Silent Picture","Silent Mode",5)
my_shoot()
camera.shutter.ms = tv
camera.aperture.value = av
end
end

function go() -- and run the script
if camera.shutter.value < 0.25 or camera.shutter.value > 14 then -- not fit for FRSP use
-- Set to a 'safe' condition before exiting
menu.close()
menu.set("Shoot","Intervalometer",0)
menu.set("Shoot","Silent Picture",0)
menu.set("Intervalometer","Start trigger",1)
beep (3, 200 , 500)  -- display warning message
display.notify_box("Adjust your shutter time: 0.25-14 secs", 5000)
else -- alright to use FRSP
lv.start()  -- just in case
check_bookend()
local LE_brackets = math.ceil(keymenu.submenu["LE Time?"].value/camera.shutter.value)
local delay = tonumber(keymenu.submenu["Delay"].value)
if keymenu.submenu["Bookends?"].value == "yes" then delay = 0 end
-- Ensure Intervalometer and FRSP menus are set correctly
menu.set("Shoot","Intervalometer",1)
menu.set("Intervalometer","Take Pics...",0)
menu.set("Intervalometer","Start trigger",0)
menu.set("Intervalometer","Start after",delay)
menu.set("Intervalometer","Stop after",LE_brackets)
menu.set("Intervalometer","Manual FocusRamp",0)
menu.set("Shoot","Silent Picture",1)
menu.set("Silent Picture","Silent Mode",5)
menu.set("Expo","Expo. Override",1)
-- trigger intervalometer via ML menu close
my_shoot()
msleep(100)
check_bookend()
lv.resume() -- switch LV back on, from using intervalometer, to signify end of bracketing
-- Set Intervalometer and FRSP to a 'safe' condition before exiting
menu.set("Shoot","Intervalometer",0)
menu.set("Shoot","Silent Picture",0)
menu.set("Intervalometer","Start trigger",1)
display.notify_box("LE sim script finished", 5000)
beep(3)
end
end

keymenu = menu.new
{
    parent = "Shoot",
    name = "LE Simulator",
    help = "Only uses FRSP",
depends_on = DEPENDS_ON.LIVEVIEW,
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
depends_on = DEPENDS_ON.LIVEVIEW,
select = function(this) task.create(go) end,
},
{
name = "LE Time?",
help = "Simulated LE time in seconds",
min = 1,
           max = 600,
value = 1
},
{
name = "Delay",
help = "Delays script start by stated number of secs",
choices = {"2","5","0"},
},{
name = "Bookends?",
help = "Places a dark frame at start and end of focus bracket set",
choices = {"no","yes"},
}
}
}
#259
General Help Q&A / MLV, FRSP and Intervalometer
May 19, 2016, 08:01:20 PM
I'm sure it's me, but when I use FRSP in MLV mode with the intervalometer I get individual MLV files for each image.

Is this right?

I was expecting a single MLV.
#260
Scripting Q&A / Lua bug report
May 19, 2016, 08:13:08 AM
A1ex

Sorry for posting here, however, I can't sign in to bitbucket, I get a 403 error.

So I'm posting this bug report here, with the suggested fix:

In the Lua interval module.

I think this:
else if(!strcmp(key, "running")) lua_pushinteger(L, is_intervalometer_running());
should be
   else if(!strcmp(key, "running")) lua_pushboolean(L, is_intervalometer_running());
#261
Scripting Q&A / Lua Intervalometer
May 18, 2016, 09:02:31 PM
David  ;)

I'm trying to use the intervalometer in a Lua script, using the following:

repeat -- hang around finished
msleep (1000)
until interval.running == false


But it doesn't seem to work or create any errors.

Is the intervalometer part of Lua enabled?
#262
General Help Q&A / FRSP / CR2 correlation
May 17, 2016, 10:13:13 PM
In case someone has already worked this out  ;)

I'm moving into experimenting with FRSP on my 5D3 and notice that if I set a CR2 RAW exposure at, say, 10s, and it is not blown out, ie all less than 100%, and then compare it with a FRSP, taken with out adjusting the shutter time; the FRSP is very over exposed, ie 100%.

Before I try and look at the correlation function raw-shutter-time to FRSP-shutter-time, I wonder if anyone has this look up table/function?

Or, will I need to create the look up table myself  :(
#263
I have a need to take multiple images (10s) in FRSP, but for the life of me I can't seem to work this out.

I have FRSP set to .MLV mode and have tried using the timelapse to get the multiple images.

I seem to only get one image, despite trying 'like crazy' and at set times greater than the exposure time.

Could some kind person point me in the right direction, ie multiple image taking with FRSP.
#264
Scripting Q&A / Lens focus speeds and scripting
May 14, 2016, 07:42:35 AM
A1ex/David

One thing I have noticed in running my auto focus bracketing scripts on a 5D3 and a 50D, is that the 5D3 zips along, whereas the 50D is relatively sluggish in driving the lens.

Am I right in assuming this is simply a reflection of the different chip sets used in the two cameras and their relative clock cycles etc.

Cheers

Garry
#265
The standard ML diffraction aware Depth of Field feedback assumes the camera is shooting in the optical bands and uses a centre frequency of 550nm.

But what if you have an IR converted camera, like I do?

You could recompile ML and change the frequency, as suggested in focus.c; or you could use the attached script to help you 'fool' ML into giving you the correct near and far depths of field.

To use the script, simply set your optical (sic) Circle of Confusion in the ML menu and run the script (which you will find under the Focus menu).

The script tells you the CoC value to use for IR. The script uses a frequency of 850nm, but you can change this as you please.

Note the CoC to use changes with aperture, hence this approach will only be useful for those that tend to shoot at 'fixed' apertures, eg landscape photographers; or those prepared to reset the CoC to the optical baseline and rerun the script at the new aperture.

Hint: a better solution would be to code frequency as a user variable in the ML menu. Until then, this little script may help some out.

function IR()
local CoC_op = (lens.focal_length * lens.focal_length)/(camera.aperture.value * (lens.hyperfocal - lens.focal_length))*1000
local CoC_menu = menu.get("DOF Settings","Circle of Confusion")
local freq = 850  -- change this to the frequency of your choice, eg for different IR bands or even UV shooting
local k2 = (CoC_menu * CoC_menu - CoC_op*CoC_op)/(550*550)
local CoC_menu_ir = math.floor(math.sqrt((CoC_menu * CoC_menu) + k2 * (550 * 550 - freq * freq)))
display.notify_box("Adjust ML Circle of Confusion to "..CoC_menu_ir, 5000)
end

keymenu = menu.new
{
    parent = "Focus",
    name = "IR",
    help = "Adjust ML Circle of Confusion to this value for IR",
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
select = function(this) task.create(IR) end,
}
}
}
#266
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
#267
I publish this script for the ML stills photographers.

Usual caveats: it works for me and I've 'tested' it on a 5D3.

I've written a little more about it on my blog: http://photography.grayheron.net/2016/05/revision-2.html

Once loaded (use latest nightly of ML) 'all' the user needs to do is:

- Compose
- Focus on the nearest object
- Set the exposure for the shadow area

The script will auto calculate the ETTR exposure, thus guaranteeing highlights are not blown out, and capture all the diffraction corrected depth of field brackets to infinity.

Finally, the script is not designed to 'speed up' your photography. As view camera photographers know, slowing down and enjoying your surroundings is a relaxing experience. The script does, however, help simplify your photography, if, that is, you wish to take complex focus AND exposure bracket sets.

I welcome any feedback on this script: good and bad  ;)

--[[
Landscape auto exposure & focus bracketing script
Release 0.7
This version has little error detection so the user must be aware of certain things:
* Check the correct DoF diffraction options are set in ML, eg diffraction aware is on
* Must use a lens that reports focus distance and DoF can be calculated
* Lens must be in AF mode
* Must be in manual mode
* Switch stabalisation off as you will not be hand holding ;-)
* Must be in LV mode
* ETTR settings should be no dual, S/Ns to zero, highlights very low or zero
* Image review must not be set to HOLD in Canon menu
* Assumes lens is focused at nearest point to start, ie script moves to infinity
* Script takes last bracket with focus point at infinity
* When exposure bracketing, set base exposure to capture shadows (the script will calculate the ETTR of the scene)
* If ETTR fails, then try adjusting line 58 to give your camera more time (or experiment with less)
* Final thought: photography should be relaxing, hence I personally don't mind that this script takes time to run. As it's
* running look around you and enjoy the moment :-)
--]]

-- Declare a few variables for the script
a1 = 0
b1 = 0
a2 = 0
b2 = 0
fp = 0
inf = 100000
delay = 0
base_tv = 0
delay = 0
factor = 0
first_call = true
num_brackets = 0
ETTR_tv = 0
base_tv = 0

function check_bookend()
if keymenu.submenu["Bookends?"].value == "yes"
then
local tv = camera.shutter.ms
camera.shutter.ms = 1
camera.shoot(64, false)
camera.shutter.ms = tv
end
end

function take_brackets()
if keymenu.submenu["Ev bracket delta per image"].value ~= "0"
then
if first_call
then
-- Find the ETTR shutter value
base_tv = camera.shutter.apex
local m = menu.get("Auto ETTR","Trigger mode")
menu.set("Auto ETTR","Trigger mode",0) -- set ETTR menu to get an ETTR exposure
local check_tv = 0
lv.start()
repeat -- hang around until ETTR value has stabilised
check_tv = camera.shutter.apex
msleep (4000)  -- adjust this for your camera (this works on a 5D3). The time delay allows the ML ETTR to settle down
until check_tv == camera.shutter.apex
ETTR_tv = camera.shutter.apex
menu.set("Auto ETTR","Trigger mode",m) -- reset to user ETTR menu setting
num_brackets = (ETTR_tv - base_tv)/factor
num_brackets = math.floor(math.abs(num_brackets))
if num_brackets <= 1 then num_brackets = 1 end
end
camera.shutter.apex = ETTR_tv
camera.shoot(64, false)
for i = 1, num_brackets , 1
do
camera.shutter.apex = camera.shutter.apex - factor
camera.shoot(64, false)
end

if camera.shutter.apex > base_tv
then
camera.shutter.apex = base_tv
camera.shoot(64, false)
end
else
camera.shoot(64, false)
end
first_call = false
end

function albs()
-- check not an EOSM
first_call = true
menu.close()
if camera.model_short == "EOSM"
then
display.notify_box("Sorry doesn't work with the EOSM", 3000)
else
base_tv = camera.shutter.apex  -- get exposure that is set for the shadows
check_bookend()
-- Get DoF info, delay as requested & take first brackets
msleep(delay)
a2 = lens.dof_near
b2 = lens.dof_far
take_brackets()
-- take remaining focus brackets to infinity end
repeat
a1=a2
b1=b2
repeat
lens.focus(-1,1)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2 > b1 or fp >= inf
lens.focus(1,1)
take_brackets()
until fp >= inf
check_bookend()
end
end

keymenu = menu.new
{
    parent = "Shoot",
    name = "Auto Focus Bracketing",
    help = "Remember: LV, DoF & AF on + focus at nearest point",
depends_on = DEPENDS_ON.LIVEVIEW,
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
select = function(this) task.create(albs) end,
},
{
name = "Delay",
help = "Delays script start by stated number of secs",
choices = {"2","5","0"},
update = function(this)
delay = tonumber(keymenu.submenu["Delay"].value)*1000 -- delay in ms
end,
},
{
name = "Bookends?",
help = "Places a dark frame at start and end of focus bracket set",
choices = {"no","yes"},
},

{
name = "Ev bracket delta per image",
help = "0 = no auto exposure bracketing",
choices = {"0","1","2"}, -- change these values to your own choices
update = function(this)
factor = tonumber(keymenu.submenu["Ev bracket delta per image"].value)
end
}
}
}
#268
Scripting Q&A / Access to ML data from Lua
April 29, 2016, 09:43:07 PM
David  ;)

Hope you can help (as usual).

Is there a way to access ML info from Lua.

For example, how would I access the ML spotmeter value?

Cheers

Garry
#269
Still photographers may be interested in my latest script that captures exposure and focus brackets, ie together.

I have added info here: http://photography.grayheron.net/2016/04/the-ultimate-bracketing-tool-but-only.html

And here is the script:

--[[
Landscape auto exposure & focus bracketing script
Release 0.5
This version has no error detection so the user must be aware of certain things:
* Check the correct DoF diffraction options are set in ML, eg diffraction aware is on
* Must use a lens that reports focus distance and DoF can be calculated
* Lens must be in AF mode
* Must be in manual mode
* Switch stabalisation off as you will not be hand holding ;-)
* Must be in LV mode
* Assumes lens is focused at nearest point to start, ie script moves to infinity
* Script takes last bracket with focus point at infinity
--]]

-- Declare a few variables for the script
a1 = 0
b1 = 0
a2 = 0
b2 = 0
fp = 0
inf = 100000
delay = 0
base_tv = 0
delay = 0
factor = 0
num_brackets = 0

function check_bookend()
if keymenu.submenu["Bookends?"].value == "yes"
then
base_tv = camera.shutter.ms
camera.shutter.ms = 1
camera.shoot(64, false)
camera.shutter.ms = base_tv
end
end

function take_image()
local i = 0
camera.shoot(64, false)
if factor ~= 0
then -- take exposure brackets
base_tv = camera.shutter.apex
for i = 1, num_brackets , 1
do
camera.shutter.apex = camera.shutter.apex - factor
camera.shoot(64, false)
end
camera.shutter.apex = base_tv
check_bookend()
end
end

function albs()
-- check not an EOSM
menu.close()
if camera.model_short == "EOSM"
then
display.notify_box("Sorry doesn't work with the EOSM", 3000)
else
-- Get DoF info, delay as requested & take first bracket
msleep(delay)
a2 = lens.dof_near
b2 = lens.dof_far
if factor ~= 0
then -- calculate number of brackets
num_brackets = (tonumber(keymenu.submenu["Shadow Ev"].value) - tonumber(keymenu.submenu["0Ev offset"].value)/10)/factor
num_brackets = math.floor(num_brackets)
if num_brackets <= 1 then num_brackets = 1 end
end
check_bookend()
if num_brackets ~= 0 then check_bookend() end
take_image()
-- take remaining brackets to infinity end
repeat
a1=a2
b1=b2
repeat
lens.focus(-1,1)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2 > b1 or fp >= inf
lens.focus(1,1)
take_image()
until fp >= inf
check_bookend()
end
end

keymenu = menu.new
{
    parent = "Shoot",
    name = "Auto Focus Bracketing",
    help = "Remember: LV, DoF & AF on + focus at nearest point",
depends_on = DEPENDS_ON.LIVEVIEW,
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
select = function(this) task.create(albs) end,
},
{
name = "Delay",
help = "Delays script start by stated number of secs",
choices = {"2","5","0"},
update = function(this)
delay = tonumber(keymenu.submenu["Delay"].value)*1000
end,
},
{
name = "Bookends?",
help = "Places a dark frame at start and end of focus bracket set",
choices = {"no","yes"},
},
{
name = "Shadow Ev",
help = "As measured by shadow Ev from ML Spotmeter",
help2 = "value in integer positive (Ev) stops",
min = 1,
           max = 20,
value = 5,
},
{
name = "0Ev offset",
help = "Number stops (x10) Canon 0Ev is assumed down from highlight max",
help2 = "uses tenths of an Ev",
min = 10,
max = 60,
value = 35,
},
{
name = "Ev bracket delta per image",
help = "0 = no exposure bracketing",
help2 = "Bracketing limited to 1 or 2",
choices = {"0","1","2"},
update = function(this)
factor = tonumber(keymenu.submenu["Ev bracket delta per image"].value)
end
}
}
}
#270
David

I hope you like mysteries.

The following script runs on my 5D3 OK.

--[[
Still photography toggler script
Version 1.0 (should work on all ML enabled cameras with the Lua module)
Garry George March 2016
http://photography.grayheron.net/
Workflow toggler script to help with focus and exposure setting.
Toggle through your workflow using the selected option ie a button or the top of the main dial or toggle switch.
For focus feedback 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.
--]]
-- Declare variables
factor = 0.2
b1 = lens.dof_far
a2 = 0
fp = 0
c1 = 0
inf = 1000000
started = false
current_tv = 0
play = 0
toggler = 0

-- Change toggler value to your choice of button, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants
-- Default is KEY.RATE for non-EOSM cameras. EOSM self selects upper toggle on main dial as the EOSM doesn't have many buttons!
if camera.model_short == "EOSM" then toggler = KEY.UP else toggler = KEY.RATE end

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
started = false
return true
elseif key == toggler 
then
play = play + 1
if play == 7 then play = 0 end
return false
elseif key == KEY.FULLSHUTTER and play ~= 6
then
b1 = lens.dof_far -- in mm
fp = lens.focus_distance -- in mm
c1 = b1 - (b1 - fp)*factor
started = true
return true
elseif key == KEY.HALFSHUTTER and play == 6
then
b1 = lens.dof_far -- in mm
fp = lens.focus_distance -- in mm
c1 = b1 - (b1 - fp)*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
    menu.set("Shoot","Advanced Bracket",0)
menu.set("Expo","Auto ETTR",0)
menu.set("Expo","Dual ISO",0)
menu.set("Shoot","Silent Picture",0)
this.foreground = COLOR.YELLOW
this.background = COLOR.BLUE
if play == 0 then
current_tv = camera.shutter.ms
this.value = " Off"
elseif play == 1 then
this.value = " BE "
camera.shutter.ms = 1
menu.set("Shoot","Advanced Bracket",0)
elseif play == 2 then
this.value = " Off"
camera.shutter.ms = current_tv
elseif play == 3 then
this.value = "ETTR"
menu.set("Expo","Auto ETTR",1)
menu.set("Auto ETTR","Trigger mode",3)
elseif play == 4 then
this.value = "Auto"
menu.set("Shoot","Advanced Bracket",1)
elseif play == 5 then
this.value = "Dual"
menu.set("Expo","Dual ISO",1)
elseif play == 6 then
this.value = "FRSP"
menu.set("Shoot","Silent Picture",1)
else
this.value = ""
end
end
end
}

keymenu = menu.new
{
parent = "Shoot",
name = "Landscape Helper",
help = "Toggle through workflow",
help2 = "Grab exposure or take picture as required",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Provides access to ML 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,
}
}
}


On my friends 5D3 it generates the following errors:

ML/SCRIPTS/TOGGLE~1.LUA:101 set 'camera.shutter.ms'failed
stack traceback:
[c]: in metamethod '__newindex'
ML/SCIRPTS/TOGGLE~1.LUA:101: ...


Any ideas what's going on? I don't understand the metamethod reference.

Cheers

Garry
#271
Scripting Q&A / Lua question with Auto Bracketing
April 24, 2016, 08:30:57 AM
Can anyone point me in the right direction regarding the following.

So when I need to operate the shutter with a script I have use:

camera.shoot(64, false)

What I now wish to do, within a script, is to tap into the ML auto bracketing functionality.

However, what I'm finding is that camera.shoot does not wait for the ML auto bracketing (which I have switched on in the ML menu) to finish. The Lua function camera.shoot only triggers the first image and critically doesn't wait for the ML auto bracketing to finish.

As I say, does anyone have any ideas how to tap into the ML auto bracketing from within a running script, including the script continuing to run after the auto bracketing has finished.

Cheers

Garry
#272
Scripting Q&A / Lua: 5D3 vs EOSM
April 23, 2016, 05:38:04 PM
David

I hope you pick this up and can help.

There appears to be a clear difference between the 5D3 and EOSM Lua.

The following test script runs fine on my 5D3. All it does is beep and run the lens back and forth once.

When I load it on my EOSM (both cameras have the latest nightlies) nothing happens: not even the beep.

I'm mystified.

Can you spot the error of my ways?

Cheers

Garry

--[[
Simple test script
--]]

function albs()
-- Simply test moving the lens
menu.close()
beep(4, 100, 500)
lens.focus(-10,1)
beep(4, 100, 500)
msleep(5000)
lens.focus(10,1)
end

keymenu = menu.new
{
    parent = "Shoot",
    name = "Auto Focus Bracketing",
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
select = function(this) task.create(albs) end,
}
}
}
#273
I'm just loaded the latest nightly and appear to have a fully locked in EOSM shutter bug problem.

Previously, I simply turned the EOSM off and on and this cleared the shutter for use.

It now seems locked in an frozen and unusable state.

Does anyone else have this issue?
#274
The following script has been written for still photographers who want easy access to: landscape focus bracketing, exposure bracketing, dual-ISO, ETTR and Full Res Silent Picture.

The power of the script is 'The Toggler' concept, that allows one-button access to the above, ie without going into the ML menu.

I have written a little about The Toggler on my blog: http://photography.grayheron.net/2016/03/silent-toggler.html

To get the full value you need a lens that reports focus distance. I have tested the script on a 5D3, an EOSM and with Canon and Sigma lenses.

Here is the script:

--[[
Still photography toggler script
Version 1.0 (should work on all ML enabled cameras with the Lua module)
Garry George March 2016
http://photography.grayheron.net/
Workflow toggler script to help with focus and exposure setting.
Toggle through your workflow using the selected option ie a button or the top of the main dial or toggle switch.
For focus feedback 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
toggler = 0
-- Change toggler value to your choice of button, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants
-- Default is KEY.RATE for non-EOSM cameras. EOSM self selects upper toggle on main dial as the EOSM doesn't have many buttons!
if camera.model_short == "EOSM" then toggler = KEY.UP else toggler = KEY.RATE end

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
started = false
return true
elseif key == toggler 
then
play = play + 1
if play == 7 then play = 0 end
return false
elseif key == KEY.FULLSHUTTER and play ~= 6
then
b1 = lens.dof_far -- in mm
fp = lens.focal_distance -- in cm
c1 = b1 - (b1 - fp*10)*factor
started = true
return true
elseif key == KEY.HALFSHUTTER and play == 6
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)
i = menu.set("Expo","Dual ISO",0)
i = menu.set("Shoot","Silent Picture",0)
this.foreground = COLOR.YELLOW
this.background = COLOR.BLUE
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 = " Off"
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)
elseif play == 5 then
this.value = "Dual"
i = menu.set("Expo","Dual ISO",1)
elseif play == 6 then
this.value = "FRSP"
i = menu.set("Shoot","Silent Picture",1)
else
this.value = ""
end
end
end
}

keymenu = menu.new
{
parent = "Shoot",
name = "Landscape Helper",
help = "Toggle through workflow",
help2 = "Grab exposure or take picture as required",
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
help2 = "Provides access to ML 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,
}
}
}
#275
General Help Q&A / Intervalometer & FRSP
March 19, 2016, 09:08:33 AM
Forgive my stupidity, however, I simply can't work out how to get the intervalometer working with FRSP.

I have FRSP on in DNG mode, triggered a half press. This works on its own :)

I put the intervalometer on, with a delay of 10s (the FRSP shutter time is 2s), triggered by half press and stop after 3 (for demo).

But all I get is a single image capture.

Could one of the intervalometer experts point out where I'm going wrong, ie getting the intervalometer to work with FRSP.

BTW I know I could also use MLV but for now I wish to use it with DNGs.
#276
Scripting Q&A / Lua key press redirect
March 18, 2016, 10:44:18 PM
David (if your watching :) )

I'm trying to be clever and redirect a key press. The following script is meant to intercept the press of the play button and turn this into a half shutter press. But it doesn't seem to work. The play button responds as if play was pressed. Any ideas where I'm going wrong in this test script?

test_menu = menu.new
{
    name = "Show keypress",
    choices = { "Off", "On" },
    value = "On",
}

function event.keypress(key)
    if key == KEY.PLAY and test_menu.value == "On" then
key = UNPRESS_HALFSHUTTER
return true
end
end
#277
General Help Q&A / Audio Trigger Noise
March 13, 2016, 09:17:38 AM
I have been experimenting with the audio trigger in cable mode in (latest nightly) ML and see some issues.

First, the 'obvious' one, you need to make sure you connect up before you switch this feature on, as connecting triggers the feature.

For my experiment I simply used an audio jack-2-jack connector (I tried three different ones) and used the free TriggerTrap app as my trigger.

If I was very still, ie not moving the audio cable, the TriggerTrap triggered the ML audio OK.

If I moved the cable, or rotated the jack at either end, in my iPod or in the camera, it triggered. I tried changing dB from 1 to 20 and it still triggered.

Is this above behavior expected?

Cheers

Garry
#278
Scripting Q&A / Lua Startup
March 13, 2016, 08:23:51 AM
David

A thought...

I believe at the moment, the Lua environment's default is to run/load all the scripts on startup.

The thought I have had is this: if there are two scripts loaded, independently written by different people, ie not designed by the same person to run 'together', there must be a risk that these two scripts may clash. For example, if both ran event.keypress etc.

For this reason, would it not be better to have no scripts running/loaded, ie get the user to explicitly load/run. Ideally, being able to tell ML to run script A or B etc on startup, ie a script has a startup flag.

Or have I missed something?

Cheers

Garry
#279
David

I've tried to get an event.keypress to 'detect' a log key press, but have failed.

Is there any chance you could 'hard wire' such a feature into the Lua module.

To be clear, so the Lua event.keypress can flag up the difference between a simple key press and a long key press.

This will greatly increase the functionality of script, especially on cameras with limited buttons, eg the EOS-M

Cheers

Garry
#280
David

I think I've now confirmed there is something strange happening with camera.shutter.apex. I've reported a 'bug'.

The code below works with shutter.ms but not with shutter.apex

Cheers

Garry

--[[
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,
}
}
}
#281
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 :)


#282
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,
}
}
}


#283
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?
#284
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?
#285
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.
#286
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  ;)

#287
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
}
}
}

#288
David

I hope you are watching  :)

I continue to suffer from Lua semaphore errors but can't see why, as I followed you advice.

My script is this:

--[[
Manual Landscape bracketing helper script
Version 0.3.3
Garry George Feb 2016
http://photography.grayheron.net/
First focus at nearest bracket in focus stack then move towards infinity.
Try using ML follow focus to control 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

function do_bookend()
task.create(function()
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
camera.aperture.apex = 90
camera.shoot(64, 0)
camera.shutter.apex = current_tv
camera.aperture.apex = current_av
end)
task.yield(100)
end

event.keypress = function(key)
if key == KEY.RATE then
if keymenu.submenu["Bookends"].value == "yes"
then
do_bookend()
end
return true
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
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",
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 = "Adds a dark frame",
choices = {"no","yes"},
}
}
}


When I press the RATE button I start a new task and steal the keypress and call do_bookend. Sometimes I don't get the semaphore error, but usually I do.

Can you suggest what I'm doing wrong?

Cheers

Garry
#289
Scripting Q&A / 'Dumb' Lua question
February 17, 2016, 06:44:38 PM
I hope David (Lua guru) is watching and can put me out of my misery, once again!

'All' I'm trying to do is access (get) and then change (set) an ML sub/sub menu item, "Shoot", "Advanced Bracket", "Frames" eg I can get to Advanced Bracket, but how do I get/set Frames?

i = menu.get("Shoot", "Advanced Bracket")


I've tried many different things.

Hope some kind person can help?
#290
Feature Requests / Auto Bracket Post Shot Review
February 17, 2016, 07:57:07 AM
I haven't really been sensitive to how Auto Bracketing works until now, as I try and build auto bracketing into some script-based workflow.

What seems to happen with auto bracketing, but not with ML taking a fixed numbers of brackets, is that it flashes up an image review after each image and, more importantly leaves the camera on image review after the auto bracketing completes, ie rather than returning to the screen the camera was in at the start of the auto bracketing sequence. BTW I have Canon review set to off.

Is there a way to have auto bracketing behave as fixed ML bracketing, ie not show the image review and return the camera to the pre bracketing state.

#291
Scripting Corner / Focus Stacking Helper Script
February 16, 2016, 01:08:25 AM
I hope this post and script helps others who are learning/struggling to become 'scripters'.

I couldn't have got this far without the help of David Milligan and others, who have provide feedback.

Although learning Lua scripting is easier than trying to code in ML C, Lua still requires some effort to learn, especially while the 'user manual' is being developed. For instance http://davidmilligan.github.io/ml-lua/index.html helps, but there are still areas where the user is left 'guessing'.

As a scripting newbie, I have spent tens of hours experimenting and trying to divine coding errors. I have educated myself on event driven programming and now have a reasonable looking script to offer the ML community.

This script's only purpose is to provide in-camera feedback to aid landscape (sic) focus stacking, ie NOT macro focus stacking.

The caveats are the lens must report focus distance and DoF, and LV must be on.

Before using it is best to check if the ML DoF is set up correctly, eg I recommend switching on the diffraction aware option.

I have positioned the script in the Audio menu (my preference), but this can me moved elsewhere.

Here is the script, which you should put in a text file with a .lua extension and place this file in the ML script folder.

--[[
Manual Landscape bracketing helper script
Version 0.3.3
Garry George Feb 2016
http://photography.grayheron.net/
First focus at nearest bracket in focus stack then move towards infinity.
Try using ML follow focus to control 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

event.keypress = function(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then started = false end
if fp ~= 0 then
if key == KEY.UNPRESS_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
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",
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%"},
}
}
}


The script, by default, is not running. To switch it on, go to the menu and switch to 'on'.

Also change the bracket to bracket overlap. The default is 20%, but you can reduce this to 10% or 5%. The % represent the % of the distance between the current bracket's DoF(far) and the focal_distance. According to the lens you may not see the effect of this variable.

Do a half shutter press to get rid of the script's menu and, of course, ensure you are displaying the ML top and bottom bars of information.

To use the script, once switched on, position the lens at the first (closest) bracket and take a picture. You will then see a helper flag (coloured block) come on.

The coloured blocks have the following meaning:
* Yellow = move the lens towards the infinity end
* Red = move the lens towards the macro end
* Green, if seen, means the lens is in the 'sweet spot', according to the % overlap criterion

If you don't see green, but just yellow or red, simply move the lens into the yellow position just before it goes red.

Each time you take a picture move the lens closer to the infinity end until you see INF in the coloured block. This means the DoF-far has reached infinity: you may wish to take an insurance shot beyond this.

Consider using the ML follow focus to move the lens, as this is more controllable than trying to manually position the lens.

To take a new set of brackets, simply reposition the lens to a new closest image and take a picture to reset the bracketing sequence. Consider grabbing a bookend image to separate your bracket sequences, eg an image of your hand: this will help in post processing, especially if you are not recomposing.

Bottom line: I have tested the script on my 5D3 and 24-105 F/4L and it works for me. I hope it does for you. As usual I welcome feedback on this script. Also note that my next project is an automated version of this, but I can't finish this until the next Lua update is pushed out, eg fixing the lens control by Lua.
#292
Feature Requests / Burning user info into an image
February 11, 2016, 10:10:17 AM
Now we have Lua scripting, I wonder if it is possible to consider the follow additional ML features.

1. Writing additional user info to an image's EXIF, eg focal distance, DoF etc etc. does EXIF support adding  text info?

2. Could someone think about a way to add text direct to the sensor, raw file. Once again, info about the image or a set of brackets etc

Either if the above would 'burn in' field data to the image, or associated image, to aid subsequent post processing etc.
#293
Scripting Q&A / Lua Help!!!!
February 07, 2016, 10:29:15 PM
I'm bashing my head trying to get a Lua script to work.

It does, but I keep getting the console starting (when I'm not switch it on) and the repeated message...

"Lua semaphore time out (another task is running this script)" followed by a Save Configs,

Can anyone suggest what I'm doing wrong?
#294
As I gain greater awareness of Lua scripting, I'm facing an 'obvious' question: how can I access some of the standard ML functionality from within a Lua script.

For example: setting an ETTR exposure.

Does anyone know how to do this?

Cheers

Garry
#295
Although this is only at Version 0.2, reflecting some 'features' in the Lua module that means I can't yet script a full version: I thought ML friends would like to see what can be achieved with the Lua toolset.

I've also posted about the script on my blog: http://photography.grayheron.net/2016/01/magical-auto-landscape-bracketing.html

Here is the script; which I'm sure can be optimised by a guru  ;)

-- Simple landscape bracketing script
-- Version 0.2
-- Assumes lens is positioned at farthest point
-- in bracket set.

a1 = 0
b1 = 0
a2 = 0
b2 = 0
i = 0
current_tv = 0
current_av = 0

function main()
-- Close ML menu
menu.close()

if lens.dof_near ~= 0 and lens.af == true
then
-- Delay for requested seconds
for i = keymenu.submenu["Delay"].value,0,-1
do
msleep(1000)
end
-- Check if bookends requested
if keymenu.submenu["Bookends"].value == "yes"
then
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
camera.aperture.apex = 90
task.yield(100)
camera.shoot(64, 0)
camera.shutter.apex = current_tv
camera.aperture.apex = current_av
end
-- Capture first image
a2 = lens.dof_near
b2 = lens.dof_far
task.yield(100)
camera.shoot(64, 0)
-- take remaining brackets to macro end
repeat
a1=a2
b1=b2
repeat
lens.focus(1,1)
b2 = lens.dof_far
a2 = lens.dof_near
until b2 < a1 or lens.focal_distance <= keymenu.submenu["MFD"].value
camera.shoot(64,0)
until lens.focal_distance <= keymenu.submenu["MFD"].value
-- User macro stop reached
beep(4, 100, 330)
-- Check if bookends requested
if keymenu.submenu["Bookends"].value == "yes"
then
current_tv = camera.shutter.apex
current_av = camera.aperture.apex
camera.shutter.apex = 100
camera.aperture.apex = 90
task.yield(100)
camera.shoot(64, 0)
beep(4, 100, 630)
camera.shutter.apex = current_tv
camera.aperture.apex = current_av
end
end
end

keymenu = menu.new
{
    parent = "Audio",
    name = "Landscape Stacker",
    help = "Focus at farthest point",
help2 = "AF must be on",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Run",
help = "Starts the script",
depends_on = DEPENDS_ON.LIVEVIEW,
select = function(this) task.create(main) end,
},
{
name = "Delay",
help = "Seconds to delay start (default 5)",
value = 5,
min = 0,
max = 10
},
{
name = "MFD",
help = "Min Focus Distance (default 50cm)",
help2 = "Set for your lens",
value = 50,
min = 10,
max = 500
},
{
name = "Bookends",
help = "Adds a dark frame before/after brackets",
choices = {"no","yes"},
value = {"no"}
}
}
}


Although the code does some 'error checking', the user must be aware of a few limitations, eg must be in LV, lens must report focus distance and DoF distances, and have auto focus enabled.

Once the Lua module has a few 'fixes', eg I can only drive the lens one way at the moment, I will update the script to do the following:
* bracket from infinity to the macro end (as now)
* bracket from a near focus to infinity
* bracket from the macro (stop) end to infinity.

As usual I welcome feedback to help my program learning (I'm a novice) and, of course, any requests for functionality that I'm missing.

Cheers

Garry
#296
Scripting Q&A / Questions about Lua scripting
January 24, 2016, 06:48:32 PM
I appreciate this thread may not even get traction, but it is my humble attempt to see if the 'experts' can support the 'newbies' on Lua scripting.

By copying the scripts of others, I am making slow progress on learning to script in ML-Lua.

But like most programming, I find myself struggling with some basics, as I'm not a programmer.

As an example. To print a message I would use

print "test message"

So far so good. But what if I wish to print a variable, ie for debugging. For example lens.focal_length. If I try

print "lens.focal_length" I simply get the text 'lens.focal_length'.

I've tried using the Lua tostring, but get errors.

Bottom line: if this post gets traction, I hope it can be used by all those interested in learning Lua: supported by those that are prepared to mentor others.
#297
Share Your Photos / Wide Angle Macro
September 22, 2015, 08:31:31 PM
I just got my new 15mm F/4 1:1 Macro lens from Venus Lens and thought some of you may be interested in my early experiments, as I use ML to set the exposure and grab the (auto) brackets.

http://photography.grayheron.net/2015/09/further-experiments-in-wide-angle-macro.html
#299
Feature Requests / Missing EXIF Data
June 12, 2015, 05:13:16 PM
On many occasion we make use of lenses that don't report key EXIF attributes, eg aperture.

Use cases are when doing timelapse (lens twist trick or a manual lens) or using an adapter with a manual lens, eg I use a 645 lens on my 5D3 and 50D.

I know it is possible to add in EXIF data in post, but was wondering if it is worth adding a feature to allow the user to explicitly add in missing EXIF, eg the aperture, as exposure time and ISO setting come from the camera and are usually written to EXIF.

Request: can we include an ML menu item to allow the user to explicitly enter the F number in the EXIF data of an image?
#300
As some may know I play around with ML a lot. I believe ETTR, Dual-ISO and auto-bracketing are killer features for a still photographer.

However, there are two other ML features that shouldn't be forgotten: RAW histogram and Bulb Timer.

I recently purchased a second hand Mamiya 45mm 645 lens and tonight attached it to my FotodioxPro 645-EOS Throttle, which gives me a rear variable 2-10 stop ND filter.

I thought some may be interested in this use for ML: http://photography.grayheron.net/2015/06/moving-to-inverse-crop.html

That is setting an LE and controlling the Bulb.