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

ScriptName = "HS_ToggleFBF"

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

HS_ToggleFBF = {}

function HS_ToggleFBF:Name()
	return "Toggle FBF"
end

function HS_ToggleFBF:Version()
	return "1.00c"
end


function HS_ToggleFBF:Description()
	return "Toggle between FBF and Switch"
end


function HS_ToggleFBF:Creator()
	return "Hayasidist"
end

function HS_ToggleFBF:UILabel()
	return self:Name() .. " version " .. self:Version()
end


function HS_ToggleFBF:ColorizeIcon()
	return true
end


-- **************************************************
-- Recurring values and prefs
-- **************************************************

-- local thisUUT = "B"



-- **************************************************
-- Enabled / Relevant
-- **************************************************

function HS_ToggleFBF:IsEnabled(moho)
	return true 
end

function HS_ToggleFBF:IsRelevant(moho)
	return moho.layer:LayerType() == MOHO.LT_SWITCH
end


-- **************************************************
--	utility subroutines
-- **************************************************



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



function HS_ToggleFBF:Run(moho)

--	HS_Test_harness:tracePrint (thisUUT, "Run", self:Name(), self:Version())
	local layer = moho:LayerAsSwitch(moho.layer)
	if not layer then 
		return false
	end

	layer:SetFBFLayer(not layer:IsFBFLayer())
	layer:Expand(not layer:IsFBFLayer())
	layer:SetShownOnTimeline(not layer:IsFBFLayer())
	return true


end


HS Toggle FBF / Switch layer
Listed

Script type: Button/Menu

Uploaded: Jun 15 2024, 12:16

Script Version: 1.00c

Toggle a switch layer between "pure" switch and frame-by-frame drawing
In Moho, Frame-By-Frame (FBF) animation is supported by adding functionality to a basic Switch group.

In version 14.0, the ability to gain direct access to individual layers in a switch group that is in use for FBF drawing was removed. In order to access individual layers, it is necessary to turn off the FBF functionality and this is achievable from the UI by using a checkbox in the layer settings window.

This tool provides a one-click solution to toggling between FBF-mode and Switch-mode.

It does not check which Moho version is in use, and so will fail on versions before 12.

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: 130