Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel): | ||||
| # dont give context on purpose to not show this in the generic header toolsettings | # dont give context on purpose to not show this in the generic header toolsettings | ||||
| # this is added only in the gradient tool's ToolDef | # this is added only in the gradient tool's ToolDef | ||||
| #bl_context = ".weightpaint" # dot on purpose (access from topbar) | #bl_context = ".weightpaint" # dot on purpose (access from topbar) | ||||
| bl_label = "Falloff" | bl_label = "Falloff" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| # also dont fraw as an extra panel in the sidebar (already included in the Brush settings) | |||||
campbellbarton: Typo `fraw` also use capitals & fullstops. | |||||
| bl_space_type = "TOPBAR" | |||||
campbellbartonUnsubmitted Not Done Inline ActionsSingle quotes for enums (elsewhere in this patch too). campbellbarton: Single quotes for enums (elsewhere in this patch too). | |||||
| bl_region_type = "HEADER" | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | 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 | settings = context.tool_settings.weight_paint | ||||
| if not settings: | |||||
| return False | |||||
campbellbartonUnsubmitted Not Done Inline ActionsPrefer if settings is None: done elsewhere in this file. campbellbarton: Prefer `if settings is None:` done elsewhere in this file. | |||||
| brush = settings.brush | brush = settings.brush | ||||
| return brush is not None | return brush is not None | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| settings = context.tool_settings.weight_paint | settings = context.tool_settings.weight_paint | ||||
| brush = settings.brush | brush = settings.brush | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
Typo fraw also use capitals & fullstops.