Fix T84796: Particle tool properties displayed for select tool

When using particle mode, the particle tool settings were always
displayed, even if select/cursor is the active tool. This patch
hides the properties of the particle tools for non-brush tools,
using the same check as in other modes.

Differential Revision: https://developer.blender.org/D10266
This commit is contained in:
Kdaf
2021-02-24 12:27:25 -06:00
committed by Hans Goudey
parent 5dd176cde8
commit e8a99dda25

View File

@@ -333,6 +333,17 @@ class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel):
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
tool_context = ToolSelectPanelHelper.tool_active_from_context(context)
if not tool_context:
# If there is no active tool, then there can't be an active brush.
tool = None
if not tool_context.has_datablock:
# tool.has_datablock is always true for tools that use brushes.
tool = None
if tool is not None:
col = layout.column()
col.prop(brush, "size", slider=True)