[Bf-blender-cvs] [66d0b1b5c34] temp-T96709-painting-target: Update poll function.
Jeroen Bakker
noreply at git.blender.org
Wed Mar 23 16:40:33 CET 2022
Commit: 66d0b1b5c34a68e65ac451699690382c4ee1136d
Author: Jeroen Bakker
Date: Wed Mar 23 16:39:10 2022 +0100
Branches: temp-T96709-painting-target
https://developer.blender.org/rB66d0b1b5c34a68e65ac451699690382c4ee1136d
Update poll function.
===================================================================
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 a778cc24425..be62784bb52 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2225,8 +2225,20 @@ class VIEW3D_PT_tools_paint_canvas(View3DPanel, Panel):
@classmethod
def poll(cls, context):
+ if not context.preferences.experimental.use_sculpt_texture_paint:
+ return False
+
+ if context.active_object is None:
+ return False
+
brush = context.tool_settings.sculpt.brush
- return (brush is not None and context.active_object is not None)
+ if brush:
+ return brush.sculpt_tool in [
+ 'PAINT',
+ ]
+
+ # TODO: check active tool... but when migrating to paint mode this might not be needed.
+ return True
def draw(self, context):
layout = self.layout
More information about the Bf-blender-cvs
mailing list