Skip to main content

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

tdp_touchutilcollection-0.7.3.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tdp_touchutilcollection-0.7.3-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file tdp_touchutilcollection-0.7.3.tar.gz.

File metadata

File hashes

Hashes for tdp_touchutilcollection-0.7.3.tar.gz
Algorithm Hash digest
SHA256 be7340e0eaa73f5d9e79a992c7eb552c3e007afff1729647dcf3c0cd36f58196
MD5 1109953b6eecadf2039125eb20731f5c
BLAKE2b-256 003d526aca5e38c61e3a2c956bf17a37b8d3cc7b053168e6994680e27bff5805

See more details on using hashes here.

File details

Details for the file tdp_touchutilcollection-0.7.3-py3-none-any.whl.

File metadata

File hashes

Hashes for tdp_touchutilcollection-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d489ad463b34def75fa2f3c6bc0a04d0e4e0ca27aba613b9651cbd01646866f4
MD5 8b75b741759081f36e7c1575cfa00ddf
BLAKE2b-256 99afd7183bc745ecbee79868e7843c7c455b67adde982fa52e723594c466c47d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page