Wednesday, 30 March 2022

Debug function call

I came across a useful python debugging library the other day that allows you to print where a function is being called from: 

from inspect import stack

def foo():
    print(stack()[1][1:4])

def bar():
    foo()
What this will do now is whenever foo() is called, it will also now spit out a message:
('name_of_file.py', line_number, function_calling_foo)
 
Or, as I call it in Maya's Script Editor:
('<maya console>', 6, 'bar') 

Brilliant for tracing nested funcs in a complex architecture!

Wednesday, 9 March 2022

Flowchart Website Tool

 Need a way to draft out a process/pipeline/tool?

This handy website lets you do so for free, and allows you to save/load to your device, google drive and other cloud platforms:

https://app.diagrams.net/

Pretty neat, thought I'd share!