Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Context not available. | |||||
| class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel): | ||||
| bl_context = ".weightpaint" # dot on purpose (access from topbar) | # dont give context on purpose to not show this in the generic header toolsettings | ||||
| # this is added only in the gradient tool's ToolDef | |||||
| #bl_context = ".weightpaint" # dot on purpose (access from topbar) | |||||
| bl_label = "Falloff" | bl_label = "Falloff" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| from bl_ui.space_toolsystem_common import ToolSelectPanelHelper | |||||
| tool = ToolSelectPanelHelper.tool_active_from_context(context) | |||||
| settings = context.tool_settings.weight_paint | settings = context.tool_settings.weight_paint | ||||
| brush = settings.brush | brush = settings.brush | ||||
| return brush is not None | return brush is not None and tool.idname == "builtin.gradient" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Context not available. | |||||