Page 1 of 1

A easier way to reveal all the key frames set in a complex character

Posted: Fri Mar 29, 2024 8:35 am
by peng
i always find shifting key frames very toublesome especually there are a lot of point aniamtion and switch layer key frames set on sub layers of a complex character. I have been using a plugin to review all the layers that have keyframes set but it still very troublesome becasue you have to check each layer in order to show the key frames on the timeline, and you have to un check them to make the key frames disappear.

If you know a easier way to do this? thank you in advance. :)

Re: A easier way to reveal all the key frames set in a complex character

Posted: Fri Mar 29, 2024 9:57 am
by Lukas
Are you currently using LK_ToggleKeysFilter per chance?

By adding two lines it would show all filtered layers on timeline:

Code: Select all

...
	layer:SetShownOnTimeline(true)
...
	layer:SetShownOnTimeline(true)
...
Of course with multiple characters this is not a great solution. I've got the code for that too somewhere, but don't have the time to dig it up atm.

Adding the two lines like this:

Code: Select all

-- *** ALTERED VERSION ***
-- See: https://www.lostmarble.com/forum/viewtopic.php?t=36921
-- *** ALTERED VERSION *** 

-- **************************************************
-- 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)
				layer:SetShownOnTimeline(true)
			else
				FO_Utilities:RemoveTag(FO_Utilities.keysTag, layer, moho)
				layer:SetShownOnTimeline(false)
			end
		end
	else
		for i = 1, #layers do
			local layer = layers[i]	
			FO_Utilities:RemoveTag(FO_Utilities.keysTag, layer, moho)
		end
	end
end

Re: A easier way to reveal all the key frames set in a complex character

Posted: Fri Jul 12, 2024 9:08 pm
by JoelMayer
Lukas wrote: Fri Mar 29, 2024 9:57 am Are you currently using LK_ToggleKeysFilter per chance?

By adding two lines it would show all filtered layers on timeline:

Code: Select all

...
	layer:SetShownOnTimeline(true)
...
	layer:SetShownOnTimeline(true)
...
Of course with multiple characters this is not a great solution. I've got the code for that too somewhere, but don't have the time to dig it up atm.

Adding the two lines like this:

Code: Select all

-- *** ALTERED VERSION ***
-- See: https://www.lostmarble.com/forum/viewtopic.php?t=36921
-- *** ALTERED VERSION *** 

-- **************************************************
-- 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)
				layer:SetShownOnTimeline(true)
			else
				FO_Utilities:RemoveTag(FO_Utilities.keysTag, layer, moho)
				layer:SetShownOnTimeline(false)
			end
		end
	else
		for i = 1, #layers do
			local layer = layers[i]	
			FO_Utilities:RemoveTag(FO_Utilities.keysTag, layer, moho)
		end
	end
end
Hi Lukas, sorry to dig up this ol' thread but i just wanted to ask, what line of code i would have to add to REMOVE all the Timeline Visibility again when switching the tags off :D

Basically with your addition it almost does what i want, it shows the stuff on the timeline automatically but when i press it again it keeps the little checkmarks of all the layers. Just thought i'd ask :D Thank you!

Re: A easier way to reveal all the key frames set in a complex character

Posted: Mon Jul 15, 2024 10:39 am
by martin_mrt
Hello there,
did you find a solution yet? Im about to do an animation with a lot of point animated parts so im very curious to optimize this workflow. :)

Re: A easier way to reveal all the key frames set in a complex character

Posted: Mon Jul 15, 2024 1:29 pm
by Daxel
With this script tool by A. Evseeva, you can do many things, and one of them is to show all animated layers in the timeline.

https://mohoscripts.com/script/ae_keytools

To do that, use the buttons: V v X

V: shows all the animated layers in the timeline.
v: shows only those animated after frame 1
X: don't show any layer in the timeline

Some features of the tool may not work correctly because it is a little bit old, but those 3 buttons work perfectly, I use them all the time.

Re: A easier way to reveal all the key frames set in a complex character

Posted: Tue Jul 16, 2024 7:39 am
by JoelMayer
Yea i have the Keytool. It's nice and all but it requires two clicks instead of one OR instead of one shortcut to show me the stuff ;)