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

-- **************************************************
-- Select all selected timeline channel keyframes
-- --------------------------------------------------
-- version:	01.00 MH12+ #5312
-- by: Sam Cogheil (SimplSam)
-- Licence & Warranty: None
--   Use/Reuse/Adapt Freely. Attribution appreciated
-- **************************************************

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

SS_SelectKeys = {}

function SS_SelectKeys:Name()
    return 'Select Keys'
end

function SS_SelectKeys:Version()
    return '1.0 #531208'
end

function SS_SelectKeys:UILabel()
    return 'Select Keys'
end

function SS_SelectKeys:Creator()
    return 'Sam Cogheil (SimplSam)'
end

function SS_SelectKeys:Description()
    return 'Select selected timeline channel keyframes'
end

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

function SS_SelectKeys:IsRelevant(moho)
    return true
end

function SS_SelectKeys:IsEnabled(moho)
    return true
end

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

function SS_SelectKeys:Run(moho)
    local mohodoc = moho.document
    local chanInfo = MOHO.MohoLayerChannel:new_local()
    local timelineLayers = {}

    local function GetTimelineLayers(thisLayer)
        if (thisLayer:SecondarySelection() or thisLayer:IsShownOnTimeline()) then
            table.insert(timelineLayers, thisLayer)
        end
        if (thisLayer:IsGroupType()) then
            local groupLayer = moho:LayerAsGroup(thisLayer)
            for l = 0, groupLayer:CountLayers() - 1 do
                GetTimelineLayers(groupLayer:Layer(l))
            end
        end
    end

    for i = 0, mohodoc:CountLayers() - 1 do
        GetTimelineLayers(mohodoc:Layer(i))
    end

    for _, layer in ipairs(timelineLayers) do
        for i = 0, layer:CountChannels() - 1 do
            layer:GetChannelInfo(i, chanInfo)
            if (chanInfo.selectionBased) then
                for j = 0, chanInfo.subChannelCount - 1 do
                    local channel = layer:Channel(i, j, mohodoc)
                    if channel:Duration() > 0 then
                        for k = 0, channel:CountKeys() - 1 do
                            channel:SetKeySelectedByID(k, true)
                        end
                    end
                end
            end
        end
    end
end

Icon
SS - Select Keys
Listed

Script type: Button/Menu

Uploaded: Dec 08 2023, 20:33

Quickly select all active object property keyframes in the timeline
Provides one-click (or key) selection of all animation keyframes in the full-length of the timeline, for objects (Bones, Points, Shapes ...) that are currently selected on the canvas, and presented in the timeline (timeline visibility).

Works with:
- all selectable animatable object properties i.e. for selected Bones, Points, Shapes etc.
- multiple selected layer timelines (visible in timeline)
- split transformation dimensions
- multiple object & property key types simultaneously (i.e. Bone transforms and Shape style/effects)

Image

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