td-python

Write typed Python code for TouchDesigner using type hints and TD API conventions.

4|Updated Mar 1, 2024
One-click install
npx skills add https://github.com/cacheflowe/haxlib --skill td-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: td-python
Source: https://github.com/cacheflowe/haxlib/tree/main/.github/skills/td-python
Command: npx skills add https://github.com/cacheflowe/haxlib --skill td-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes and promotes best-practice Python coding within TouchDesigner projects, reducing debugging time and increasing maintainability.

Core Features & Use Cases

  • Typed TD code: Enforces Python type hints for clarity and IDE support.
  • TD API conventions: Documents and demonstrates safe usage of core TouchDesigner global objects (op, parent, project, ui, etc.).
  • Onboarding & reuse: Provides a consistent pattern for scripting new operators and components across TD projects.

Quick Start

Generate a minimal TouchDesigner Python snippet that uses type hints and the TD API (op) to list all children of a given operator, for example op('/project1/geo1').

Frequently Asked Questions about td-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Python type hints in TouchDesigner scripting?

Python type hints in TouchDesigner scripting improve code readability and IDE support by enforcing structured, typed code across operators and components. This approach standardizes TD API conventions for global objects like op and parent.

What's the best way to structure TouchDesigner Python code for collaboration?

Structuring TouchDesigner Python code with type hints and consistent TD API conventions increases maintainability and reduces debugging time. Standardized patterns for scripting operators ensure reliable onboarding and code reuse across TD projects.

Can I use Python type hints with TouchDesigner global objects like op and parent?

Yes, Python type hints work with TouchDesigner global objects like op and parent. Documenting and demonstrating safe usage of these TD API conventions ensures clear, typed code that enhances IDE support and project reliability.

How do I list child operators in a TouchDesigner Python script?

To list child operators in a TouchDesigner Python script, use the TD API op function with type hints, for example op('/project1/geo1'), to safely access and iterate through operator children.

Why does my TouchDesigner Python code lack IDE support and autocomplete?

TouchDesigner Python code lacks IDE support and autocomplete when type hints are missing. Applying typed Python best practices and documenting TD API global objects enables better IDE introspection and reduces coding errors.

Are there limitations to using Python type hints in TouchDesigner automation workflows?

Using Python type hints in TouchDesigner automation workflows has no inherent limitations for standard scripting. It requires frontmatter-driven metadata for runtime activation, ensuring typed code functions correctly across components and operators.