Is it possible to add a button outside of a panel, e.g. in the user-preferences?
Say I want to add a new addon category in the addon list, via an addon:
Is this possible? How?
Is it possible to add a button outside of a panel, e.g. in the user-preferences?
Say I want to add a new addon category in the addon list, via an addon:
Is this possible? How?
As explained in answer to your earlier question, items can be added to existing panels and menus by appending a function to the existing class that draws the new additions you want to add.
While most buttons in the interface represent operators that will be run when the button is clicked, the item you are pointing at above is not an operator. When you get several buttons attached together that represent a choice of multiple values they are representing an enumerated property.
Based on the code that defines the property you can alter the displayed addon options with the following. Unfortunately with enumerated values you will often find that other code changes would need to be made to handle any new values you want to add, meaning they are often not an easy change.
bpy.types.WindowManager.addon_support = bpy.props.EnumProperty(
items=[('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"),
('NEW', "New stuff", "New stuff here"),
],
name="Support",
description="Display support level",
default={'OFFICIAL', 'COMMUNITY'},
options={'ENUM_FLAG'},
)
In contrast the enumerated values for the addon categories listed under the supported levels is a dynamic list and you only need to add a new category to your addon's bl_info property to have it added to the list.
bl_info = {
"name": "My addon",
"category": "Special addons",
}