# How to create a sub-category or folder in T-Panel tab

I used to have a problem with the clattered tabs in my T-Panel, but not anymore since I discovered how to edit the code of a tab in the T-Panel (rightclick in any button of the tab contents and select "Edit Source") and finding the "bl_category" value in it and change it to create a new category or to move the item to an existing one. This works beautifully, but I have a problem; some addons have several components and I would like to group those in a "sub-category" or folder (I am not sure of the right term).

For example, I have organized all the addons into a number of tabs (see screenshot); including a Misc tab, where I include all the new addons that don't fall into any other category; in Misc I have the "Mesh Align Plus" add on which is made up of six quicktools entries; I would like to group those six entries into a single "Mesh Align Plus" category of its own within "Misc", creating a kind of folder.

Is that possible at all?

Sept

• nested collapsible layouts are - as far as I am aware - at the moment unsupported. You can only segment in tabs and panels currently. – aliasguru Aug 9 '16 at 19:54

The sections you are referring to that can be collapsed and expanded are called panels. You may have noticed that when you alter the addon you find the bl_category a few lines under a class definition that has Panel in brackets at the end of the line.

We have some control over the placement of panels (not 100%). The small dots to the right of the panel allow us to drag them up and down to get a different order and the order that we place them in gets saved with the rest of the interface settings. This means you need to enable the addons that you want, Save User Settings so that they are enabled on startup, then re-arrange the panels the way you want them and then File->Save Startup File so that the layout settings are used every time you start blender. You may also want to ensure the Load UI option under the File preferences is disabled so that your startup layout is used instead of the layout saved with the file.

To get more than that you will need to write your own addon. Yes you can copy the code of another addon, but the changes needed mean that you will need to re-structure the code again after any updates - so consider this option as your custom addon where someone else writes most of the code for you.

Each panel is defined by a class that is a subclass of bpy.types.Panel. The draw method of the panel class defines what is displayed inside the panel, you can take the contents of an existing panel's draw method and combine them into one panel that you have defined. For some panels you may also need some of the surrounding code that the panel relies on. As shown in this answer you can add a custom property and use that to show a disclosure triangle that can contain the items from another panel to get the "sub-folder" layout that you are looking for.

You can find an example addon here that provides the following panel.

• Thank you for your answer. But my question is, more specifically, if I can create sub-category within the Misc category in which to contain the several entries of a single addon. Regards, Sept – Dunno Aug 9 '16 at 13:45
• @Dunno - I have expanded the answer to include an example of making your own addon. – sambler Aug 10 '16 at 10:34
• Thanks a million, sambler; that helped a lot and certainly answered my question; and my apologies for posting in the answer, rather than in the comments, section. Sept – Dunno Aug 10 '16 at 19:43