Tool System: Where operators can take advantage of a tool system
Open, NormalPublic

Description

This proposal is aimed to look into operators that make sense for a tool system.

Notes:

  • At time of writing I'm working on D2882, which exposes operators as tools, the outcome of this task is quite practical since it impacts which operators are modified to support being used as tools.
  • This task focuses on Edit-Mesh tools, since they're an area I know well.

    It would be interesting to consider other areas (grease pencil, animation, UV editing, etc).
  • This relates to T53047 which is only about the tool system.

What is a Tool?

This proposal differentiates between tools and operators,
where tools can be selected from a tool-palette, instead of executing immediately they
are activated, typically by clicking in the view-port (window-region-type).

Tools may include:

  • Operator (used for the top-bar option display).
  • Key-map (optional: used to define exact options operator is called with, allowing modifiers for alternate behavior).
  • Manipulator (optional: a tool may activate a manipulator used to run it)

Note that a tool must use a key-map / manipulator (or both although this isn't all that likely),
otherwise there is no way to activate it.

Design Considerations

Select Before Action Conundrum

A common reason existing operators don't fit well into a tool-system is that Blender
currently uses select & action (as two separate steps).

Tool-systems in other applications generally operate on the thing you click on
(selecting and operating in a single step).

We can choose not to follow this convention, however having tools that activate from clicking anywhere is quite strange.

Take the edit-mesh crease operator for example:
If this were to be exposed as a tool,
a user might expect to be able to LMB on an edge to adjust its crease value.

Some further changes would need to be made here to work usefully to support multiple edges,
shift-click could select, press-draw could change crease value - or something similar this.

To pick a different example, say we add edit-mesh Edge Rotate as a tool:
Having to select, then click anywhere on the screen to rotate the edge - is awkward.
Single click to rotate the edge under the cursor fits in with what I think users expect.

Again, this leads to the issue where we need to support single and multiple operations.

It also pushes us to add pre-selection highlighting,
since it may not be obvious exactly which edge you're about to rotate.

In the past this has been a controversially topic. It's disputable if we even want to go in this direction.


Possible Solutions:

It arguable how much we should modify existing tools and workflow to support a tool-system.

Nevertheless, here are some options:

  • No Changes

    We could accept that some operators simply don't work very well as tools and not expose them in a tools palette.
  • Almost No Change

    We keep select & action as separate steps, convention in Blender and expose tools in a way that accounts for this (each operator would be adjusted on a case-by-case basis).
  • Almost No (code) Change (use macros)

    Use macros for any tool we want to support select & action in a single step.

    If we do this, users will want pre-selection highlighting sooner or later.
  • Rewrite Operator Interactions

    Re-work operators to support select & action.

My current plan is the first option.
We can always re-evaluate later.

Modal Operators as Tools

In some cases we can expose a modal operator as a tool,
where a single click or click-drag runs the operator, releasing executes/finishes the operation.

Selection tools are a good example of modal operators that can support both kinds of interaction well.

Circle selection for example can be a persistent mode, or a one off stroke.
(although we will want a way to change the circle size in the top-bar).

There are some exceptions to this - where we really can't avoid entering a modal operator,
having it keep running - supporting multiple actions while it runs.

Examples of this are:

  • Transform (with numeric input).
  • Knife Tool (to perform more than a single cut).
  • Ruler
  • Loop Cut (ability to change multi-cut while running)

In each case we could re-write these operators to work differently.

The ruler is a candidate that would be better implemented as a tool (with manipulators),
this would match what The Gimp and Inkscape do with their ruler tool.

The knife tool for example if a case where it would be nice to be able to use it without being locked into a mode.
Since only some view operations can be performed (internally this is clumsy too).
(this is a reasonably big task).

It's worth noting that other applications also run into this limit.

The Gimp's lasso tool (probably other image editors too)
is a good example of something roughly matching Blender's knife tool.

I don't think we should consider every case an area to re-implement .

Expose Modes as Tools?

While I'm not proposing this short term,
paint modes especially (vertex, weight, sculpt, image) might make sense to show as tools.

This is just something to consider and I don't think we need to discuss in detail now.


Existing Operators as Tools

Currently Supported

These operators map directly to a tool-system without modifications.

  • Curve drawing tool curve.draw

    Generally any drawing tools work well.

    Grease pencil is a candidate too however I'm leaving this until greasepencil-object branch is merged.

    Most other drawing/painting operations have their own mode.
  • Border/Circle/Lasso Select view3d.select_border/circle/lasso

    This can use the tweak event, leaving the click event free for cursor placement (if we like).
  • Click Extrude (mesh.dupli_extrude_cursor, armature.click_extrude, curve.vertex_add)

    While it might be nice to support dragging while the mouse button is held to move the extrusion, in general this works fine.
  • Bisect mesh.bisect.

    Simple click-drag to bisect is fine.

    Depending on the selection may seem odd though.

Currently Supported (room for improvement)

  • Grab/Scale/Rotate Transform Operations transform.transform

    Since there is already a manipulator for transforming, I'm not sure it's all that useful to select transform/scale/rotate from a tool panel.

    We could remove the manipulator toggle in the 3D header and expose it as a tool (even keeping 3D cursor placement when clicking away from the manipulator).

    This way there would be no reason to add separate tools for transform/scale/rotate.

    Of course users can use G/S/R keys still.
  • Other Transform Operations (transform.vert_slide, transform.edge_slide, transform.transform(mode='BONE_ROLL'))

    While this works, it suffers from the select-before-action-conundrum. Where users might want to click-rip without first selecting the vertex.
  • Rip tool (mesh.rip_move, mesh.rip_edge_move).

    Again, works with select-before-action-conundrum.

Currently Poorly/Unsupported

  • Inset/Bevel (mesh.inset, mesh.bevel)

    Both operations are modal and have useful operation, using The Gimp's terminology, these would most likely be "Filters" instead of tools.

    So we should probably keep these as-is.
  • Spin/Screw (mesh.spin, mesh.screw)

    To be supported as a tool, we might add the ability to click-drag to control the angle.

    Not high priority.

New Operators

There are some operations that could be written as new operators to better expose existing functionality as tools.

These are just examples that come to mind (please don't focus too much on new-feature aspect of this proposal).

  • Interactive Dissolve Tool

    Click on edges to dissolve them (click drag to dissolve all edges the cursor passes over).
  • Interactive low-poly face-creation Tool
    • LMB creates a triangle from the nearest edge
    • Drag to add a second vertex (for quads).
    • Modifier key to split the nearest edge at the cursor location (to turn tries into quads/ngons).

      We would probably want pre-selection highlighting for this, as we have for loop-cut.
  • Interactive Smooth Tool

    This could work similar to sculpts smooth tool - as a brush or just an interactive operation (dragging to change influence).

Details

Type
Design