Page MenuHome

Sculpt: Fix when using Shift+LMB shortcut and operator can't find the target brush
Needs ReviewPublic

Authored by Juanfran Matheu (jfmatheu) on Thu, Jan 2, 12:32 PM.

Details

Summary

The Issue:

When shift+left mouse shortcut is used in sculpt (or any other configured using 'sculpt.brush_stroke') and

sculpt_update_cache_invariants

can't find the brush by the name (the name of the target brush has been changed eg. "Smooth" brush is now called "Smoother") :

  1. You are unable to use the smooth brush
  2. The radius is set to 1px causing an annoying effect for users

EXAMPLE:

This patch fixes all this when user renames the target brush that is specified in code.

Diff Detail

Event Timeline

Juanfran Matheu (jfmatheu) edited the summary of this revision. (Show Details)

Now it searches for an alternative smooth brush when "Smooth" brush isn't available or is renamed.

Juanfran Matheu (jfmatheu) retitled this revision from Sculpt: Fix radius set to 1 when using 'sculpt.brush_stroke' operator and can't find the target brush to Sculpt: Fix when using 'sculpt.brush_stroke' operator and can't find the target brush.Thu, Jan 2, 2:41 PM
Juanfran Matheu (jfmatheu) retitled this revision from Sculpt: Fix when using 'sculpt.brush_stroke' operator and can't find the target brush to Sculpt: Fix when using Shift+LMB shortcut and operator can't find the target brush.
Antonio Vazquez (antoniov) added inline comments.
source/blender/editors/sculpt_paint/sculpt.c
6439

You assume br is not NULL. It would be better to keep the if (br) {of the old code.