A1ex
Yes. The script runs in LV.
Cheers
Garry
Yes. The script runs in LV.
Cheers
Garry
Etiquette, expectations, entitlement...
@autoexec_bin | #magiclantern | Discord | Reddit | Server issues
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 Menusoft_err = true
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
function move(direction)
local a1 = 0
local b1 = 0
if direction == -1 then -- focus stack ti infinity soft stop
repeat
a1 = a2
b1 = b2
repeat
soft_err = lens.focus(-1,1,false)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2> b1 or soft_err == false
msleep(1000)
until soft_err == false
else -- focus stack to macro soft stop
repeat
a1 = a2
b1 = b2
repeat
soft_err = lens.focus(1,1,false)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until b2 < a1 or soft_err == false
camera.shoot(64, false)
until soft_err == false
end
end
function start() -- test out focus stacking works through the soft stop error return
move(-1)
move(1)
move(-1)
end
scrnshot_menu = menu.new
{
name = "Test",
select = function(this)
task.create(start)
end
}
if direction == -1 then -- focus stack ti infinity soft stop
repeat
a1 = a2
b1 = b2
repeat
soft_err = lens.focus(-1,1,false)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2> b1 or soft_err == false
lens.focus(1,1,false) -- move back to ensure focus overlap
msleep(1000)
until soft_err == false
soft_err = true
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
function move(direction)
local a1 = 0
local b1 = 0
if direction == -1 then -- focus stack ti infinity soft stop
repeat
a1 = a2
b1 = b2
repeat
soft_err = lens.focus(-1,1,false)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2> b1 or soft_err == false
msleep(1000)
until soft_err == false
else -- focus stack to macro soft stop
repeat
a1 = a2
b1 = b2
repeat
soft_err = lens.focus(1,1,false)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until b2 < a1 or soft_err == false
msleep(1000)
until soft_err == false
end
end
function start() -- test out focus stacking works through the soft stop error return
move(-1)
move(1)
move(-1)
end
scrnshot_menu = menu.new
{
name = "Test",
select = function(this)
task.create(start)
end
}
===============================================================================
ML/SCRIPTS/TEST.LUA - 2016-6-27 22:18:55
===============================================================================
Strict mode tests...
Strict mode tests passed.
Generic tests...
camera = table:
shutter = table:
raw = 115
apex = 7.375
ms = 6
value = 0.006024
aperture = table:
raw = 67
apex = 7.375
value = 12.8
min = table:
raw = 40
apex = 4
value = 4
max = table:
raw = 80
apex = 9
value = 22.6
iso = table:
raw = 72
apex = 5
value = 100
ec = table:
raw = 0
value = 0
flash_ec = table:
raw = -5
value = -0.624999
kelvin = 2500
mode = 3
metering_mode = 3
drive_mode = 0
model = "Canon EOS 5D Mark III"
model_short = "5D3"
firmware = "1.1.3"
temperature = 151
state = 0
reboot = function: p
shoot = function: p
bulb = function: p
event = table:
pre_shoot = nil
post_shoot = nil
shoot_task = nil
seconds_clock = nil
keypress = nil
custom_picture_taking = nil
intervalometer = nil
config_save = nil
console = table:
write = function: p
show = function: p
clear = function: p
hide = function: p
lv = table:
enabled = true
paused = false
running = true
zoom = 1
start = function: p
resume = function: p
info = function: p
stop = function: p
pause = function: p
wait = function: p
lens = table:
name = "EF24-105mm f/4L IS USM"
focal_length = 24
focus_distance = 1820
hyperfocal = 5649
dof_near = 1383
dof_far = 2659
af = true
af_mode = 0
focus = function: p
display = table:
idle = true
height = 480
width = 720
screenshot = function: p
rect = function: p
pixel = function: p
on = function: p
load = function: p
line = function: p
off = function: p
notify_box = function: p
print = function: p
draw = function: p
clear = function: p
circle = function: p
key = table:
last = 0
press = function: p
wait = function: p
menu = table:
visible = false
close = function: p
get = function: p
block = function: p
set = function: p
new = function: p
open = function: p
testmenu = userdata:
value = 0
name = "Script API tests"
help = "Various tests for the Lua scripting API."
help2 = "When adding new Lua APIs, tests for them should go here."
advanced = 0
depends_on = 0
edit_mode = 0
hidden = false
icon_type = 5
jhidden = false
max = 0
min = 0
selected = true
shidden = false
starred = false
submenu_height = 0
submenu_width = 0
unit = 0
works_best_in = 0
run_in_separate_task = 0
select = function: p
update = nil
info = nil
rinfo = nil
warning = nil
movie = table:
recording = false
start = function: p
stop = function: p
dryos = table:
clock = 29
ms_clock = 29777
prefix = "2P6A"
dcim_dir = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = nil
path = "B:/"
path = "B:/DCIM/"
path = "B:/DCIM/100EOS5D/"
config_dir = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = nil
path = "A:/"
path = "ML/"
path = "ML/SETTINGS/"
ml_card = table:
cluster_size = 32768
drive_letter = "A"
file_number = 2459
folder_number = 100
free_space = 27909408
type = "CF"
path = "A:/"
_card_ptr = userdata
shooting_card = table:
cluster_size = 131072
drive_letter = "B"
file_number = 2459
folder_number = 100
free_space = 51559424
type = "SD"
path = "B:/"
_card_ptr = userdata
date = table:
month = 6
min = 18
yday = 179
isdst = false
sec = 57
year = 2016
day = 27
hour = 22
wday = 2
directory = function: p
call = function: p
remove = function: p
interval = table:
time = 0
count = 0
running = 0
stop = function: p
battery = table:
level = 51
id = 3
performance = 3
time = 3519
drain_rate = 52
task = table:
create = function: p
yield = function: p
property = table:
Generic tests completed.
Module tests...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Testing exposure settings, module 'camera'...
Camera : Canon EOS 5D Mark III (5D3) 1.1.3
Lens : EF24-105mm f/4L IS USM
Shoot mode: 3
Shutter : ,160 (raw 115, 0.006024s, 6ms, apex 7.375)
Aperture : 12 (raw 67, f/12.8, apex 7.375)
Av range : 4.0..22 (raw 40..80, f/4..f/22.6, apex 4..9)
ISO : 100 (raw 72, 100, apex 5)
EC : 0.0 (raw 0, 0 EV)
Flash EC : -0.6 (raw -5, -0.624999 EV)
Setting shutter to random values...
===============================================================================
ML/SCRIPTS/TEST.LUA - 2016-6-27 22:22:03
===============================================================================
Strict mode tests...
Strict mode tests passed.
Generic tests...
camera = table:
shutter = table:
raw = 125
apex = 8.624999
ms = 3
value = 0.002532
aperture = table:
raw = 67
apex = 7.375
value = 12.8
min = table:
raw = 40
apex = 4
value = 4
max = table:
raw = 80
apex = 9
value = 22.6
iso = table:
raw = 72
apex = 5
value = 100
ec = table:
raw = 0
value = 0
flash_ec = table:
raw = -5
value = -0.624999
kelvin = 2500
mode = 3
metering_mode = 3
drive_mode = 0
model = "Canon EOS 5D Mark III"
model_short = "5D3"
firmware = "1.1.3"
temperature = 152
state = 0
shoot = function: p
bulb = function: p
reboot = function: p
event = table:
pre_shoot = nil
post_shoot = nil
shoot_task = nil
seconds_clock = nil
keypress = nil
custom_picture_taking = nil
intervalometer = nil
config_save = nil
console = table:
write = function: p
clear = function: p
hide = function: p
show = function: p
lv = table:
enabled = true
paused = false
running = true
zoom = 1
stop = function: p
resume = function: p
pause = function: p
start = function: p
info = function: p
wait = function: p
lens = table:
name = "EF24-105mm f/4L IS USM"
focal_length = 24
focus_distance = 1060
hyperfocal = 5649
dof_near = 895
dof_far = 1298
af = true
af_mode = 0
focus = function: p
display = table:
idle = true
height = 480
width = 720
rect = function: p
notify_box = function: p
on = function: p
draw = function: p
off = function: p
pixel = function: p
load = function: p
print = function: p
circle = function: p
screenshot = function: p
line = function: p
clear = function: p
key = table:
last = 0
press = function: p
wait = function: p
menu = table:
visible = false
new = function: p
get = function: p
open = function: p
set = function: p
block = function: p
close = function: p
testmenu = userdata:
value = 0
name = "Script API tests"
help = "Various tests for the Lua scripting API."
help2 = "When adding new Lua APIs, tests for them should go here."
advanced = 0
depends_on = 0
edit_mode = 0
hidden = false
icon_type = 5
jhidden = false
max = 0
min = 0
selected = true
shidden = false
starred = false
submenu_height = 0
submenu_width = 0
unit = 0
works_best_in = 0
run_in_separate_task = 0
select = function: p
update = nil
info = nil
rinfo = nil
warning = nil
movie = table:
recording = false
start = function: p
stop = function: p
dryos = table:
clock = 23
ms_clock = 23938
prefix = "2P6A"
dcim_dir = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = nil
path = "B:/"
path = "B:/DCIM/"
path = "B:/DCIM/100EOS5D/"
config_dir = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = table:
exists = true
create = function: p
children = function: p
files = function: p
parent = nil
path = "A:/"
path = "ML/"
path = "ML/SETTINGS/"
ml_card = table:
cluster_size = 32768
drive_letter = "A"
file_number = 2459
folder_number = 100
free_space = 27909408
type = "CF"
_card_ptr = userdata
path = "A:/"
shooting_card = table:
cluster_size = 131072
drive_letter = "B"
file_number = 2459
folder_number = 100
free_space = 51559424
type = "SD"
_card_ptr = userdata
path = "B:/"
date = table:
wday = 2
yday = 179
isdst = false
min = 22
sec = 4
month = 6
hour = 22
day = 27
year = 2016
remove = function: p
call = function: p
directory = function: p
interval = table:
time = 0
count = 0
running = 0
stop = function: p
battery = table:
level = 50
id = 3
performance = 3
time = 3450
drain_rate = 52
task = table:
create = function: p
yield = function: p
property = table:
Generic tests completed.
Module tests...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Testing exposure settings, module 'camera'...
Camera : Canon EOS 5D Mark III (5D3) 1.1.3
Lens : EF24-105mm f/4L IS USM
Shoot mode: 3
Shutter : ,400 (raw 125, 0.002532s, 3ms, apex 8.624999)
Aperture : 12 (raw 67, f/12.8, apex 7.375)
Av range : 4.0..22 (raw 40..80, f/4..f/22.6, apex 4..9)
ISO : 100 (raw 72, 100, apex 5)
EC : 0.0 (raw 0, 0 EV)
Flash EC : -0.6 (raw -5, -0.624999 EV)
Setting shutter to random values...
err_state = true
function move()
lens.focus(1,1,true)
end
function erf()
err_state = false
end
function focus()
err_state = true
repeat
xpcall(move,erf)
until err_state == false
-- now move the other way having detected an error
lens.focus(-10,1,true)
end
scrnshot_menu = menu.new
{
name = "Test",
select = function(this)
task.create(focus)
end
}
repeat
if lens.focus(1,1,true) then stop = false else stop = true end
until stop
[code]repeat
if lens.focus(1,1,false) then stop = false else stop = true end
until stop
[/code]function focus()
local stop = false
repeat
if lens.focus(1,1,true) then stop = false else stop = true end
until stop
-- now move the other way having detected the soft limit
lens.focus(-10,1,true)
end
scrnshot_menu = menu.new
{
name = "Test",
select = function(this)
task.create(focus)
end
}
if lens.focus_distance < inf and no_tv_error then
if keymenu.submenu["Focus bracketing?"].value == "FP2INF" then
repeat
a1=a2
b1=b2
repeat
lens.focus(-1,1,true)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2 > b1 or fp >= inf
lens.focus(1,1,true) -- move back one step for focus bracket overlap
take_brackets()
until fp >= inf
else
repeat
a1=a2
b1=b2
repeat
if lens.focus(1,1,true) then stop = false else stop = true end
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until b2 < a1 or stop
if not stop then lens.focus(-1,1,true) end -- move forward one step for focus bracket overlap
take_brackets()
until stop == true
end
end
function focus()
local lens_error
repeat
lens_error = lens.focus(1,1,true)
until lens_error == false
-- now move the other way having detected the soft limit
lens_error = lens.focus(-10,1,true)
end
scrnshot_menu = menu.new
{
name = "Test",
select = function(this)
task.create(focus)
end
}
elseif keymenu.submenu["Focus bracketing?"].value == "FP2MAC" then
repeat
a1=a2
b1=b2
repeat
lens_error = lens.focus(1,1,true)
b2 = lens.dof_far
a2 = lens.dof_near
if a2 == a1 then -- move lens a bit more
lens_error = lens.focus(1,1,true)
b2 = lens.dof_far
a2 = lens.dof_near
end
fp = lens.focus_distance
until b2 < a1 or lens_error == false
lens_error = lens.focus(-1,1,true) -- move forward one step for focus bracket overlap
take_brackets()
until lens_error == false
end
elseif keymenu.submenu["Focus bracketing?"].value == "FP2MAC" then
repeat
a1=a2
b1=b2
repeat
lens_error = lens.focus(1,1,true)
b2 = lens.dof_far
a2 = lens.dof_near
if a2 == a1 then -- move lens a bit more just to be sure
lens_error = lens.focus(1,1,true)
b2 = lens.dof_far
a2 = lens.dof_near
end
fp = lens.focus_distance
until b2 < a1 or lens_error == false
lens_error = lens.focus(-1,1,true) -- move forward one step for focus bracket overlap
take_brackets()
until lens_error == false
end
Page created in 0.100 seconds with 15 queries.