Auto Set reference layer or group ignore layer selector

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
peng
Posts: 57
Joined: Mon Oct 18, 2021 3:13 am

Auto Set reference layer or group ignore layer selector

Post by peng »

There is a problem where i always accidentally select and manipulate the reference layer using the layer selector, which breaks the sync without knowing. it would be great to make the reference layer automatically ignored by the layer selector because the fundamental reason for reference layer is to use the base layer to drive its movements.
User avatar
Greenlaw
Posts: 10395
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Auto Set reference layer or group ignore layer selector

Post by Greenlaw »

Some tips:

Set the Reference Layer to Ignored By Layer Selector. This should prevent selecting the layer from the Working Area.

If the problem is that you're selecting the layer from the Layers Window, set the layer to a bright color (like red,) and add the words REFERENCE in front of the layer name. This discourages me from selecting the layer.

If this is still a problem, consider using Synthsin75's Lock Layer script.

Hope this helps.
Last edited by Greenlaw on Wed Jan 15, 2025 6:19 am, edited 1 time in total.
peng
Posts: 57
Joined: Mon Oct 18, 2021 3:13 am

Re: Auto Set reference layer or group ignore layer selector

Post by peng »

Thank you Greenlaw, but i still wish the reference layer when created is auto set to be ignored by layer selector, this will prevent people from selecting the layer from the main workarea. A small improvement but will help streamline the work process by a big mile. Wonder if there is a way for me to suggest it to the developers :)
User avatar
Greenlaw
Posts: 10395
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Auto Set reference layer or group ignore layer selector

Post by Greenlaw »

Yeah, I agree...having Ignored By Layer Selector automatically enabled for Reference layers could be a useful option.
User avatar
SimplSam
Posts: 1218
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Auto Set reference layer or group ignore layer selector

Post by SimplSam »

Working from the answers you received the last time you raised the subject: is there a way to auto set the reference layer ignored by the layer selector?

To do this automatically, you can do it with a script tool. A script of this nature has been posted to mohoscripts.com: https://mohoscripts.com/script/ss_create_reference

The guts of the script...

Code: Select all

local thisLayer = moho.layer                           -- Get the current layer
local refLayer  = moho:DuplicateLayer(thisLayer, true) -- Create the Reference Layer
refLayer:SetName("REF " .. thisLayer:Name())           -- Set name with Prefix
refLayer:SetIgnoredByLayerPicker(true)                 -- Set Ignore Layer selector
refLayer:SetLabelColor(01)                             -- Set Layer Color (01 == Red)
moho:UpdateUI()                                        -- Refresh the Layers Display
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
User avatar
Greenlaw
Posts: 10395
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Auto Set reference layer or group ignore layer selector

Post by Greenlaw »

This script sounds very useful, SimplSam! I'll check it out later today.

Oh, and thanks for commenting the script. I made a New Year's resolution to get competant with Moho scripting, and every comment helps. :D
peng
Posts: 57
Joined: Mon Oct 18, 2021 3:13 am

Re: Auto Set reference layer or group ignore layer selector

Post by peng »

OMG, this is so helpful, thank you so much SimplSam for creating this script. I wish the creators can integrate this into their official moho release
User avatar
synthsin75
Posts: 10262
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Auto Set reference layer or group ignore layer selector

Post by synthsin75 »

Or if you want it fully automated, you can drop this code in the IsEnabled function of any tool in your custom content tool folder:

Code: Select all

	if moho.layer:IsReferencedLayer() and not moho.layer:IsIgnoredByLayerPicker() then
		moho.layer:SetIgnoredByLayerPicker(true)
	end
Post Reply