UI: Use "View" category for 3D view panels

Allows add-ons to add other categories.
This commit is contained in:
Campbell Barton 2018-09-27 16:22:50 +10:00
parent 5f7c671c56
commit c67305f21b
2 changed files with 7 additions and 0 deletions

View File

@ -370,6 +370,7 @@ class ShowHideMenu:
# NOTE: this doesn't seem to be able to be used directly
class VIEW3D_MT_transform_base(Menu):
bl_label = "Transform"
bl_category = "View"
# TODO: get rid of the custom text strings?
def draw(self, context):
@ -3868,6 +3869,7 @@ class VIEW3D_MT_proportional_editing_falloff_pie(Menu):
class VIEW3D_PT_view3d_properties(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "View"
bl_label = "View"
def draw(self, context):
@ -3905,6 +3907,7 @@ class VIEW3D_PT_view3d_properties(Panel):
class VIEW3D_PT_view3d_camera_lock(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "View"
bl_label = "Camera Lock"
bl_parent_id = "VIEW3D_PT_view3d_properties"
@ -3939,6 +3942,7 @@ class VIEW3D_PT_view3d_camera_lock(Panel):
class VIEW3D_PT_view3d_cursor(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "View"
bl_label = "3D Cursor"
def draw(self, context):
@ -4955,6 +4959,7 @@ class VIEW3D_PT_quad_view(Panel):
class VIEW3D_PT_grease_pencil(AnnotationDataPanel, Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "View"
# NOTE: this is just a wrapper around the generic GP Panel

View File

@ -1182,6 +1182,7 @@ void view3d_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
strcpy(pt->idname, "VIEW3D_PT_transform");
strcpy(pt->label, N_("Transform")); /* XXX C panels not available through RNA (bpy.types)! */
strcpy(pt->category, "View");
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
pt->draw = view3d_panel_transform;
pt->poll = view3d_panel_transform_poll;
@ -1190,6 +1191,7 @@ void view3d_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
strcpy(pt->idname, "VIEW3D_PT_vgroup");
strcpy(pt->label, N_("Vertex Weights")); /* XXX C panels are not available through RNA (bpy.types)! */
strcpy(pt->category, "View");
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
pt->draw = view3d_panel_vgroup;
pt->poll = view3d_panel_vgroup_poll;