Page MenuHome

Gizmo: New gizmo for Inset tool
AbandonedPublic

Authored by Pratik Borhade (PratikPB2123) on May 27 2021, 8:04 PM.

Details

Summary

This patch will add a new circle shape gizmo for Inset tool.
Gizmo group type VIEW3D_GGT_tool_inset_handle_free introduced here in the patch.

Following changes also fixes T87991 because hotspot in this case is enough large to inset a face.

Gizmo image for reference:

Diff Detail

Repository
rB Blender

Event Timeline

Pratik Borhade (PratikPB2123) requested review of this revision.May 27 2021, 8:04 PM
Pratik Borhade (PratikPB2123) created this revision.

Since this uses the VIEW3D_GGT_tool_generic_handle_free gizmo with some tweaks (size & opacity), it would be better to re-use the existing gizmo.

We could support initial tool properties so the fix could then be a small tweak to the tool definition.

Note that these properties are already supported, initializing using widget_properties is not.

return dict(
    idname="builtin.inset_faces",
    label="Inset Faces",
    icon="ops.mesh.inset",
    widget="VIEW3D_GGT_tool_generic_handle_free",
    widget_properties = {
        "scale": 2.0,
        "fill_alpha": 0.0,
    }
    keymap=(),
    draw_settings=draw_settings,
)

Otherwise we will be adding new gizmos just to support minor variations of settings.

See VIEW3D_GGT_xform_extrude for an example of a gizmo that uses properties.

Although supporting tool properties on initialization does get into tool-system internals a bit.

This patch adds per-tool widget properties & scale support to VIEW3D_GGT_tool_generic_handle_free, it should be able to be modified with the addition of alpha to match this patch P2271.

Campbell Barton (campbellbarton) requested changes to this revision.Jul 26 2021, 3:13 AM
This revision now requires changes to proceed.Jul 26 2021, 3:13 AM

Committed alternate changes to customize the gizmo:

Thanks :)