[Bf-blender-cvs] [0837926740b] sculpt-dev: Sculpt-dev: fix weight paint panel showing up in sculpt mode
Joseph Eagar
noreply at git.blender.org
Tue Dec 14 23:10:00 CET 2021
Commit: 0837926740b310eb8a93e2fb2fac2269331f71ad
Author: Joseph Eagar
Date: Tue Dec 14 14:09:42 2021 -0800
Branches: sculpt-dev
https://developer.blender.org/rB0837926740b310eb8a93e2fb2fac2269331f71ad
Sculpt-dev: fix weight paint panel showing
up in sculpt mode
===================================================================
M release/scripts/startup/bl_ui/properties_paint_common.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index b82f1989fc3..9364aafb4ed 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1127,7 +1127,7 @@ class FalloffPanel(BrushPanel):
settings = self.paint_settings(context)
mode = self.get_brush_mode(context)
brush = settings.brush
-
+
if mode == "SCULPT" and "falloff_curve" in brush.channels:
layout.label(text="Falloff")
ch = UnifiedPaintPanel.get_channel(context, brush, "falloff_curve")
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 9f66b5456c4..a4388374c07 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -810,7 +810,13 @@ class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel):
@classmethod
def poll(cls, context):
+ if context.mode != "PAINT_WEIGHT":
+ return False
+
settings = context.tool_settings.weight_paint
+ if not settings:
+ return False
+
brush = settings.brush
return brush is not None
@@ -845,6 +851,9 @@ class VIEW3D_PT_tools_brush_falloff(Panel, View3DPaintPanel, FalloffPanel):
class VIEW3D_PT_tools_brush_falloff_popover(Panel, View3DPaintPanel, FalloffPanel):
bl_context = ".brush_editor" # dot on purpose (access from topbar)
+ bl_space_type = "TOPBAR"
+ bl_region_type = "HEADER"
+
#bl_parent_id = "VIEW3D_PT_tools_brush_settings"
bl_label = ""
bl_options = {'DEFAULT_CLOSED'}
More information about the Bf-blender-cvs
mailing list