GIMP 2.99/ Python How to retrieve active drawable/layer?

I used to get my active drawable like so
drawable = drawables[0]
which worked fine until today’s flatpak update (now at commit 9ab4816).
It now throws this error:

drawable = drawables[0]
               ~~~~~~~~~^^^
IndexError: list index out of range

So how is it done correctly?

Could you maybe show more of the script?

I have uploaded the script here

error occurs in line 66

worked fine till today’s new flatpak version

Could you remove ~/.config/GIMP/2.99/pluginrc (for flatpak, it might be under ~/.var/app/org.gimp.GIMP/config/GIMP/2.99 instead) then start GIMP again and try your plug-in please? Thanks!

That did the trick!
Thank you.

You are welcome. This file is supposed to get re-generated either when a plug-in is changed or when the plug-in protocol’s version is bumped. Neither happened here, but we changed args in the parent procedure class.

Obviously such issue is not supposed to happen between 2 stable versions. It only did here because it’s in-betwen dev versions. So I’m going to let it as-is. :slight_smile:

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.