Page MenuHome

Tool System: multiple tool support
ClosedPublic

Authored by Campbell Barton (campbellbarton) on May 17 2018, 10:12 AM.

Details

Summary

This patch adds support for:

  • Per space-type tools (3D view and edit).
  • Per mode tools (object, edit, weight-paint .. etc).
  • Multiple active combinations of space-type & mode at once.

What Works

  • Toolbar in image and 3d view.
  • Switching modes changes tools.
  • Topbar only shows last activated tool (this is a design issue, since topbar is global and tools are per space).

Not Yet Working

  • Multiple windows multiple, different tools with manipulators *(currently unlinking manipulators isn't aware of other workspaces windows)*.

Plans

  • Remove WM_OT_tool_set, using an operator here causes quite a few jumps between C and Python in the callstack. Some of this logic can be kept in Python's WM_OT_tool_set_by_name.
  • Improve the image toolbar (currently it's a proof of concept to show whats possible).
  • Refactor toolbar definitions, one file per space-type, share code in common location.

Notes

  • Having per-space-type API calls: workspace.tools.from_space_view3d_mode / from_space_image_mode isn't nice. It's needed because the values of the mode argument depend on space_type.
  • WM_toolsystem_update_from_context_view3d from mode switching operators are needed because we cant use message bus subscribers to run operators or set RNA values (needed for switching tools).

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Move tool assignment from operator to method.
  • API to add tools from Python.
  • Rename tool_refs to tools
  • Topbar shows last set tool
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.May 17 2018, 4:00 PM
This revision was automatically updated to reflect the committed changes.