A collection of practical utilities for TouchDesigner.
Project description
TouchUtilCollection
A collection of (hopefully) useful python-functions, methods and other trinkets.
Install via PIP, UV, Conda or whatever you like.
Not all are isted in the readme, see this as a list of "highlights"
tdasync
Bring asyncio to TD in this minimal wrapper.
from touchutilcollection.tdasync import execute
from asyncio import sleep
async def coro( waittime ):
op("text1").text = "Starting Coro"
await sleep(waittime)
op("text1").text = "Done"
execute( coro(5) )
Powerfull with TauCetiTweener and the .Resolve() functionality.
Extension
Makes your live with extensions easier by allowing for autocreation of custompars.
from touchutilcollection.extensions import EnsureExtension, partypes, parfield, pargrouptypes, pargroupfield
class extExample(
EnsureExtension # Required
):
class par:
Foo = parfield(partypes.ParFloat)
Bar = parfield(partypes.ParFloat, page ="Different", min = 0, max = 10)
Baba = parfield(
partypes.ParMenu,
menuLabels=["Eins", "Zwei", "Drei" ],
menuNames=["1", "2", "3"],
bindExpr="op.Settings.par.Baba"
)
class parGroup:
Somergb = pargroupfield( pargrouptypes.ParGroupRGBA, size = 3, default = (2,2,2) )
def __init__(self, ownerComp) -> None:
super().__init__(ownerComp) # Also required
self.par.Foo.val = 23
self.parGroup.Somergb[0].val = 2 # access pars using index
self.parGroup.default = (1,2,3) # same members as pars, but as touples. size needs to be considered!
Ensure
Ensure existence of components without having to manualy create them (or even see them. )
Ensure Tox
Ensure the existence of the given TOX-COMP using a global op shortcut.
from touchutilcollection.ensure import ensure_global_tox
from TauCeti import Tweener
TweenerComp = ensure_global_tox( Tweener.ToxFile, "TAUCETI_TWEENER" )
Ensure TDP
Takes values from a TDP and applies the same Logic.
from touchutilcollection.ensure import ensure_global_tox
from TauCeti import Tweener
TweenerComp = ensure_global_tox( Tweener )
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tdp_touchutilcollection-0.7.0.tar.gz.
File metadata
- Download URL: tdp_touchutilcollection-0.7.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
316c1a3465c47707eaf2138b68fdb57705be03805de437a4e3c8065eef02d77e
|
|
| MD5 |
cada583be54cc6177379469f77bcb66d
|
|
| BLAKE2b-256 |
0bfd1b93238f803d20a0dd06d85c8034e4936d70871e4a2604ccdfd24b417431
|
File details
Details for the file tdp_touchutilcollection-0.7.0-py3-none-any.whl.
File metadata
- Download URL: tdp_touchutilcollection-0.7.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
defbd802e20e19f2e735eb041a4274826f68ed5989747adb01672e46ce44c5bf
|
|
| MD5 |
74a2860c4cf5a139d7391c04dad14999
|
|
| BLAKE2b-256 |
9b119addb1969b012ed68da74b4d00e3941c008c06232d4e8d1f8b2bd3635d26
|