Image
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "LK_ToggleKeysFilter"

-- **************************************************
-- General information about this script
-- **************************************************

LK_ToggleKeysFilter = {}

function LK_ToggleKeysFilter:ColorizeIcon()
	return true
end

function LK_ToggleKeysFilter:Name()
	return "Toggle 'keys' filter"
end

function LK_ToggleKeysFilter:Version()
	return "0.2"
end

function LK_ToggleKeysFilter:IsBeginnerScript()
	return true
end

function LK_ToggleKeysFilter:Description()
	return "Toggle 'keys' filter in Layer Panel"
end

function LK_ToggleKeysFilter:Creator()
	return "Lukas Krepel"
end

function LK_ToggleKeysFilter:UILabel()
	return "Toggle 'keys' filter in Layer Panel"
end

-- **************************************************
-- The guts of this script
-- **************************************************

function LK_ToggleKeysFilter:IsEnabled(moho)
	return true
end

function LK_ToggleKeysFilter:IsRelevant(moho)
	if MohoMode ~= nil then
		if not MohoMode.visibility then
			return false
		end
	end
	return true
end

function LK_ToggleKeysFilter:Run(moho)
	FO_Utilities:FilterTag(FO_Utilities.keysTag, false, moho)
	local layers = FO_Utilities:AllLayers(moho)
	if moho:LayersWindowGetSearchContextValue() == FO_Utilities.keysTag then
		for i = 1, #layers do
			local layer = layers[i]
			if FO_Utilities:LayerIsAnimated(moho, layer) then
				FO_Utilities:AddTag(FO_Utilities.keysTag, layer, moho)
			else
				FO_Utilities:RemoveTag(FO_Utilities.keysTag, layer, moho)
			end
		end
	else
		for i = 1, #layers do
			local layer = layers[i]	
			FO_Utilities:RemoveTag(FO_Utilities.keysTag, layer, moho)
		end
	end
end

Icon
Toggle Keys Filter
Listed

Author: Lukas View Script
Script type: Button/Menu

Uploaded: May 23 2023, 09:18

Last modified: Sep 05 2023, 12:56

Script Version: 0.2

Filters layer panel by layers that have keyframes on them
Click the button to filter the layers-panel by keyed (it temporarily adds a "keys" tag to layers that have been animated). Click the button again, to remove the filter (and temporary tags) and show all layers again.

Installation Options:

This script, and all other scripts on this site are distributed as free software under the GNU General Public License 3.0 or later.
Downloads count: 780