Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting Q&A => Topic started by: garry23 on April 23, 2016, 05:38:04 PM

Title: Lua: 5D3 vs EOSM
Post by: garry23 on 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,
}
}
}
Title: Re: Lua: 5D3 vs EOSM
Post by: dmilligan on April 23, 2016, 09:25:16 PM
Quote from: garry23 on April 23, 2016, 05:38:04 PM
When I load it on my EOSM (both cameras have the latest nightlies) nothing happens: not even the beep.
The EOSM can't beep.

lens.focus may have issues in the core, IDK
Title: Re: Lua: 5D3 vs EOSM
Post by: a1ex on April 24, 2016, 01:50:15 PM
Looks like rack focus and follow focus are not enabled on the EOS M either...

Any focus settings in Canon menu that could help?
Title: Re: Lua: 5D3 vs EOSM
Post by: garry23 on April 24, 2016, 02:12:24 PM
@a1ex

I tried changing various Canon settings on the EOSM. But the lens refuses to move :-(

I'll keep experimenting.

Cheers

Garry
Title: Re: Lua: 5D3 vs EOSM
Post by: garry23 on April 25, 2016, 07:46:19 AM
@a1ex/@dmilligan

I've tried to see what the problem with the Lua on the EOSM is, and I'm convinced it is just that lens.focus is not working on the EOSM.

Here is my test script.

--[[
Simple test script
--]]

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

keymenu = menu.new
{
    parent = "Shoot",
    name = "lens test",
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
select = function(this) task.create(albs) end,
}
}
}


BTW David, you say the EOSM can't beep, but in the EOSM Canon Menu is has an option to enable/disable beep. Am I missing something?

BTW Alex, in another post you suggested camera.shoot() will work, rather than my use of camera.shoot(64,false). I needed to use the fuller version, as the camera.shoot default is AF=true, and this throws out my control of the focus motor.

Bottom line: the above test script works on the 5D3 and I've tested it on the 50D (where it runs noticeably slower, which I guess reflects the different Digic chip sets in 50D compared to the 5D3).

Hope this feedback helps developers?

Cheers

Garry
Title: Re: Lua: 5D3 vs EOSM
Post by: dmilligan on April 25, 2016, 12:52:02 PM
Quote from: garry23 on April 25, 2016, 07:46:19 AM
BTW David, you say the EOSM can't beep, but in the EOSM Canon Menu is has an option to enable/disable beep. Am I missing something?
http://builds.magiclantern.fm/#/features

Quote from: garry23 on April 25, 2016, 07:46:19 AM
I'm convinced it is just that lens.focus is not working on the EOSM.
None of the focus stuff works on EOSM, again see:
http://builds.magiclantern.fm/#/features
Title: Re: Lua: 5D3 vs EOSM
Post by: garry23 on April 25, 2016, 06:42:21 PM
Thanks David, I'd missed that feature chart.

I'll put a simple test to check for an EOSM and make better use of the feature chart to ensure my future scripts work correctly.

Once again, thanks for your help.