[Bf-blender-cvs] [21f02dd85d9] blender-v3.0-release: Fix T94243: weightpaint gradient panel shown in other places

Philipp Oeser noreply at git.blender.org
Tue Jan 11 09:32:58 CET 2022


Commit: 21f02dd85d93c6128f01971a485352794916a67f
Author: Philipp Oeser
Date:   Mon Dec 20 10:01:18 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB21f02dd85d93c6128f01971a485352794916a67f

Fix T94243: weightpaint gradient panel shown in other places

Weightpaint gradient tool panel showed in other modes (and as a separate
panel).

Fix for fix, see
- rBf8a0e102cf5e
- rBe549d6c1bd2d

So now, check mode again and restrict to topbar (prevents an additional
panel since this is already included in the brush settings).

ref rB0837926740b3 in sculpt-dev branch, so thx @joeedh as well!

Maniphest Tasks: T94243

Differential Revision: https://developer.blender.org/D13630

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

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 01850676519..c1fb19e5337 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -694,9 +694,15 @@ class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel):
     #bl_context = ".weightpaint" # dot on purpose (access from topbar)
     bl_label = "Falloff"
     bl_options = {'DEFAULT_CLOSED'}
+    # also dont draw as an extra panel in the sidebar (already included in the Brush settings)
+    bl_space_type = 'TOPBAR'
+    bl_region_type = 'HEADER'
 
     @classmethod
     def poll(cls, context):
+        # since we dont give context above, check mode here (to not show in other modes like sculpt)
+        if context.mode != 'PAINT_WEIGHT':
+            return False
         settings = context.tool_settings.weight_paint
         brush = settings.brush
         return brush is not None



More information about the Bf-blender-cvs mailing list