Page MenuHome

Sculpt: Clay Strips Roundness property
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Oct 31 2019, 9:11 PM.
Subscribers
None
Tokens
"Like" token, awarded by Constantina32."Love" token, awarded by EAW."Love" token, awarded by S_Jockey."Love" token, awarded by tiagoffcruz."Doubloon" token, awarded by TheAngerSpecialist."Like" token, awarded by MetinSeven."Love" token, awarded by Tonatiuh."Yellow Medal" token, awarded by Alrob."Love" token, awarded by Dusty_Shoe."Love" token, awarded by Maged_afra."Love" token, awarded by monio."Love" token, awarded by Frozen_Death_Knight."Love" token, awarded by Brandon777.

Details

Summary

This patch allow to change the brush tip shape between a square and a
circle using a brush property.

After this change we are no longer testing the distance against a cube
(the Z axis is not used). I did not test this in depth, but if it does
not produce any artifacts I think we can keep it this way instead of
adding more complexity to the code.

Diff Detail

Repository
rB Blender
Branch
clay-strips-roundness (branched from master)
Build Status
Buildable 5884
Build 5884: arc lint + arc unit

Event Timeline

Do we need to add migration code. Seems like the setting is set to 0.25f I expected some sort of migration code.

  • Add versioning code
  • Rebase
  • Update defaults
  • Rename clay_strips_tip_roundness to tip_roundness

This property and test can also be used to improve some other brushes and tools (like the paint brush), so that name does not make sense.

  • Redesign brush test

I was testing this brush tip test in the sculpt vertex colors paint brush and I decided to change how it works. The falloff was previously applied from the center of the square, so it produces these kinds of artifacts if the falloff is not constant. This may be acceptable in the clay brush as the artifacts can be hidden using a custom falloff or autosmooth, but it is not acceptable in the alpha of the paint brush.



With the new test implementation, the falloff is only applied only on the round part of the brush. With this test, we can use the smoother curve falloff which has 0 derivatives in 0 and 1, making the transitions perfectly smooth while keeping the brush tip shape editable.


With this modification, the round clay strips brush is way smoother than the square one, but that will be also controllable after adding the hardness property (I can add it to this patch if you want to).

  • Keep the size of the brush tip when changing from square to circle
Jeroen Bakker (jbakker) requested changes to this revision.Jan 7 2020, 3:35 PM

Just the regular small comments.

source/blender/blenloader/intern/versioning_280.c
4276

This seems to be different than the default
br->tip_roundness = 0.18f;

source/blender/editors/sculpt_paint/sculpt.c
1115

const float roundness

1154

Use true/false for booleans

source/blender/makesdna/DNA_brush_types.h
333

Would be good to give it a comment explaining the unit of this. Is it a factor?

This revision now requires changes to proceed.Jan 7 2020, 3:35 PM
Pablo Dobarro (pablodp606) marked 3 inline comments as done.
  • Review update

I accept this patch. Knowing that we still need to add more options to the brush for better working. You can better decide when to add this to master.

This revision is now accepted and ready to land.Jan 7 2020, 4:52 PM