[Bf-blender-cvs] [e8a99dda258] master: Fix T84796: Particle tool properties displayed for select tool

Kdaf noreply at git.blender.org
Wed Feb 24 19:28:02 CET 2021


Commit: e8a99dda25813aa54497c816bb2f918ce0bdc826
Author: Kdaf
Date:   Wed Feb 24 12:27:25 2021 -0600
Branches: master
https://developer.blender.org/rBe8a99dda25813aa54497c816bb2f918ce0bdc826

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

===================================================================

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 257b9edf4e8..a469973c28f 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -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)



More information about the Bf-blender-cvs mailing list