Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
| Show First 20 Lines • Show All 585 Lines • ▼ Show 20 Lines | def draw(self, _context): | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("gpencil.snap_cursor_to_selected", text="Cursor to Selected") | layout.operator("gpencil.snap_cursor_to_selected", text="Cursor to Selected") | ||||
| layout.operator("view3d.snap_cursor_to_center", text="Cursor to World Origin") | layout.operator("view3d.snap_cursor_to_center", text="Cursor to World Origin") | ||||
| layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid") | layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid") | ||||
| class GPENCIL_MT_move_to_layer(Menu): | |||||
| bl_label = "Move to Layer" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| gpd = context.gpencil_data | |||||
| if gpd: | |||||
| i = 0 | |||||
| gpl_active = context.active_gpencil_layer | |||||
| for gpl in gpd.layers: | |||||
| if gpl.info == gpl_active.info: | |||||
| icon='GREASEPENCIL' | |||||
| else: | |||||
| icon = 'NONE' | |||||
| layout.operator("gpencil.move_to_layer", text=gpl.info, icon=icon).layer=i | |||||
| layout.separator() | |||||
| layout.operator("gpencil.layer_add", text="New Layer", icon='ADD') | |||||
| class GPENCIL_MT_gpencil_draw_delete(Menu): | class GPENCIL_MT_gpencil_draw_delete(Menu): | ||||
| bl_label = "Delete" | bl_label = "Delete" | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator_context = 'INVOKE_REGION_WIN' | layout.operator_context = 'INVOKE_REGION_WIN' | ||||
| ▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | |||||
| classes = ( | classes = ( | ||||
| GPENCIL_MT_pie_tool_palette, | GPENCIL_MT_pie_tool_palette, | ||||
| GPENCIL_MT_pie_settings_palette, | GPENCIL_MT_pie_settings_palette, | ||||
| GPENCIL_MT_pie_tools_more, | GPENCIL_MT_pie_tools_more, | ||||
| GPENCIL_MT_pie_sculpt, | GPENCIL_MT_pie_sculpt, | ||||
| GPENCIL_MT_snap, | GPENCIL_MT_snap, | ||||
| GPENCIL_MT_cleanup, | GPENCIL_MT_cleanup, | ||||
| GPENCIL_MT_move_to_layer, | |||||
| GPENCIL_MT_gpencil_draw_delete, | GPENCIL_MT_gpencil_draw_delete, | ||||
| GPENCIL_UL_annotation_layer, | GPENCIL_UL_annotation_layer, | ||||
| GPENCIL_UL_layer, | GPENCIL_UL_layer, | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||