Image
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************
ScriptName = "SS_FBFClearCopy"

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

SS_FBFClearCopy = {}

function SS_FBFClearCopy:Name()
    return 'FBF Clear Copy'
end

function SS_FBFClearCopy:Version()
    return '1.01 #5309'
end

function SS_FBFClearCopy:UILabel()
    return 'Clear Copy FBF Layer'
end

function SS_FBFClearCopy:Creator()
    return 'SimplSam'
end

function SS_FBFClearCopy:Description()
    return 'Clear Copy FBF Layer'
end

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

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

function SS_FBFClearCopy:IsEnabled(moho)
    return true
end

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

function SS_FBFClearCopy:Run(moho)
    local fbfLayer = moho:LayerAsSwitch(moho.layer)
    local newFBFLayer = moho:DuplicateLayer(fbfLayer, true)
    for i = 0, newFBFLayer:CountLayers() - 1 do
        local subLayer = newFBFLayer:Layer(i)
        newFBFLayer.fAlpha:SetValue(0, 1)
        if (subLayer:LayerType() == MOHO.LT_VECTOR) then
            -- subLayer:BreakLayerReference()
            moho:LayerAsVector(subLayer):Mesh():Clear()
        end
    end
end

Icon
SS - Clear Copy FBF Layer
Listed

Script type: Button/Menu

Uploaded: Sep 21 2023, 00:39

Last modified: Sep 21 2023, 03:53

Script Version: 1.01 #5309

Creates a cleared copy of the current FBF Layer. FBF Frames/Cels are maintained.
Creates a copy of the current Frame-by-Frame or Switch Layer - whilst clearing the content of child Vector Layers.
FBF Frames (Cels) or Switches are maintained.

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