Skip to content

Instantly share code, notes, and snippets.

@thiskevinwang
Last active May 12, 2024 16:22
Show Gist options
  • Save thiskevinwang/df0bdf71e7be15cdd0a600d3f716e487 to your computer and use it in GitHub Desktop.
Save thiskevinwang/df0bdf71e7be15cdd0a600d3f716e487 to your computer and use it in GitHub Desktop.
FxPlug Development

CleanShot 2024-02-25 at 09 48 19@2x

Deveopment flow

Build plugin in Xcode

Note

Host applications (Motion/Final Cut) autodetect the plugin that was built

Create a new Motion project

https://developer.apple.com/documentation/professional_video_applications/fxplug/building_an_fxplug_plug-in_from_an_xcode_template#3374965

Apply the built plugin

CleanShot 2024-05-12 at 10 54 29@2x

Test plug-in's parameters

CleanShot 2024-05-12 at 10 55 50@2x

Convert project to generator

CleanShot 2024-02-25 at 10 39 15@2x

Save and publish:

CleanShot 2024-02-25 at 10 39 55@2x

Final cut autodetects the published Generator (or Effect/Title/Transition)

CleanShot 2024-02-25 at 10 42 13@2x

Logging?

After you build the Xcode project, there should be a process that you can tail logs for.

Assuming a plugin named FXPlug_my-plugin

Find PIDs via pgrep or Activity Monitor

homer:~ $ pgrep FXPlug
22485
22897

homer:~ $ log stream --process 22485 --process 22897
Filtering the log data using "processIdentifier == 22485 OR processIdentifier == 22897"
Timestamp                       Thread     Type        Activity             PID    TTL
2024-05-12 11:56:56.065051-0400 0x1a0c363  Activity    0xa4259c             22485  0    FXPlug_my-plugin: (RunningBoardServices) didChangeInheritances
2024-05-12 11:56:56.065184-0400 0x1a0c363  Default     0xa4259c             22485  0    FXPlug_my-plugin: (RunningBoardServices) [com.apple.runningboard:connection] Gained inheritances: {(
    <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:430-397-174112 0>
)}
2024-05-12 11:57:00.647883-0400 0x1a0cc51  Default     0xa4bda2             22897  0    FXPlug_my-plugin XPC Service: (FxPlug) Unable to perform selector:Selector for parameter ID: 2. It appears the plug-in does not implement this selector.

Tip

Below is a one-liner that gets all process logs that match process name "FXPlug"

Why? This is handy because your process name is stable, but the PID's are random.

homer:~ $ log stream --predicate "processIdentifier IN {$(pgrep FXPlug | xargs | tr ' ' ',')}"

Use log stream --process <PID>

CleanShot 2024-05-12 at 11 28 15@2x

@thiskevinwang
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment