diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-02-06 16:07:53 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-02-20 15:28:53 +0300 |
commit | d95e9c7cf80ae2eb40728e7369216e48146a3a36 (patch) | |
tree | 12d90b7982c1b343f95b75e677fb5b014a3ad400 /source/blender/editors | |
parent | b4ae962447ed7611c1f357416a1c049e0de5dca9 (diff) |
Fix T63892: Tools cannot be registered into some contexts (e.g.
PAINT_TEXTURE)
This fails because some tool contexts define their tools with functions
[see the following list for context that fail]:
- PARTICLE (_defs_particle.generate_from_brushes)
- SCULPT (_defs_sculpt.generate_from_brushes)
- PAINT_TEXTURE (_defs_texture_paint.generate_from_brushes)
- PAINT_VERTEX (_defs_vertex_paint.generate_from_brushes)
- PAINT_WEIGHT (_defs_weight_paint.generate_from_brushes)
- PAINT_GPENCIL (_defs_gpencil_paint.generate_from_brushes)
- SCULPT_GPENCIL (_defs_gpencil_sculpt.generate_from_brushes)
- WEIGHT_GPENCIL (_defs_gpencil_weight.generate_from_brushes)
ToolSelectPanelHelper._tools_flatten() is usually called with
cls.tools_from_context(context) [that already yields from the function].
But when registering a tool, _tools_flatten() will still give back this
function, not a ToolDef - and we cannot get a bl_idname from that.
Now check for this and yield None in that case.
Also share logic across all tool_flatten functions:
- _tools_flatten
- _tools_flatten_with_tool_index
- _tools_flatten_with_keymap
Maniphest Tasks: T63892
Differential Revision: https://developer.blender.org/D6763
Diffstat (limited to 'source/blender/editors')
0 files changed, 0 insertions, 0 deletions