Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit multicam- add option with audio #3329

Open
knurrrrrrt opened this issue Mar 27, 2024 · 1 comment
Open

Commit multicam- add option with audio #3329

knurrrrrrt opened this issue Mar 27, 2024 · 1 comment
Assignees
Labels
feature request New feature or request
Milestone

Comments

@knurrrrrrt
Copy link

It would be great if there was a second option of commit multi-cam that attaches the clip with audio.

It would also be cool if the attached clip would be attached at the first video frame even if the playhead is not parked there.

@latenitefilms latenitefilms self-assigned this Mar 28, 2024
@latenitefilms latenitefilms added the feature request New feature or request label Mar 28, 2024
@latenitefilms latenitefilms added this to the 1.4.27 milestone Mar 28, 2024
@latenitefilms
Copy link
Contributor

Here's a workaround in the meantime:

local log   = require "hs.logger".new "matchframe"
local fcp   = require "cp.apple.finalcutpro"
local just  = require "cp.just"

local wait  = just.wait

fcp:selectMenu({"Mark", "Go to", "Range Start"})
wait(0.5)

--------------------------------------------------------------------------------
-- Store the originally-selected clips:
--------------------------------------------------------------------------------
local contents              = fcp.timeline.contents
local originalSelection     = contents:selectedClipsUI()
local menuBar               = fcp.menu

--------------------------------------------------------------------------------
-- If nothing is selected, select the top clip under the playhead:
--------------------------------------------------------------------------------
if not originalSelection or #originalSelection == 0 then
    local playheadClips = contents:playheadClipsUI(true)
    contents:selectClip(playheadClips[1])
elseif #originalSelection > 1 then
    log.ef("Commit Multicam: More than one clip is selected. Please select a single clip and try again.")
    playErrorSound()
    return
end

--------------------------------------------------------------------------------
-- Get Multicam Angle:
--------------------------------------------------------------------------------
local multicamAngle = cp.plugins("finalcutpro.timeline.matchframe").getMulticamAngleFromSelectedClip()
if not multicamAngle then
    log.ef("Commit Multicam: The selected clip is not a multicam clip.")
    playErrorSound()
    contents:selectClips(originalSelection)
    return
end

--------------------------------------------------------------------------------
-- Open in Angle Editor:
--------------------------------------------------------------------------------
if menuBar:isEnabled({"Clip", "Open in Angle Editor"}) then
    menuBar:selectMenu({"Clip", "Open in Angle Editor"})
else
    log.ef("Commit Multicam: Failed to open clip in Angle Editor.\n\nAre you sure the clip you have selected is a Multicam?")
    playErrorSound()
    return false
end

--------------------------------------------------------------------------------
-- Put focus back on the timeline:
--------------------------------------------------------------------------------
if menuBar:isEnabled({"Window", "Go To", "Timeline"}) then
    menuBar:selectMenu({"Window", "Go To", "Timeline"})
else
    log.ef("Commit Multicam: Unable to return to timeline.")
    playErrorSound()
    return false
end

--------------------------------------------------------------------------------
-- Ensure the playhead is visible:
--------------------------------------------------------------------------------
contents.playhead:show()

--------------------------------------------------------------------------------
-- Select the correct angle:
--------------------------------------------------------------------------------
contents:selectClipInAngle(multicamAngle)

--------------------------------------------------------------------------------
-- Fire off a bunch of menu items:
--------------------------------------------------------------------------------
wait(0.7)
fcp:selectMenu({"File", "Reveal in Browser"})
wait(0.7)
fcp:selectMenu({"Mark", "Set Range Start"})
wait(1.5)
fcp:selectMenu({"View", "Timeline History Back"})
wait(1.5)
fcp:selectMenu({"Window", "Go To", "Timeline"})
wait(0.5)
fcp:selectMenu({"Mark", "Set Range Start"})
wait(0.5)
fcp:selectMenu({"Edit", "Connect to Primary Storyline"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants