← All ideas
  • Published 24 Nov 2024

Python API: Add an auto-increased register number to the panel class when an add-on registers it.

We noticed that the initial place order of the panels is mainly decided by the registering order and the property bl_order. Since a lot of add-on devs don't use the property bl_order, then the initial place order is actually decided by the registering order.

That's fine for an add-on. But when we need to develop an add-on to manage the panels, we get a problem sorting them to make them almost the same as the registering order. In the panels-manage add-on, when we get a dozen panels of a category, we need to change some properties (for example bl_category) of the panels, to sort the panels, and then unregister/register the panels. For now, we can only sort them by generation (using the property bl_parent_id), and it is impossible to sort them by the registering order because of the lack of initial registering order info.

We need to sort them by generation and the initial registering order. Then we can get the same place order of the panels as the initial place order. Otherwise, the place order of the panels will be messed up when we update the panels of a category. It's OK if there are only two or three panels, and users can drag and drop them. If there are more, it will be a cumbersome task for users.

So we advise giving an auto-increased register number to the panel class when an add-on registers it. The name can be bl_register_number, or bl_register_no, or whatever.

100%

Development Status: Open

Upvote 2 Downvote 0
conyedit
24 Nov 2024

0 Comments