blender/release/scripts
Philipp Oeser f9e51662bd
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
2020-03-10 14:31:44 +02:00
..
addons@08eaeef293 Update add-ons submodule with fixes for 2.82a 2020-03-09 21:55:35 +02:00
addons_contrib@70b649775e Reference correct sha1s of submodules 2020-02-06 18:27:54 +02:00
freestyle Fix T72289: FreeStyle python error 2019-12-18 11:00:50 +01:00
modules Fix T58842: Add-ons Import/Export entries disapear when enabling Filter 2020-02-04 21:06:37 +01:00
presets Keymap: Add front/back Alt-MMB absolute view axis switching 2020-03-10 14:31:42 +02:00
startup Fix T63892: Tools cannot be registered into some contexts (e.g. 2020-03-10 14:31:44 +02:00
templates_osl
templates_py