Update Tab Addons to Choose tab name #48459

Closed
opened 2016-05-18 10:05:55 +02:00 by Brendon Murphy · 7 comments
Member

This task is spread out over several addons in release & contrib.

Purpose: To allow users to change which tabs the Addons appear in.

Fixes: It's a very common compliant that tabs get easily overcrowded & misused. This fixes that by allowing users to set up their own tab system or relocate addons to where they need them within the toolshelf.

Usage: Open Addons Preferences, Rename the current Tab name to one you choose or leave as default.

Code:
Using Align Tools in contrib as an example

## Addons Preferences Update Panel
def update_panel(self, context):
    try:
        bpy.utils.unregister_class(AlignUi)
    except:
        pass
    AlignUi.bl_category = context.user_preferences.addons[__name__].preferences.category
    bpy.utils.register_class(AlignUi)   
    
class AddonPreferences(bpy.types.AddonPreferences):
    - this must match the addon name, use '__package__'
    - when defining this in a submodule of a python package.
    bl_idname = __name__

    category = bpy.props.StringProperty(
            name="Category",
            description="Choose a name for the category of the panel",
            default="Tools",
            update=update_panel)

    def draw(self, context):

        layout = self.layout
        row = layout.row()
        col = row.column()
        col.label(text="Category:")
        col.prop(self, "category", text="")

Addons Affected:
Note:`Defaults will not change
Addons Contrib (in Testing Category):
space_view3d_align_tools *Completed
space_view3d_toolshelf_menu *Completed
object_boolean_tools *Completed
oscurart_tools *Completed

Contrib I/O: Note:Whilst Defaults will not change per se, it seems like i/o addons could be changed to a category Import/Export
i/o cacharanth *fix registration bug, no other change
i/o export paper model *no change
i/o mesh cache tools *no change

Addons Affected:
Addons Release (in Community Category):
space_view3d_3d_navigation *requires own Task
ui_layer_manager * Complete

Release I/O:`
io_import_scene_unreal_psa_psk ( still uses Misc Tab, will change to Import/Export ) *Complete
io_export_unreal_psk_psa ( still uses Misc Tab, will change to Import/Export ) *Complete
io_online_sketchfab *no change
light_field_tools ( still uses Misc Tab, will change to Tools Tab ) *Complete

Summary: This set's a positive trend in addons ui management, With the exception of the i/o tools I will be updating all the listed addons to include this function. Also misc category should not be used the three affected addons will have tab change as indicated above.

Thanks.

This task is spread out over several addons in release & contrib. **Purpose:** To allow users to change which tabs the Addons appear in. **Fixes:** It's a very common compliant that tabs get easily overcrowded & misused. This fixes that by allowing users to set up their own tab system or relocate addons to where they need them within the toolshelf. **Usage:** Open Addons Preferences, Rename the current Tab name to one you choose or leave as default. **Code:** Using Align Tools in contrib as an example ``` ## Addons Preferences Update Panel def update_panel(self, context): try: bpy.utils.unregister_class(AlignUi) except: pass AlignUi.bl_category = context.user_preferences.addons[__name__].preferences.category bpy.utils.register_class(AlignUi) class AddonPreferences(bpy.types.AddonPreferences): - this must match the addon name, use '__package__' - when defining this in a submodule of a python package. bl_idname = __name__ category = bpy.props.StringProperty( name="Category", description="Choose a name for the category of the panel", default="Tools", update=update_panel) def draw(self, context): layout = self.layout row = layout.row() col = row.column() col.label(text="Category:") col.prop(self, "category", text="") ``` **Addons Affected:** Note:`Defaults will not change *Addons Contrib (in Testing Category):* space_view3d_align_tools *Completed space_view3d_toolshelf_menu *Completed object_boolean_tools *Completed oscurart_tools *Completed *Contrib I/O:*` Note:`Whilst Defaults will not change per se, it seems like i/o addons could be changed to a category Import/Export i/o cacharanth *fix registration bug, no other change i/o export paper model *no change i/o mesh cache tools *no change **Addons Affected:** *Addons Release (in Community Category):* space_view3d_3d_navigation *requires own Task ui_layer_manager * Complete *Release I/O:*` io_import_scene_unreal_psa_psk ( still uses Misc Tab, will change to Import/Export ) *Complete io_export_unreal_psk_psa ( still uses Misc Tab, will change to Import/Export ) *Complete io_online_sketchfab *no change light_field_tools ( still uses Misc Tab, will change to Tools Tab ) *Complete **Summary:** This set's a positive trend in addons ui management, With the exception of the i/o tools I will be updating all the listed addons to include this function. Also misc category should not be used the three affected addons will have tab change as indicated above. Thanks.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Brendon Murphy self-assigned this 2016-05-18 10:05:55 +02:00
Author
Member

Added subscriber: @BrendonMurphy

Added subscriber: @BrendonMurphy

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Author
Member

Update status:
Addons Contrib (in Testing Category):
space_view3d_align_tools *Completed
space_view3d_toolshelf_menu *Completed
object_boolean_tools *Completed
oscurart_tools *Completed

Update status: Addons Contrib (in Testing Category): space_view3d_align_tools *Completed space_view3d_toolshelf_menu *Completed object_boolean_tools *Completed oscurart_tools *Completed

Added subscriber: @italic

Added subscriber: @italic
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

Update Status: Complete.
I decided to pass over some addons in the list as they are quite specific & the Authors should handle the naming of the addons Tab Category's themselves.
Whilst this goes only a small way to address the issues with Tab name misuse, already other addons devs are adopting the system in their own.
Hopefully this will continue to be used within & outside Blender to allow users more freedom to change Tab names & move Panels to suit themselves & clean up their ui.
Thanks.
Closing as Resolved.

Update Status: Complete. I decided to pass over some addons in the list as they are quite specific & the Authors should handle the naming of the addons Tab Category's themselves. Whilst this goes only a small way to address the issues with Tab name misuse, already other addons devs are adopting the system in their own. Hopefully this will continue to be used within & outside Blender to allow users more freedom to change Tab names & move Panels to suit themselves & clean up their ui. Thanks. Closing as Resolved.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#48459
No description provided.