Changeset View
Changeset View
Standalone View
Standalone View
pie_menus_official/__init__.py
| Show All 25 Lines | from bpy.types import ( | ||||
| AddonPreferences, | AddonPreferences, | ||||
| ) | ) | ||||
| bl_info = { | bl_info = { | ||||
| "name": "UI Pie Menu Official", | "name": "UI Pie Menu Official", | ||||
| "author": "Antony Riakiotakis, Sebastian Koenig", | "author": "Antony Riakiotakis, Sebastian Koenig", | ||||
| "version": (1, 1, 5), | "version": (1, 1, 5), | ||||
| "blender": (2, 7, 7), | "blender": (2, 80, 0), | ||||
| "description": "Individual Pie Menu Activation List", | "description": "Individual Pie Menu Activation List", | ||||
| "location": "Addons Preferences", | "location": "Addons Preferences", | ||||
| "warning": "", | "warning": "", | ||||
| "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/" | "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/" | ||||
| "Scripts/3D_interaction/Pie_Menu", | "Scripts/3D_interaction/Pie_Menu", | ||||
| "category": "Pie Menu" | "category": "Pie Menu" | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| icon = 'TRIA_DOWN' if expand else 'TRIA_RIGHT' | icon = 'TRIA_DOWN' if expand else 'TRIA_RIGHT' | ||||
| col = box.column() | col = box.column() | ||||
| row = col.row() | row = col.row() | ||||
| sub = row.row() | sub = row.row() | ||||
| sub.context_pointer_set('addon_prefs', self) | sub.context_pointer_set('addon_prefs', self) | ||||
| op = sub.operator('wm.context_toggle', text='', icon=icon, | op = sub.operator('wm.context_toggle', text='', icon=icon, | ||||
| emboss=False) | emboss=False) | ||||
| op.data_path = 'addon_prefs.show_expanded_' + mod_name | op.data_path = 'addon_prefs.show_expanded_' + mod_name | ||||
| sub.label('{}: {}'.format(info['category'], info['name'])) | sub.label(text='{}: {}'.format(info['category'], info['name'])) | ||||
| sub = row.row() | sub = row.row() | ||||
| sub.alignment = 'RIGHT' | sub.alignment = 'RIGHT' | ||||
| if info.get('warning'): | if info.get('warning'): | ||||
| sub.label('', icon='ERROR') | sub.label(text='', icon='ERROR') | ||||
| sub.prop(self, 'use_' + mod_name, text='') | sub.prop(self, 'use_' + mod_name, text='') | ||||
| # The second stage | # The second stage | ||||
| if expand: | if expand: | ||||
| if info.get('description'): | if info.get('description'): | ||||
| split = col.row().split(percentage=0.15) | split = col.row().split(factor=0.15) | ||||
| split.label('Description:') | split.label(text='Description:') | ||||
| split.label(info['description']) | split.label(text=info['description']) | ||||
| if info.get('location'): | if info.get('location'): | ||||
| split = col.row().split(percentage=0.15) | split = col.row().split(factor=0.15) | ||||
| split.label('Location:') | split.label(text='Location:') | ||||
| split.label(info['location']) | split.label(text=info['location']) | ||||
| """ | """ | ||||
| if info.get('author'): | if info.get('author'): | ||||
| split = col.row().split(percentage=0.15) | split = col.row().split(factor=0.15) | ||||
| split.label('Author:') | split.label(text='Author:') | ||||
| split.label(info['author']) | split.label(text=info['author']) | ||||
| """ | """ | ||||
| if info.get('version'): | if info.get('version'): | ||||
| split = col.row().split(percentage=0.15) | split = col.row().split(factor=0.15) | ||||
| split.label('Version:') | split.label(text='Version:') | ||||
| split.label('.'.join(str(x) for x in info['version']), | split.label(text='.'.join(str(x) for x in info['version']), | ||||
| translate=False) | translate=False) | ||||
| if info.get('warning'): | if info.get('warning'): | ||||
| split = col.row().split(percentage=0.15) | split = col.row().split(factor=0.15) | ||||
| split.label('Warning:') | split.label(text='Warning:') | ||||
| split.label(' ' + info['warning'], icon='ERROR') | split.label(text=' ' + info['warning'], icon='ERROR') | ||||
| tot_row = int(bool(info.get('wiki_url'))) | tot_row = int(bool(info.get('wiki_url'))) | ||||
| if tot_row: | if tot_row: | ||||
| split = col.row().split(percentage=0.15) | split = col.row().split(factor=0.15) | ||||
| split.label(text='Internet:') | split.label(text='Internet:') | ||||
| if info.get('wiki_url'): | if info.get('wiki_url'): | ||||
| op = split.operator('wm.url_open', | op = split.operator('wm.url_open', | ||||
| text='Documentation', icon='HELP') | text='Documentation', icon='HELP') | ||||
| op.url = info.get('wiki_url') | op.url = info.get('wiki_url') | ||||
| for i in range(4 - tot_row): | for i in range(4 - tot_row): | ||||
| split.separator() | split.separator() | ||||
| ▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines | |||||