← 返回
AI智能 中文

Vvvv Patching

Explains vvvv gamma visual programming patterns — dataflow, node connections, regions (ForEach/If/Switch/Repeat/Accumulator), channels for reactive data flow...
解释 vvvv gamma 可视化编程模式——数据流、节点连接、区域(ForEach/If/Switch/Repeat/Accumulator)以及用于响应式数据流的通道...
tebjan
AI智能 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 503
下载
💾 19
安装
1
版本
#latest

概述

vvvv Patching Patterns

Dataflow Basics

  • Left-to-right, top-to-bottom execution order
  • Links carry data between pads (input/output connection points)
  • Spreading — connecting a Spread to a single-value input auto-iterates the node
  • Every frame, the entire connected graph evaluates; disconnected subgraphs are skipped

Both visual patches and C# source projects operate in a live environment — edits take effect immediately while the program runs. Patch changes preserve node state; C# code changes trigger a node restart (Dispose → Constructor). You can adjust parameters, add connections, and restructure patches while seeing results in real-time.

When to Patch vs Write C#

| Patch | Code (C#) |

|---|---|

| Data flow routing, visual connections | Performance-critical algorithms |

| Prototyping and parameter tweaking | Complex state machines |

| UI composition and layout | .NET library interop |

| Simple transformations | Native resource management |

As a rule: patch the data flow, code the algorithms.

Regions

Regions are visual constructs that control execution flow:

| Region | Purpose | C# Equivalent |

|---|---|---|

| ForEach | Iterate over Spread elements | foreach loop |

| If | Conditional execution | if/else |

| Switch | Multi-branch selection | switch |

| Repeat | Loop N times | for loop |

| Accumulator | Running aggregation | Aggregate/Fold |

Process Nodes in Patches

Process nodes are the primary way to add state to patches:

  • They have a Create region (runs once) and an Update region (runs each frame)
  • Internal state persists between frames
  • Can contain sub-patches for complex logic

Channels — Reactive Data Flow

Channels provide two-way data binding:

  • IChannel — observable value container
  • .Value — read or write the current value
  • Channels persist state across sessions
  • Connect channels between nodes for reactive updates without explicit links

Event Handling

  • Bang — a one-frame true pulse (trigger)
  • Toggle — alternates between true and false
  • FrameDelay — delays a value by one frame (breaks circular dependencies)
  • Use Changed node to detect when a value changes between frames

Patch Organization

Naming Conventions

  • Use PascalCase for patch names and node names
  • Group related operations under a common category
  • Use descriptive names that indicate the operation (verb + noun)

Structure

  • Keep patches focused — one purpose per patch
  • Extract reusable logic into sub-patches
  • Use IOBox nodes for exposing parameters
  • Add Pad nodes to create input/output pins on the patch boundary

Common Anti-Patterns

  1. Circular dependencies — use FrameDelay to break cycles
  2. Too many nodes in one patch — extract sub-patches
  3. Polling instead of reacting — use Channels for reactive updates
  4. Ignoring Nil — always handle null/empty Spread inputs gracefully

For common patterns reference, see patterns.md.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 14:42 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 711 📥 243,740
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 834 📥 213,027
security-compliance

Vvvv Testing

tebjan
使用 VL.TestFramework 配合 NUnit 为 vvvv gamma 包和 C# 节点设置自动化测试(CI 就绪),供包作者测试 .vl 补丁
★ 0 📥 614