FxPlug Rust Bindings
Rust authoring surface for FxPlug 4 FxTileableEffect plug-ins on macOS 12+.
The v0.1 public scope is intentionally narrow: one Rust tileable image effect per PlugInKit service. This crate is not a complete FxPlug SDK binding layer. The longer-term plan for fuller bindings is tracked in the roadmap.
The MVP uses Objective-C as the Apple runtime shim and Rust for plugin logic:
fxplug-sys: C-compatible ABI structs, constants, and the shared C header.fxplug: safe Rust trait/macro API for single tileable effects.examples/brightness-plugin: first plugin and acceptance fixture.examples/glitch-wgpu-plugin: glitch effect example with awgpuWGSL shader description and Rust CPU fallback for the current FxPlug bridge.Pluginplussrc/rust_bridge.*: Objective-C FxPlug/Metal/IOSurface shim.FxPlugRust.xcodeproj: committed Xcode build wrapper that emits a variant app bundle with an embedded FxPlug 4 PlugInKit service.
Rust API
Plugins implement TileableEffect and are exported declaratively:
use ;
;
register_plugin!;
The v0.1 surface covers properties, float/int/toggle parameters, typed parameter values, plugin state, destination/source tile rects, CPU RGBA32F rendering, raw Metal/IOSurface callback pointers, and a small Metal render plan used by the Objective-C helper.
register_plugins! remains as a single-plugin compatibility alias. Passing
multiple effect types is a compile error because the committed Objective-C
PlugInKit shim registers one FxTileableEffect class and dispatches plugin
index 0.
Build
Rust-only checks work on Linux and macOS:
On macOS, build the plugin bundle:
The default wrapper app is written to
build/Release/FxPlugRustBrightness.app. For local testing, remove any old
standalone copy from ~/Library/Plug-Ins/FxPlug, then register the FxPlug 4
service through PlugInKit:
|
You can also place the wrapper app in /Applications and launch it once so
Launch Services discovers the embedded service.
The default macOS build is universal (arm64 and x86_64) with
MACOSX_DEPLOYMENT_TARGET=12.0, so it can be tested on both Apple Silicon and
Intel Macs running macOS 12 or newer.
By default the wrapper links examples/brightness-plugin. To build the glitch
example instead, pass the Rust package and staticlib names through the build:
FXPLUG_RUST_PACKAGE=glitch-wgpu-plugin \
FXPLUG_RUST_LIB=fxplug_glitch_wgpu \
The glitch build writes a distinct app bundle,
build/Release/FxPlugRustGlitch.app, and a distinct PlugInKit service
identifier, com.bigblage.fxplugrust.glitch.service. If pluginkit -m -p FxPlug still shows com.bigblage.fxplugrust.brightness.service, you are
registering an older app bundle or a brightness build. Re-register the freshly
built
build/Release/FxPlugRustGlitch.app/Contents/PlugIns/FxPlugRust.pluginkit, or
replace /Applications/FxPlugRustGlitch.app with the new build before running
pluginkit -a. The (1.1) printed by pluginkit is the FxPlug service
protocol version from PlugInKit metadata, not the Rust effect version.
The dynamic FxPlug registration reads display name, description, and UUID from the linked Rust plugin descriptor, so the same Objective-C shim can host either example.
The plug-in service links FxPlug and PluginManager with runtime search paths for
Final Cut Pro, Motion, Compressor, and /Library/Frameworks. This lets the
service load the host-provided FxPlug runtime instead of requiring a separate
framework install in /Library/Frameworks.
SDK Artifacts
CI expects:
FxPlug.sdk_4.3.3-3d7c879c31ba.zip, containingFxPlug.frameworkandPluginManager.frameworkheaders plus.tbdlink stubs with macOS 11+ deployment metadata. The project builds withMACOSX_DEPLOYMENT_TARGET=12.0.FxPlug.framework-c0a7a1c76ef2.zipandPluginManager.framework-a39aecfa287b.zip, runtime framework archives from a Mac. CI validates that they are present but does not link against them.
If your licensed SDK is stored elsewhere, set FXPLUG_SDK_DIR to a directory
whose Library/Frameworks contains both frameworks, or set FXPLUG_SDK_ZIP
to an equivalent SDK archive.