Skip to content

Instantly share code, notes, and snippets.

View EnviralDesign's full-sized avatar

LUCAS M MORGAN EnviralDesign

View GitHub Profile
@EnviralDesign
EnviralDesign / TraceFunctionCall.py
Created March 2, 2022 22:24
trace function call stack trace python
'''
I wrote this function because I kept running into the issue of having an
extension function or otherwise in TD be called, but not be sure who was calling it or from where.
This function will give you a full read out of the entire chain of functions that calls this function.
It will format the output to be easily readable as well.
--------------------------------------------------------------------------------------------------------------------
0) /Cedars_Workshop/geo_WORKSHOP_ANIMATED/SaxaphoneBlowup/datexec_trigger_state_callbacks : 20 : onCellChange()
1) /Cedars_Workshop/geo_WORKSHOP_ANIMATED/interaction_status_callback4 : 32 : <module>()
2) /Cedars_Workshop/Project : 23 : TraceFunctionCall()
--------------------------------------------------------------------------------------------------------------------
@EnviralDesign
EnviralDesign / print_libraries.py
Last active March 2, 2022 22:22
prints the installed python packages pythonically and not via pip/cmd
# prints the installed python packages pythonically and not via pip/cmd
try:
del sys.modules['pkg_resources']
except AttributeError:
pass
import pkg_resources
for resource in pkg_resources.working_set:
print( resource )
@EnviralDesign
EnviralDesign / Ffprobe() TD
Created October 12, 2021 22:24
Ffprobe for TouchDesigner
import os
import subprocess
import json
def Ffprobe(file_path, quiet=True):
'''
this function given a valid file path, uses ffprobe to scan the file, and return a lot of data about it.
I'm not entirely sure why this works, because ffprobe is not in my system path in windows generally...
the only guess is that TouchDesigner has this bundled in with it's application, and thus python finds it
via pythons path.. maybe.