Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d.py
| Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| sub = row.row() | sub = row.row() | ||||
| sub.ui_units_x = 4 | sub.ui_units_x = 4 | ||||
| sub.popover( | sub.popover( | ||||
| panel="VIEW3D_PT_transform_orientations", | panel="VIEW3D_PT_transform_orientations", | ||||
| text=trans_name, | text=trans_name, | ||||
| icon_value=trans_icon, | icon_value=trans_icon, | ||||
| ) | ) | ||||
| # Pivot | |||||
| if object_mode in {'OBJECT', 'EDIT', 'POSE', 'EDIT_GPENCIL', 'SCULPT_GPENCIL'}: | |||||
| pivot_point = tool_settings.transform_pivot_point | |||||
| act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point] | |||||
| row = layout.row(align=True) | |||||
| row.popover( | |||||
| panel="VIEW3D_PT_pivot_point", | |||||
| icon=act_pivot_point.icon, | |||||
| text="", | |||||
| ) | |||||
| # Snap | # Snap | ||||
| show_snap = False | show_snap = False | ||||
| if obj is None: | if obj is None: | ||||
| show_snap = True | show_snap = True | ||||
| else: | else: | ||||
| if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', | if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', | ||||
| 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: | 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: | ||||
| show_snap = True | show_snap = True | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| else: | else: | ||||
| if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: | if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.prop(tool_settings, "proportional_edit", icon_only=True) | row.prop(tool_settings, "proportional_edit", icon_only=True) | ||||
| sub = row.row(align=True) | sub = row.row(align=True) | ||||
| sub.active = tool_settings.proportional_edit != 'DISABLED' | sub.active = tool_settings.proportional_edit != 'DISABLED' | ||||
| sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) | sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) | ||||
| # Pivot | |||||
| if object_mode in {'OBJECT', 'EDIT', 'POSE', 'EDIT_GPENCIL', 'SCULPT_GPENCIL'}: | |||||
| pivot_point = tool_settings.transform_pivot_point | |||||
| act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point] | |||||
| row = layout.row(align=True) | |||||
| row.popover( | |||||
| panel="VIEW3D_PT_pivot_point", | |||||
| icon=act_pivot_point.icon, | |||||
| text="", | |||||
| ) | |||||
| # grease pencil | # grease pencil | ||||
| if object_mode == 'PAINT_GPENCIL': | if object_mode == 'PAINT_GPENCIL': | ||||
| origin = tool_settings.gpencil_stroke_placement_view3d | origin = tool_settings.gpencil_stroke_placement_view3d | ||||
| gp_origin = tool_settings.bl_rna.properties["gpencil_stroke_placement_view3d"].enum_items[origin] | gp_origin = tool_settings.bl_rna.properties["gpencil_stroke_placement_view3d"].enum_items[origin] | ||||
| or_icon = getattr(gp_origin, "icon", "BLANK1") | or_icon = getattr(gp_origin, "icon", "BLANK1") | ||||
| or_name = getattr(gp_origin, "name", "Stroke Placement") | or_name = getattr(gp_origin, "name", "Stroke Placement") | ||||
| layout.popover( | layout.popover( | ||||
| ▲ Show 20 Lines • Show All 5,704 Lines • Show Last 20 Lines | |||||