Hello awesome community and fellow developers,
Debugging is a key part of our everyday tasks, whether we’re troubleshooting a file in production or ironing out issues with a plugin during development.
1. Publisher’s Details tab
In the publisher UI, we have a Details tab where you can review the logs for each plugin individually. and you can always add as much log statements as you need.
However, You may find log statements quite limited if you’re looking for deeper insights. For example, understanding the changes in context or determining the execution time of the plugin…
2. Pyblish Debug Stepper
The Pyblish Debug Stepper, developed by @BigRoy, serves precisely this purpose!
It provides a Step-by-Step Debugging, enabling you to examine plugins one at a time. At each step, it shows the context and instances along with their data.
Here’s a quick demo
Here are some methods to get pyblish debug stepper.
Note: This tool requires pyblish version >= 1.8.12
ayon-dependencies-tool will get it for you automatically once you run it.
Here’s a snippet from the log
Method 1: Copy and Run
You can try it right away.
- Copy the code inside pyblish_debug_stepper.py to the script editor in your DCC and run it.
- Show the tool window by running inside the script editor.
window = DebugUI() window.show()
- Trigger the validation or publish from the publisher UI or from code.
- Finally, check the output step by step.
Method 2: AYON Experimental Tool
You can do that by checking out my PR Feature/add pyblish debug stepper to experimental tools #753
Where I’ve included the Pyblish Debug Stepper
as an experimental tool that can be accessed from any Host/DCC.
You can view the changes only through this link:
develop ↔ feature/add_pyblish_debug_stepper_to_exprimental_tools
- In terminal in your
ayon-core
clone:git remote add MustafaJafar https://github.com/MustafaJafar/ayon-core.git git fetch MustafaJafar feature/add_pyblish_debug_stepper_to_exprimental_tools git checkout feature/add_pyblish_debug_stepper_to_exprimental_tools
- Use
ayon-core
in dev mode OR create package addon and upload it. - Follow my demo video above!
Here’s the code snippet mentioned in the video: validate_from_code.py
3. Use Python Debuggers
This one is not much discussed and it has its own caveats.
More info about in comments.
And Keep Tinkering!