How to I lock a layer?
Moderators: Víctor Paredes, Belgarath, slowtiger
How to I lock a layer?
I often mess up my art when I forget on which layer I am, can I lock down layers so I can't draw on the wrong one?
new account: brahrah
Re: How to I lock a layer?
That's a feature many users, including myself, have been requesting for a long time.
Personally, I wish I could lock Reference layers. To keep artists from animating the Reference layers, I append the title with REF_[layer name] and then I color code the layer red. This doesn't prevent someone from editing the layer but it helps make it more obvious that you shouldn't.
As for an actual 'lock' button, hopefully, we'll see that in a future release.
Personally, I wish I could lock Reference layers. To keep artists from animating the Reference layers, I append the title with REF_[layer name] and then I color code the layer red. This doesn't prevent someone from editing the layer but it helps make it more obvious that you shouldn't.
As for an actual 'lock' button, hopefully, we'll see that in a future release.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How to I lock a layer?
Here's a menu script that locks layers. This works for all selected layers and will toggle the locked state.
https://dl.dropboxusercontent.com/s/di9 ... r.zip?dl=0
https://dl.dropboxusercontent.com/s/di9 ... r.zip?dl=0
Last edited by synthsin75 on Thu Jan 20, 2022 8:00 pm, edited 2 times in total.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How to I lock a layer?
Thanks! I'll give it a shot on my personal setup.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How to I lock a layer?
Oh Awesome Wes!
Installing now.

Installing now.



Re: How to I lock a layer?
Ahh so ,I normally only want this when I want to re-time an entire document with messing up my particles.chucky wrote:Oh Awesome Wes!
Installing now.![]()
![]()
That means I run the re time script, which overrides the syn script.
Is there a way to fix that?
Also is there a way to identify the layers that are locked visually?
Oh here's a couple of icons.


They look a little invisible here, I have done them in the Moho12 style, may need a line in the script to get the highlights to work, I don't know about that stuff.
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How to I lock a layer?
Hey Chucky, are you talking about Animation>Rescale Keyframes? If so, I doubt they wired that up to respect locked layers, and there's no way for a script to stop it.
This version uses your colorized icon (and works so much better as a button...I'd been using it as a menu script). I've also made it to where it will add "(LOCKED)" on the end of your layer names when locked. Let me know if it would work better at the beginning of the layer name (or maybe something shorter, like "(X)" or something).
https://www.dropbox.com/s/di9qqlq4mho4k ... r.zip?dl=0
This version uses your colorized icon (and works so much better as a button...I'd been using it as a menu script). I've also made it to where it will add "(LOCKED)" on the end of your layer names when locked. Let me know if it would work better at the beginning of the layer name (or maybe something shorter, like "(X)" or something).
https://www.dropbox.com/s/di9qqlq4mho4k ... r.zip?dl=0
Last edited by synthsin75 on Mon Jun 05, 2017 12:26 am, edited 1 time in total.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How to I lock a layer?
OH that works great!
I love the rename trick, nice one!
I will definitely keep this..
I had an idea about the retime menu script.
Maybe that could be modified to ignore layers with LOCKED in the name?
Just an idea.
I get caught with that all the time.
Just a few days ago I was working on the Retro Space Pack and needed to add some seconds at the start.
I applied the script and kept animating only to realise later on that (NOOO!) did it again and all my particles animations were stretched and I had to waste valuable time manually fixing all those layer's animations.
I actually wish that script had an 'ignore particles' setting but a if it could work with your locked button that would be awesome.
I love the rename trick, nice one!
I will definitely keep this..
I had an idea about the retime menu script.
Maybe that could be modified to ignore layers with LOCKED in the name?
Just an idea.
I get caught with that all the time.
Just a few days ago I was working on the Retro Space Pack and needed to add some seconds at the start.
I applied the script and kept animating only to realise later on that (NOOO!) did it again and all my particles animations were stretched and I had to waste valuable time manually fixing all those layer's animations.
I actually wish that script had an 'ignore particles' setting but a if it could work with your locked button that would be awesome.
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How to I lock a layer?
Animation>Rescale Keyframes is not a script, it is hard-coded, so it can't be modded. That would have to be done by the devs, so you might want to report it.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How to I lock a layer?
Yeah I did do a that while back ( I think) I'll check that now.synthsin75 wrote:Animation>Rescale Keyframes is not a script, it is hard-coded, so it can't be modded. That would have to be done by the devs, so you might want to report it.

- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How to I lock a layer?
I've updated this script so that you cannot even select locked layers after frame zero:
https://www.dropbox.com/s/di9qqlq4mho4k ... r.zip?dl=0
https://www.dropbox.com/s/di9qqlq4mho4k ... r.zip?dl=0
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How to I lock a layer?
Cool! Thanks Wes.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- striker2311
- Posts: 226
- Joined: Wed Aug 26, 2020 3:55 pm
Re: How to I lock a layer?
Thanks synthsin I'll try toosynthsin75 wrote: ↑Fri Feb 08, 2019 7:24 pm I've updated this script so that you cannot even select locked layers after frame zero:
https://www.dropbox.com/s/di9qqlq4mho4k ... r.zip?dl=0
Re: How to I lock a layer?
HeHe .. I made a small hack to this a while ago, to include a lock symbol on the locked layer.


Code: Select all
function Syn_LockLayer:Run(moho)
local lock_prefix = "🔒 " -- len == 5
for i=0, moho.document:CountSelectedLayers()-1 do
local layer = moho.document:GetSelectedLayer(i)
layer:SetLocked(not layer:IsLocked())
local name = layer:Name()
if (layer:IsLocked()) then
layer:SetName(lock_prefix .. name)
else
if (name:sub(1,5) == lock_prefix) then
layer:SetName(name:sub(6))
end
end
end
end
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How to I lock a layer?
WT?! What text editor are you using that can handle emojis, and since when does Lua interpret them?!SimplSam wrote: ↑Sat Jun 26, 2021 6:52 am HeHe .. I made a small hack to this a while ago, to include a lock symbol on the locked layer.
Code: Select all
function Syn_LockLayer:Run(moho) local lock_prefix = "🔒 " -- len == 5 for i=0, moho.document:CountSelectedLayers()-1 do local layer = moho.document:GetSelectedLayer(i) layer:SetLocked(not layer:IsLocked()) local name = layer:Name() if (layer:IsLocked()) then layer:SetName(lock_prefix .. name) else if (name:sub(1,5) == lock_prefix) then layer:SetName(name:sub(6)) end end end end
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/