Pyblish Plugins Debugging

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.

Publisher’s Details tab

In the publisher UI, we have a Details tab where you can review the logs for each plugin individually. However, what if you’re looking for deeper insights? For example, understanding the changes in context or determining the execution time of the plugin…

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.

I spent time exploring it within AYON and created a new branch feature/add_pyblish_debug_stepper_to_exprimental_tools in my ayon-core fork.

Within this branch, I’ve included the Pyblish Debug Stepper as an experimental tool that can be accessed from any Host/DCC.
Additionally, I’ve implemented the necessary requirements for the tool to function properly.

You can view the changes only through this link:
develop ↔ feature/add_pyblish_debug_stepper_to_exprimental_tools

Feel Free to check my branch. and let me know what do you think of this awesome tool :wink:
Last but not least, here’s a demo from my branch:

Get Pyblish Debug Stepper

If you’re feeling uncertain about how to get it, don’t worry—I’ve been in your shoes before!
There are two methods available:

  • Copy the code directly from BigRoy’s gist.
  • Checkout my branch where everything is already set up for your convenience.

Copy from the gist

  1. First you’d need to implement a requirement for the tool. where you’d need to add a custom event pluginProcessedContext which passes result and context.
    The reason for that is the original pluginProcessed by pyblish doesn’t provide context.
  2. Go to Pyblish Debug Stepper.
  3. Copy code in the last comment in the script editor in your DCC.
  4. Run it.
  5. Trigger the validation or publish from the publisher UI.
  6. Finally, check the output step by step.

Checkout my branch

  1. In your ayon-core clone, add me as remote.
    git remote add MustafaJafar https://github.com/MustafaJafar/ayon-core.git
    
  2. Fetch my branch.
    git fetch MustafaJafar feature/add_pyblish_debug_stepper_to_exprimental_tools
    
  3. Check it out
    git checkout feature/add_pyblish_debug_stepper_to_exprimental_tools
    
  4. Create and upload core addon or mostly do nothing if you are using a dev bundle and already have your ayon-core clone path in your bundle.
  5. Follow my demo video above!

And Keep Tinkering! :wink:

1 Like

The required logic to make this easier has been merged into pyblish-base with Add 'context' key to 'result' dict by MustafaJafar · Pull Request #401 · pyblish/pyblish-base · GitHub which made its way into the 1.8.12 release of Pyblish: Release 1.8.12 · pyblish/pyblish-base · GitHub

It would be great to update the Pyblish dependency in AYON which would make this feature/tool just that - a tool, instead of requiring the other customizations.

1 Like