Page MenuHome

Sculpt/Paint: Move Elastic Deform Kelvinlets to BKE
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Wed, Nov 20, 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

Event Timeline

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

Use a define for '3' for example KELVINLET_MAX_ITERATIONS

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

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

46

it => num_iterations

46

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.

52

use pow2f

57

use pow2f and pow3f

58

use pow2f

59

use pow3f

64

add const where applicable.

65

more descriptive names

66

add const

78

same

80

same

92

const

94

const

100

pow2f also in the next 4 lines

113

use typedef to define the function pointer

139

use floats

154

const

155

const, pow2f

156

const, pow3f

157

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

181

const, pow2f, pow3f, pow5f

you got the drill :-)

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

this is pow6f, use pow4f(x) * x

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