Skip to content

Commit 1706507

Browse files
committed
0_8_1
1 parent 4d0c70b commit 1706507

3 files changed

Lines changed: 54 additions & 6 deletions

File tree

__init__.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "DKS UI",
2121
"description": "UI Customisations",
2222
"author": "DigiKrafting.Studio",
23-
"version": (0, 8, 0),
23+
"version": (0, 8, 1),
2424
"blender": (2, 80, 0),
2525
"location": "Properties > Scene, Info Toolbar, 3D View Toolbar",
2626
"wiki_url": "https://github.com/DigiKrafting/blender_addon_ui/wiki",
@@ -74,16 +74,37 @@ class dks_ui_addon_prefs(bpy.types.AddonPreferences):
7474
default='Modeling',
7575
)
7676

77+
option_ui_menu_toggle_state : bpy.props.BoolProperty(
78+
name="Menu Toggle State",
79+
default=False,
80+
)
81+
7782
def draw(self, context):
7883

7984
layout = self.layout
8085

8186
box=layout.box()
8287
box.prop(self, 'option_ui_mode')
8388

89+
class dks_ui_menu_toggle(bpy.types.Operator):
90+
91+
bl_idname = "dks_ui.menu_toggle"
92+
bl_label = "SP"
93+
bl_space_type = 'PROPERTIES'
94+
bl_region_type = 'WINDOW'
95+
96+
def execute(self, context):
97+
98+
if not bpy.context.preferences.addons[__package__].preferences.option_ui_menu_toggle_state:
99+
bpy.context.preferences.addons[__package__].preferences.option_ui_menu_toggle_state=True
100+
else:
101+
bpy.context.preferences.addons[__package__].preferences.option_ui_menu_toggle_state=False
102+
return {'FINISHED'}
103+
84104
classes = (
85105
dks_ui_addon_prefs,
86106
dks_ui_quit,
107+
dks_ui_menu_toggle,
87108
)
88109

89110
def register():

dks_ui.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
from bpy.types import Header, Menu, Panel
2121
from bpy.app.translations import contexts as i18n_contexts
2222

23+
from bl_ui.space_topbar import (
24+
TOPBAR_MT_file,
25+
TOPBAR_MT_edit,
26+
TOPBAR_MT_render,
27+
TOPBAR_MT_window,
28+
TOPBAR_MT_help,
29+
)
30+
2331
class workspace_set(bpy.types.Operator):
2432

2533
bl_idname = "dks_ui.workspace_set"
@@ -73,7 +81,21 @@ def draw_left(self, context):
7381

7482
layout.operator("wm.splash", text="", icon='BLENDER', emboss=False)
7583

76-
#TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
84+
if bpy.context.preferences.addons[__package__].preferences.option_ui_menu_toggle_state:
85+
86+
layout.operator('dks_ui.menu_toggle',text="",icon="TRIA_LEFT")
87+
88+
layout.menu("TOPBAR_MT_file")
89+
layout.menu("TOPBAR_MT_edit")
90+
91+
layout.menu("TOPBAR_MT_render")
92+
93+
layout.menu("TOPBAR_MT_window")
94+
layout.menu("TOPBAR_MT_help")
95+
96+
else:
97+
98+
layout.operator('dks_ui.menu_toggle',text="",icon="TRIA_RIGHT")
7799

78100
#layout.separator()
79101
layout.operator('wm.read_homefile',text="",icon='FILE_NEW')
@@ -167,8 +189,9 @@ def draw_left(self, context):
167189
if bpy.context.preferences.addons['blender_addon_reallusion'].preferences.option_show_rl_toggle_state or not bpy.context.preferences.addons['blender_addon_reallusion'].preferences.option_show_rl_toggle:
168190

169191
row.operator("dks_rl.export_cc",text="CC",icon="EXPORT")
192+
row.operator("dks_rl.import_cc",text="CC",icon="IMPORT")
170193
row.operator("dks_rl.export_3dx",text="3DX",icon="EXPORT")
171-
row.operator("dks_rl.import_base",text="Base",icon="IMPORT")
194+
row.operator("dks_rl.import_neutral",text="Neutral",icon="IMPORT")
172195
row.operator("dks_rl.import_female",text="Female",icon="IMPORT")
173196
row.operator("dks_rl.import_male",text="Male",icon="IMPORT")
174197

space_view3d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,9 @@ def draw(self, context):
587587
if obj:
588588
sub.separator(factor=0.4)
589589
sub.operator("object.mode_set",text="",icon='OBJECT_DATA').mode="OBJECT"
590-
sub.operator("object.mode_set",text="",icon='EDITMODE_HLT').mode="EDIT"
590+
if obj.type == 'MESH':
591+
sub.operator("object.mode_set",text="",icon='EDITMODE_HLT').mode="EDIT"
592+
591593
# DS UI <
592594

593595
layout.template_header_3D_mode()
@@ -607,7 +609,7 @@ def draw(self, context):
607609
row.operator("mesh.delete",text="",icon='VERTEXSEL').type='VERT'
608610
row.operator("mesh.delete",text="",icon='EDGESEL').type='EDGE'
609611
row.operator("mesh.delete",text="",icon='FACESEL').type='FACE'
610-
612+
611613
row = layout.row(align=True)
612614
row.operator("view3d.select_circle",text="",icon='MESH_CIRCLE')
613615
row.operator("view3d.select_box",text="",icon='MESH_PLANE')
@@ -623,7 +625,6 @@ def draw(self, context):
623625
row.operator("view3d.localview",text="",icon='HIDE_OFF')
624626

625627
# DS UI <
626-
627628
# Grease Pencil
628629
if obj and obj.type == 'GPENCIL' and context.gpencil_data:
629630
gpd = context.gpencil_data
@@ -679,6 +680,9 @@ def draw(self, context):
679680
row.operator("mesh.loop_multi_select",text="",icon='SNAP_EDGE').ring=True
680681
row.operator("mesh.subdivide",text="",icon='MESH_GRID')
681682

683+
row = layout.row(align=True)
684+
row.operator("mesh.edge_face_add",text="",icon='MESH_PLANE')
685+
682686
# DS UI <
683687

684688
layout.separator_spacer()

0 commit comments

Comments
 (0)