I’ve been getting into Extensions lately, but one little issue keeps bugging me and I lack the experience to solve this efficiently.
Sometimes in the middle of developing and testing, one of the operators calling something from an extension gets an error td.Ext object has no attribute 'the_extension_name'.
To my best knowledge, this happens when the extension has a critical syntax mistake, so it fails to initialize altogether.
The Extension field in Component editor also becomes red like this:
How can I debug the an extension code like this? I am self thought coding amateur, usually making edits directly in TD or in a notepad++ window. Should I edit my code in something that has advanced debugging? How can I find where the error is in my extension code?
Always have a textport open when working with extensions. Python errors are reported there. You can open one with Alt-T but I prefer splitting the editor pane and having one pane operate as a dedicated textport. To do this, use the downward arrow at top-right to split panes and the downward triangle at top-left to set a pane to act as a textport.
Use the Re-Init Extensions parameter to see where it’s failing.
Use debug statements in your code to test/trace values. They work like print statements but have more information pertinent to TouchDesigner.
Thanks! This is really stupid on my part. I often use the textport, but occasionally just forget to check it since I also often prefer to read the error on the OPs info popup.
The errors in the Extension object were indeed listen in the textport.