๐ฆ Rust plugin framework for TouchDesigner
https://github.com/tychedelia/td-rs.git
td-rs ๐จ๐ฉโ๐ป 2023.12000.
plugins/ and adding it to root Cargo.toml as a workspace
member.
A plugin's Cargo.toml should have the following properties:
name - The name of the plugin. This should be unique across all plugins.lib - The type of crate. This should be set to staticlib. The name of the lib should be the same as thepackage.name property, but with underscores instead of hyphens.
package.metadata.td-rs - The type should be set to the operator type, e.g. top, chop, sop, dat.td-rs-chop = { path = "../../../td-rs-chop" }. lib.rs file. For example, a chop plugin
would call chop_plugin!(PluginName). This macro will generate the necessary FFI code to register the plugin
with TouchDesigner.
See example plugins for reference. A good starting point can be just to copy an existing plugin.
python - Enable Python support. This can be used in combination with td-rs-derive-py to generate tracing - Enable tracing support using the tracing crate. Thistokio - Enable Tokio support. This can be used to spawn asynchronous tasks from the plugin from the sharedRUNTIME.
autocxx we generate a C++ interface or "bridge" to our Rust library, which is then compiled
into a C++ plugin that can be loaded in TouchDesigner.
cargo-xtask is used for the build framework. A justfile is also provided.
cargo install baconjust dev <name> or bacon dev -- <name>cargo-xtaskcargo xtask build $PLUGIN - Build the plugin for the current platform.cargo xtask install $PLUGIN - Install a built plugin to the TouchDesigner plugins directory.cargo xtask list-plugins - List all available plugins.C:\Program Files\Derivative\TouchDesigner).LIBCLANG_PATH environment variable to the path of the Clang DLL. This can be found in the Visual Studio
installation directory, e.g. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\bin.
x86_64-pc-windows-msvc target./Applications/TouchDesigner.app).