vvvv-custom-nodes
Writing Custom Nodes for vvvv gamma
What [ProcessNode] actually does (and what it does NOT do)
Important reality check. vvvv imports every public class, struct, enum, method, and property from the assembly's configured namespaces — [ProcessNode] does NOT control whether a class becomes a node. A plain public class Foo { public int Bar(int x) => x; } will appear in the node browser exactly the same way as one decorated with [ProcessNode]. The attribute affects how the runtime treats the class, not whether it gets imported.
What [ProcessNode] DOES:
- Tells vvvv "this is a stateful node — keep ONE instance alive per node in the patch and call its
Update()method each frame". - Lets you set
Name = "..."(rename for the node browser),Category = "..."(override the assembly's category), andHasStateOutput = true(expose the instance as an output pin). - Engages live reload,
IDisposablecleanup, and theNodeContextconstructor injection.
What [ProcessNode] does NOT do:
- It does NOT make a class visible to vvvv. Visibility comes from the C#
publicaccess modifier plus an[assembly: ImportAsIs/ImportNamespace/ImportType]attribute. See vvvv-node-libraries for the import rules. - It does NOT hide internal helpers. If a helper is
publicand its namespace is imported, it's a node. To hide one: make itinternal(removes it from VL entirely), or keep it public and tag it[Smell(SymbolSmell.Internal)]/[Smell(SymbolSmell.Hidden)](stays usable as a pin type, just isn't browsable). See advanced.md → Smell Attribute. - It does NOT change pin generation. Pin generation is driven by the
Update()method signature for[ProcessNode]classes, and by public method/property signatures for non-[ProcessNode]classes.
When to use [ProcessNode]: the class needs frame-by-frame updates, persistent state between frames, or IDisposable cleanup. When to skip [ProcessNode]: stateless utility classes, value types, static helper methods — leaving the attribute off avoids the per-frame Update() ceremony, and the public methods become operation nodes automatically.