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

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

Moderators: Víctor Paredes, Belgarath, slowtiger

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

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

Post 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. :)
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

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

Post 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
Post Reply