Page MenuHome

Sculpt/Paint: Move Elastic Deform Kelvinlets to BKE
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Nov 20 2019, 6:11 PM.
Subscribers
None
Tokens
"Like" token, awarded by MetinSeven."Like" token, awarded by gobb_blend."Love" token, awarded by franMarz."Love" token, awarded by andruxa696."Love" token, awarded by Brandon777."Love" token, awarded by pablovazquez."Love" token, awarded by antoniov."Love" token, awarded by mendio.

Details

Summary

With this patch it should be possible to share the same deformation
formulas that are used in the Elastic Deform brush with other areas of
Blender such as Grease Pencil or proportional editing.

This also removes a lot of code from sculpt.c that is not direclty
related to sculpting.

Diff Detail

Repository
rB Blender
Branch
klv-refactor (branched from master)
Build Status
Buildable 5731
Build 5731: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested changes to this revision.Nov 22 2019, 12:48 PM
Jeroen Bakker (jbakker) added inline comments.
source/blender/blenkernel/BKE_kelvinlet.h
38

Use a define for '3' for example KELVINLET_MAX_ITERATIONS

source/blender/blenkernel/intern/kelvinlet.c
45

use const for parameters that are not changed. This makes it easier for developer to understand and compilers to optimize.

45

it => num_iterations

45

Use more descriptive parameters for r_e, kvl, r. Currently you need to read the code and papers in order to understand what you need to pass.

for example it => num_iterations, r => radius.

51

use pow2f

56

use pow2f and pow3f

57

use pow2f

58

use pow3f

63

add const where applicable.

64

more descriptive names

65

add const

77

same

79

same

91

const

93

const

99

pow2f also in the next 4 lines

112

use typedef to define the function pointer

138

use floats

153

const

154

const, pow2f

155

const, pow3f

156

pow2f, pow5f (needs to be added to math base)

180

const, pow2f, pow3f, pow5f

you got the drill :-)

This revision now requires changes to proceed.Nov 22 2019, 12:48 PM
Pablo Dobarro (pablodp606) marked 23 inline comments as done.
  • Review update
Jeroen Bakker (jbakker) requested changes to this revision.Nov 26 2019, 12:43 PM
Jeroen Bakker (jbakker) added inline comments.
source/blender/blenlib/intern/math_base_inline.c
63 ↗(On Diff #19788)

this is pow6f, use pow4f(x) * x

This revision now requires changes to proceed.Nov 26 2019, 12:43 PM
Pablo Dobarro (pablodp606) marked an inline comment as done.
  • Fix pow5f
This revision is now accepted and ready to land.Nov 27 2019, 9:01 AM