diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index 2c67a68d3bd..57697a1147f 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -983,6 +983,9 @@ class VIEW3D_HT_header(Header): canvas_source = tool_settings.paint_mode.canvas_source icon = 'GROUP_VCOL' if canvas_source == 'COLOR_ATTRIBUTE' else canvas_source row.popover(panel="VIEW3D_PT_slots_paint_canvas", icon=icon) + # TODO: Update this boolean condition so that the Canvas button is only active when + # the appropriate color types are selected in Solid mode, I.E. 'TEXTURE' + row.active = is_paint_tool else: row.popover(panel="VIEW3D_PT_slots_color_attributes", icon='GROUP_VCOL') diff --git a/scripts/startup/bl_ui/space_view3d_toolbar.py b/scripts/startup/bl_ui/space_view3d_toolbar.py index 07dd226dc88..dc548b85f4c 100644 --- a/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -607,7 +607,20 @@ class VIEW3D_PT_slots_paint_canvas(SelectPaintSlotHelper, View3DPanel, Panel): tool = ToolSelectPanelHelper.tool_active_from_context(context) if tool is None: return False - return tool.use_paint_canvas + + is_paint_tool = False + if tool.use_brushes: + brush = context.tool_settings.sculpt.brush + if brush: + is_paint_tool = brush.sculpt_tool in {'PAINT', 'SMEAR'} + else: + # TODO: The property use_paint_canvas doesn't work anymore since its associated + # C++ function 'rna_WorkSpaceTool_use_paint_canvas_get' passes in a nullptr for + # the bContext. This property should be fixed in the future, but will require + # some extensive refactoring. For now, use the workaround above. + is_paint_tool = tool.use_paint_canvas + + return is_paint_tool def get_mode_settings(self, context): return context.tool_settings.paint_mode