Page MenuHome

Weightpaint Gradient tool: expose falloff to the UI
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Sep 23 2021, 3:51 PM.

Details

Summary

By default, we'll always get a falloff like this from the tool:

But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:


Custom:

The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
WPGradient_userData].
However, it does not have an entry in eBrushWeightPaintTool and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).

So in order to expose the brush curve in the UI, we would have to do one
of the following:

  • [1] try to use VIEW3D_PT_tools_brush_falloff, for this to work:
    • make all kinds of exception in python super classes [FalloffPanel,

BrushPanel, UnifiedPaintPanel, ... -- including making real entries
in eBrushWeightPaintTool] to get a proper tool mode and...

  • .. to also make sure Falloff Shape and Front-Face Falloff are not

available [which the tool seems to just not support in its current form]

  • [2] just have a simple, contained panel for this tool alone

This patch implements [2] and adds it as part of the ToolDef (could also
be done in VIEW3D_HT_tool_header, but again, I think this is nice to
keep separate from the usual tools)


Testfile:

Fixes T91636

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Sep 23 2021, 3:51 PM
Philipp Oeser (lichtwerk) created this revision.
Campbell Barton (campbellbarton) added inline comments.
release/scripts/startup/bl_ui/space_view3d_toolbar.py
716–721

We could consider a template for this block.

This revision is now accepted and ready to land.Sep 24 2021, 8:19 AM