Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d.py
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show All 13 Lines | from bl_ui.properties_grease_pencil_common import ( | ||||
| AnnotationOnionSkin, | AnnotationOnionSkin, | ||||
| GreasePencilMaterialsPanel, | GreasePencilMaterialsPanel, | ||||
| GreasePencilVertexcolorPanel, | GreasePencilVertexcolorPanel, | ||||
| ) | ) | ||||
| from bl_ui.space_toolsystem_common import ( | from bl_ui.space_toolsystem_common import ( | ||||
| ToolActivePanelHelper, | ToolActivePanelHelper, | ||||
| ) | ) | ||||
| from bpy.app.translations import ( | from bpy.app.translations import ( | ||||
| pgettext_iface as iface_, | |||||
| pgettext_tip as tip_, | pgettext_tip as tip_, | ||||
| contexts as i18n_contexts, | contexts as i18n_contexts, | ||||
| ) | ) | ||||
| class VIEW3D_HT_tool_header(Header): | class VIEW3D_HT_tool_header(Header): | ||||
| bl_space_type = 'VIEW_3D' | bl_space_type = 'VIEW_3D' | ||||
| bl_region_type = 'TOOL_HEADER' | bl_region_type = 'TOOL_HEADER' | ||||
| ▲ Show 20 Lines • Show All 668 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| # are always dynamically allocated. | # are always dynamically allocated. | ||||
| act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode] | act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode] | ||||
| act_mode_i18n_context = bpy.types.Object.bl_rna.properties["mode"].translation_context | act_mode_i18n_context = bpy.types.Object.bl_rna.properties["mode"].translation_context | ||||
| sub = row.row(align=True) | sub = row.row(align=True) | ||||
| sub.ui_units_x = 5.5 | sub.ui_units_x = 5.5 | ||||
| sub.operator_menu_enum( | sub.operator_menu_enum( | ||||
| "object.mode_set", "mode", | "object.mode_set", "mode", | ||||
| text=bpy.app.translations.pgettext_iface(act_mode_item.name, act_mode_i18n_context), | text=iface_(act_mode_item.name, act_mode_i18n_context), | ||||
| icon=act_mode_item.icon, | icon=act_mode_item.icon, | ||||
| ) | ) | ||||
| del act_mode_item | del act_mode_item | ||||
| layout.template_header_3D_mode() | layout.template_header_3D_mode() | ||||
| # Contains buttons like Mode, Pivot, Layer, Mesh Select Mode... | # Contains buttons like Mode, Pivot, Layer, Mesh Select Mode... | ||||
| if obj: | if obj: | ||||
| ▲ Show 20 Lines • Show All 6,361 Lines • ▼ Show 20 Lines | class VIEW3D_PT_overlay_gpencil_options(Panel): | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.object and context.object.type == 'GPENCIL' | return context.object and context.object.type == 'GPENCIL' | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.label(text={ | layout.label(text={ | ||||
| 'PAINT_GPENCIL': "Draw Grease Pencil", | 'PAINT_GPENCIL': iface_("Draw Grease Pencil"), | ||||
| 'EDIT_GPENCIL': "Edit Grease Pencil", | 'EDIT_GPENCIL': iface_("Edit Grease Pencil"), | ||||
| 'SCULPT_GPENCIL': "Sculpt Grease Pencil", | 'SCULPT_GPENCIL': iface_("Sculpt Grease Pencil"), | ||||
| 'WEIGHT_GPENCIL': "Weight Grease Pencil", | 'WEIGHT_GPENCIL': iface_("Weight Grease Pencil"), | ||||
| 'VERTEX_GPENCIL': "Vertex Grease Pencil", | 'VERTEX_GPENCIL': iface_("Vertex Grease Pencil"), | ||||
| 'OBJECT': "Grease Pencil", | 'OBJECT': iface_("Grease Pencil"), | ||||
| }[context.mode]) | }[context.mode], translate=False) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| view = context.space_data | view = context.space_data | ||||
| overlay = view.overlay | overlay = view.overlay | ||||
| layout.prop(overlay, "use_gpencil_onion_skin", text="Onion Skin") | layout.prop(overlay, "use_gpencil_onion_skin", text="Onion Skin") | ||||
| ▲ Show 20 Lines • Show All 1,074 Lines • Show Last 20 Lines | |||||