From 0c77d28c1dfe7031d6c8a0a84f8a79325bfb26e9 Mon Sep 17 00:00:00 2001 From: Chris Hocking Date: Thu, 31 Aug 2023 17:00:22 +1000 Subject: [PATCH] Added actions to Toggle Video Inspector Keyframes - Added Monogram actions to Toggle Video Inspector Keyframes. - Added Monogram actions for Video Inspector Distort controls. - Added action to toggle MotionVFX Title Animation Amount keyframe. - Added Monogram action to toggle MotionVFX Title Animation Amount keyframe. - Moved Monogram code out of Title plugin and into Monogram plugin. - Closes #2260 - Closes #3246 --- .../inspector/InspectorProperty.lua | 16 ++ src/extensions/languages/English_en.json | 1 + .../Final Cut Pro via CP.palette/inputs.json | 156 ++++++++++++++++++ .../signature.txt | 2 +- src/plugins/finalcutpro/inspector/title.lua | 112 +++++++------ src/plugins/finalcutpro/inspector/video.lua | 107 ++++++++++++ src/plugins/finalcutpro/monogram/init.lua | 44 +++++ 7 files changed, 387 insertions(+), 51 deletions(-) diff --git a/src/extensions/cp/apple/finalcutpro/inspector/InspectorProperty.lua b/src/extensions/cp/apple/finalcutpro/inspector/InspectorProperty.lua index 63d76fe3e..406a0e4b7 100644 --- a/src/extensions/cp/apple/finalcutpro/inspector/InspectorProperty.lua +++ b/src/extensions/cp/apple/finalcutpro/inspector/InspectorProperty.lua @@ -291,6 +291,22 @@ local function simple(labelKey, prepareFn, index) row.reset = Button(row, function() return childFromRight(row:children(), 1) end) + row.keyframe = Button(row, function() return childFromRight(row:children(), 2, Button.matches) end) + + function row.keyframe:addKeyframe() + local ui = self:UI() + if ui then + local f = ui:attributeValue("AXFrame") + if f then + local point = { + x = f.x + f.w - 5, + y = f.y + (f.h / 2) + } + tools.ninjaMouseClick(point) + end + end + end + if prepareFn then prepareFn(row) end diff --git a/src/extensions/languages/English_en.json b/src/extensions/languages/English_en.json index 4e9c69908..e50e57eee 100644 --- a/src/extensions/languages/English_en.json +++ b/src/extensions/languages/English_en.json @@ -2424,6 +2424,7 @@ "toggleControls": "Toggle Controls", "toggleDaVinciResolveControlSurfaceSupport": "Toggle DaVinci Resolve Control Surface Support", "toggleEffects": "Toggle Effects", + "toggleKeyframe": "Toggle Keyframe", "toggleOpacityFadeHandlesInVideoAnimationPopupOnSelectedClips": "Toggle Opacity Fade Handles in Video Animation Popup on Selected Clips", "toggleOpacityFadeHandlesInVideoAnimationPopupOnSelectedClipsDescription": "Due to a Final Cut Pro bug this doesn't work for clips in a Secondary Storyline", "toggleOverlaysWithCapsLock": "Toggle Overlays with Caps Lock", diff --git a/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/inputs.json b/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/inputs.json index 31b224edd..4425490e9 100644 --- a/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/inputs.json +++ b/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/inputs.json @@ -5500,5 +5500,161 @@ { "info": "Zoom the contents to fit the size of the Browser, Viewer, or Timeline", "name": "Command Set Shortcuts.View.Zoom to Fit" + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Bottom Left X", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Bottom Left Y", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Bottom Right X", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Bottom Right Y", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Top Right X", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Top Right Y", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Top Left X", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Adjusts the distort on the selected clip", + "name": "Video Inspector.Distort.Distort Top Left Y", + "range": [ + -5000, + 5000 + ], + "reset": 0, + "step": 1, + "stepMin": 0.1 + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Compositing.Opacity.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Position.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Position.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Rotation.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Scale All.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Scale X.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Scale Y.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Transform.Anchor.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Crop.Left.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Crop.Right.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Crop.Top.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Crop.Bottom.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Distort.Bottom Left.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Distort.Bottom Right.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Distort.Top Right.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Video Inspector", + "name": "Video Inspector.Distort.Top Left.Toggle Keyframe" + }, + { + "info": "Mouse clicks the Add/Remove Keyframe button in the Title Inspector", + "name": "Title Inspector.MotionVFX Title.Animation Amount.Toggle Keyframe" } ] \ No newline at end of file diff --git a/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/signature.txt b/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/signature.txt index 849485413..de26ba83a 100644 --- a/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/signature.txt +++ b/src/plugins/core/monogram/plugins/Final Cut Pro via CP.palette/signature.txt @@ -1 +1 @@ -GuJfvDxtBqHf8u0GN6pkbhwJydLCXJumfqT1Mvr3jFbpXOQRim2o8hepvIPI3WGowY+fDX+P7Vaw8uBfJ/uuvBWrnzZ83ZdZhvSurV0PaAkFhwQwclhwBxx4CyqPH9J0C64180G0YPrtMDscUTbiBGFSpJJ4rseSsBfWa42tYp9G1q8gERxBDEHewidBk6JtJJuLwEifnvykRSCn221PVQuTVejXs4iO7YJq2gnkcQ4wkhcI0UMWr4Bv6Zn1hfC1zpTonO91EhEiqV5yrMO10205dNngQD7fJwiJsqeVv3fCFJnZB3kkW0erRU0WzZUzAAbkHL1JvpKcphocvTWtdw== \ No newline at end of file +J3/5NFB5Sms5qDME3aOf1COWGQXF9WY6EEL3OoplAp9I0kDDODRK70IV9Ii3CSBJGqYIQZINdjvqXLXmgrrzWrC5+KCGypnTysDxGkac6bFITnHj10rqh4jOwl4nnymHp3urFRNgwZu21pgQK0tezyvoj3FO7H9CNoMf3pM91bvoqdtxLS37GMc9oRJo6VmJM4h5rHdInqijgI4DRSotpbeLNDVygUIN9E49rO/lMifUF87SQanKsy3yOR2/IBeD/dtht30WiOJjrS9C/0ThMwQCI7SrfU2lEs6mlCHmvFZysj49ePCWdHA/s/L2HY843fR57/2k9tiRC662wN92JA== \ No newline at end of file diff --git a/src/plugins/finalcutpro/inspector/title.lua b/src/plugins/finalcutpro/inspector/title.lua index 65033390c..d0a722da5 100644 --- a/src/plugins/finalcutpro/inspector/title.lua +++ b/src/plugins/finalcutpro/inspector/title.lua @@ -4,13 +4,14 @@ local require = require -local log = require "hs.logger".new "titleInspector" +--local log = require "hs.logger".new "titleInspector" local axutils = require "cp.ui.axutils" local deferred = require "cp.deferred" local fcp = require "cp.apple.finalcutpro" local tools = require "cp.tools" +local Button = require "cp.ui.Button" local Slider = require "cp.ui.Slider" local TextField = require "cp.ui.TextField" @@ -22,17 +23,11 @@ local plugin = { group = "finalcutpro", dependencies = { ["finalcutpro.commands"] = "fcpxCmds", - ["core.monogram.manager"] = "manager", } } local mod = {} --- DEFER_VALUE -> number --- Constant --- How long we should defer all the update functions. -local DEFER_VALUE = 0.01 - --- plugins.finalcutpro.inspector.title.motionVFXAnimationTextField -> cp.ui.TextField --- Field --- MotionVFX Title Animation Amount Text Field @@ -58,47 +53,65 @@ mod.motionVFXAnimationAmountSlider = Slider(fcp.inspector.title, function() return animationAmountSliderUI end) +--- plugins.finalcutpro.inspector.title.motionVFXAnimationAmountAddKeyframe -> cp.ui.Button +--- Field +--- MotionVFX Title Animation Amount Add Keyframe Button +mod.motionVFXAnimationAmountAddKeyframeButton = Button(fcp.inspector.title, function() + local title = fcp.inspector.title + local ui = title and title:UI() + local groupA = ui and axutils.childAtIndex(ui, 1) + local groupB = groupA and axutils.childAtIndex(groupA, 1) + local animationAmountSliderUI = groupB and axutils.childWithDescription(groupB, "animation amount add a keyframe") + return animationAmountSliderUI +end) + +--- plugins.finalcutpro.inspector.title.motionVFXAnimationAmountDeleteKeyframe -> cp.ui.Button +--- Field +--- MotionVFX Title Animation Amount Delete Keyframe Button +mod.motionVFXAnimationAmountDeleteKeyframeButton = Button(fcp.inspector.title, function() + local title = fcp.inspector.title + local ui = title and title:UI() + local groupA = ui and axutils.childAtIndex(ui, 1) + local groupB = groupA and axutils.childAtIndex(groupA, 1) + local animationAmountSliderUI = groupB and axutils.childWithDescription(groupB, "animation amount delete keyframe") + return animationAmountSliderUI +end) + +--- plugins.finalcutpro.inspector.title.motionVFXAnimationAmountAnimationButton -> cp.ui.Button +--- Field +--- MotionVFX Title Animation Amount Keyframe Button +mod.motionVFXAnimationAmountKeyframeButton = Button(fcp.inspector.title, function() + local title = fcp.inspector.title + local ui = title and title:UI() + local groupA = ui and axutils.childAtIndex(ui, 1) + local groupB = groupA and axutils.childAtIndex(groupA, 1) + local animationAmountSliderUI = groupB and axutils.childWithDescription(groupB, "animation amount animation button") + return animationAmountSliderUI +end) + -- Mirror the Slider to the Text Box, otherwise it doesn't update correctly: mod.motionVFXAnimationAmountSlider.value:mirror(mod.motionVFXAnimationTextField.value) --- makeSliderHandler(finderFn) -> function --- Function --- Creates a 'handler' for slider controls, applying them to the slider returned by the `finderFn` --- --- Parameters: --- * finderFn - a function that will return the slider to apply the value to. --- --- Returns: --- * a function that will receive the Monogram control metadata table and process it. -local function makeSliderHandler(finderFn) - local absolute - local shift = 0 - local slider = finderFn() - - local updateUI = deferred.new(DEFER_VALUE):action(function() - - if slider:isShowing() then - if absolute then - slider:value(absolute) - absolute = nil - else - local current = slider:value() - slider:value(current + shift) - shift = 0 - end - else - slider:show() - end - end) - - return function(data) - if data.operation == "+" then - local increment = data.params and data.params[1] - shift = shift + increment - updateUI() - elseif data.operation == "=" then - absolute = data.params and data.params[1] - updateUI() +--- plugins.finalcutpro.inspector.title.toggleMotionVFXAnimationAmountKeyframe() -> none +--- Function +--- Toggles the MotionVFX Title Animation Amount Keyframe button. +--- +--- Parameters: +--- * None +--- +--- Returns: +--- * None +function mod.toggleMotionVFXAnimationAmountKeyframe() + mod.motionVFXAnimationAmountAddKeyframeButton:show() + local ui = mod.motionVFXAnimationAmountKeyframeButton:UI() or mod.motionVFXAnimationAmountAddKeyframeButton:UI() or mod.motionVFXAnimationAmountDeleteKeyframeButton:UI() + if ui then + local f = ui:attributeValue("AXFrame") + if f then + local point = { + x = f.x + f.w - 5, + y = f.y + (f.h / 2) + } + tools.ninjaMouseClick(point) end end end @@ -149,11 +162,10 @@ function plugin.init(deps) end) :titled("MotionVFX Title - Animation Amount - Set to Zero") - -------------------------------------------------------------------------------- - -- MotionVFX - Title - Animation Amount - Monogram Slider: - -------------------------------------------------------------------------------- - local registerAction = deps.manager.registerAction - registerAction("Title Inspector.MotionVFX Title.Animation Amount", makeSliderHandler(function() return mod.motionVFXAnimationAmountSlider end)) + deps.fcpxCmds + :add("motionVFXAnimationAmountToggleKeyframe") + :whenActivated(mod.toggleMotionVFXAnimationAmountKeyframe) + :titled("MotionVFX Title - Animation Amount - Toggle Keyframe") return mod end diff --git a/src/plugins/finalcutpro/inspector/video.lua b/src/plugins/finalcutpro/inspector/video.lua index b79e7bc5f..73067e102 100644 --- a/src/plugins/finalcutpro/inspector/video.lua +++ b/src/plugins/finalcutpro/inspector/video.lua @@ -1292,6 +1292,113 @@ function plugin.init(deps) anchor:y(0) end) + -------------------------------------------------------------------------------- + -- Toggle Keyframes: + -------------------------------------------------------------------------------- + fcpxCmds:add("toggleKeyframeOpacity") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("opacity")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:compositing():opacity():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframePosition") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("position")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:transform():position():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeRotation") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("rotation")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:transform():rotation():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeScaleAll") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("scale") .. " - " .. i18n("all")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:transform():scaleAll():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeScaleX") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("scale") .. " - X") + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:transform():scaleX():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeScaleY") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("scale") .. " - Y") + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:transform():scaleY():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeAnchor") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("anchor")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:transform():anchor():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeCropLeft") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("crop") .. " - " .. i18n("left")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:crop():left():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeCropRight") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("crop") .. " - " .. i18n("right")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:crop():right():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeCropTop") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("crop") .. " - " .. i18n("top")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:crop():top():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeCropBottom") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("crop") .. " - " .. i18n("bottom")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:crop():bottom():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeDistortBottomLeft") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("distort") .. " - " .. i18n("bottom") .. " - " .. i18n("left")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:distort():bottomLeft():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeDistortBottomRight") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("distort") .. " - " .. i18n("bottom") .. " - " .. i18n("right")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:distort():bottomRight():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeDistortTopRight") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("distort") .. " - " .. i18n("top") .. " - " .. i18n("right")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:distort():topRight():show():keyframe():addKeyframe() + end) + + fcpxCmds:add("toggleKeyframeDistortTopLeft") + :titled(i18n("toggleKeyframe") .. " - " .. i18n("distort") .. " - " .. i18n("top") .. " - " .. i18n("left")) + :groupedBy("timeline") + :whenPressed(function() + fcp.inspector.video:distort():bottomRight():show():keyframe():addKeyframe() + end) end return plugin diff --git a/src/plugins/finalcutpro/monogram/init.lua b/src/plugins/finalcutpro/monogram/init.lua index 70735fa4d..53b4dd839 100644 --- a/src/plugins/finalcutpro/monogram/init.lua +++ b/src/plugins/finalcutpro/monogram/init.lua @@ -613,6 +613,25 @@ function mod._registerActions(manager) registerAction("Timeline.Zoom", makeTimelineZoomHandler()) registerAction("Timeline.Clip Height", makeTimelineClipHeightHandler()) + -------------------------------------------------------------------------------- + -- Toggle Keyframes: + -------------------------------------------------------------------------------- + registerAction("Video Inspector.Compositing.Opacity.Toggle Keyframe", function() fcp.inspector.video:compositing():opacity():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Transform.Position.Toggle Keyframe", function() fcp.inspector.video:transform():position():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Transform.Rotation.Toggle Keyframe", function() fcp.inspector.video:transform():rotation():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Transform.Scale All.Toggle Keyframe", function() fcp.inspector.video:transform():scaleAll():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Transform.Scale X.Toggle Keyframe", function() fcp.inspector.video:transform():scaleX():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Transform.Scale Y.Toggle Keyframe", function() fcp.inspector.video:transform():scaleY():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Transform.Anchor.Toggle Keyframe", function() fcp.inspector.video:transform():anchor():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Crop.Left.Toggle Keyframe", function() fcp.inspector.video:crop():left():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Crop.Right.Toggle Keyframe", function() fcp.inspector.video:crop():right():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Crop.Top.Toggle Keyframe", function() fcp.inspector.video:crop():top():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Crop.Bottom.Toggle Keyframe", function() fcp.inspector.video:crop():bottom():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Distort.Bottom Left.Toggle Keyframe", function() fcp.inspector.video:distort():bottomLeft():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Distort.Bottom Right.Toggle Keyframe", function() fcp.inspector.video:distort():bottomRight():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Distort.Top Right.Toggle Keyframe", function() fcp.inspector.video:distort():topRight():show():keyframe():addKeyframe() end) + registerAction("Video Inspector.Distort.Top Left.Toggle Keyframe", function() fcp.inspector.video:distort():topLeft():show():keyframe():addKeyframe() end) + -------------------------------------------------------------------------------- -- Colour Wheel Controls: -------------------------------------------------------------------------------- @@ -691,6 +710,19 @@ function mod._registerActions(manager) registerAction("Video Inspector.Crop.Crop Top", makeSliderHandler(function() return fcp.inspector.video.crop():top() end)) registerAction("Video Inspector.Crop.Crop Bottom", makeSliderHandler(function() return fcp.inspector.video.crop():bottom() end)) + registerAction("Video Inspector.Distort.Distort Bottom Left X", makeSliderHandler(function() return fcp.inspector.video.distort():bottomLeft().x end)) + registerAction("Video Inspector.Distort.Distort Bottom Left Y", makeSliderHandler(function() return fcp.inspector.video.distort():bottomLeft().y end)) + + registerAction("Video Inspector.Distort.Distort Bottom Right X", makeSliderHandler(function() return fcp.inspector.video.distort():bottomRight().x end)) + registerAction("Video Inspector.Distort.Distort Bottom Right Y", makeSliderHandler(function() return fcp.inspector.video.distort():bottomRight().y end)) + + registerAction("Video Inspector.Distort.Distort Top Right X", makeSliderHandler(function() return fcp.inspector.video.distort():topRight().x end)) + registerAction("Video Inspector.Distort.Distort Top Right Y", makeSliderHandler(function() return fcp.inspector.video.distort():topRight().y end)) + + registerAction("Video Inspector.Distort.Distort Top Left X", makeSliderHandler(function() return fcp.inspector.video.distort():topLeft().x end)) + registerAction("Video Inspector.Distort.Distort Top Left Y", makeSliderHandler(function() return fcp.inspector.video.distort():topLeft().y end)) + + for _, v in pairs(fcp.inspector.video.BLEND_MODES) do if v.flexoID then registerAction("Video Inspector.Compositing.Blend Mode." .. fcp:string(v.flexoID, "en"), makeFunctionHandler(function() fcp.inspector.video:compositing():blendMode():doSelectValue(fcp:string(v.flexoID)):Now() end)) @@ -1712,6 +1744,12 @@ function mod._registerActions(manager) registerAction("Command Set Shortcuts.General.Send IMF Package to Compressor", makeShortcutHandler(function() return "SendIMFPackageToCompressor" end)) registerAction("Command Set Shortcuts.Effects.Add Color Wheels Effect", makeShortcutHandler(function() return "AddColorWheelsEffect" end)) + -------------------------------------------------------------------------------- + -- MotionVFX - Title - Animation Amount - Monogram Actions: + -------------------------------------------------------------------------------- + registerAction("Title Inspector.MotionVFX Title.Animation Amount", makeSliderHandler(function() return mod.titleManager.motionVFXAnimationAmountSlider end)) + registerAction("Title Inspector.MotionVFX Title.Animation Amount.Toggle Keyframe", mod.titleManager.toggleMotionVFXAnimationAmountKeyframe) + end -- plugins.core.monogram.manager._buildMenuItems() -> none @@ -1766,6 +1804,7 @@ local plugin = { required = true, dependencies = { ["core.monogram.manager"] = "manager", + ["finalcutpro.inspector.title"] = "titleManager", } } @@ -1781,6 +1820,11 @@ function plugin.init(deps) local manager = deps.manager local registerPlugin = manager.registerPlugin + -------------------------------------------------------------------------------- + -- Link to Title Dependency: + -------------------------------------------------------------------------------- + mod.titleManager = deps.titleManager + -------------------------------------------------------------------------------- -- Register the plugin: --------------------------------------------------------------------------------