Page MenuHome

Fix Cloth Brush grab deformation mode
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Sat, May 16, 8:42 PM.
Tags
None
Subscribers
None
Tokens
"Yellow Medal" token, awarded by Tetone."Burninate" token, awarded by gilberto_rodrigues."100" token, awarded by Frozen_Death_Knight."Love" token, awarded by Artsolit."Love" token, awarded by franMarz."Love" token, awarded by Brandon777."Love" token, awarded by andruxa696.

Details

Summary

The grab mode was not correctly implemented, so the way it was working
was confusing for users.

  • Grab delta was calculated in increments from the last stroke position, so it did not match the behavior of a grab brush. I refactored the grab delta calculation to make this change more explicit.
  • Grab displacement was not calculated from the original coordinates
  • Grab was using an incorrect strength

Grab is now setting the position of the affected vertices directly and
the constraints solve the rest of the cloth. I also tried to implement
an alternative version based on applying forces to move the vertices to
the grab position, but I think this is more controllable and the grab
falloff can be adjusted by tweaking the simulation falloff.

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Sat, May 16, 8:42 PM
Pablo Dobarro (pablodp606) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Mon, May 18, 9:23 AM

Some weird looking early return.

In the future you should consider splitting refactor from functional changes. Makes it easier to follow and verify actual functional changes.

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

In the new code I would strongly advocate for use of the entire word: object, mesh, brush.

6210–6212

This check seems to happen in several places. You could have something like:

BLI_INLINE bool sculpt_is_cloth_deform_brush(Brush *brush)
6225

Is this a debug only, or is it an intentional behavior?

This revision now requires changes to proceed.Mon, May 18, 9:23 AM
Pablo Dobarro (pablodp606) marked 3 inline comments as done.
  • Review update

From reading seems fine and clear.

Again, currently no time to do good user level test sorry, is on you, no pressure ;)

This revision is now accepted and ready to land.Tue, May 19, 3:30 PM
This revision was automatically updated to reflect the committed changes.