Page MenuHome

Sculpt: Cloth brush
Needs ReviewPublic

Authored by Pablo Dobarro (pablodp606) on Wed, Jan 29, 9:40 PM.
Tokens
"Love" token, awarded by dougbarbosa."Burninate" token, awarded by eyalmu."100" token, awarded by LahceneB."Love" token, awarded by saf."Love" token, awarded by brilliant_ape."Love" token, awarded by Batty."Pterodactyl" token, awarded by Way."Love" token, awarded by ebarranco."Love" token, awarded by maximeneko."Love" token, awarded by intracube."Love" token, awarded by ThomasR."Burninate" token, awarded by Samuel_Mezger."Love" token, awarded by ruthwikrao."Love" token, awarded by mewraid."Yellow Medal" token, awarded by wam3d."Love" token, awarded by ThomasJohann."Burninate" token, awarded by amonpaike."Love" token, awarded by dgsantana."Love" token, awarded by billreynish."Love" token, awarded by Shimoon."Love" token, awarded by TerraformTrent."100" token, awarded by sami_yanezcarbonell."100" token, awarded by Tetone."Love" token, awarded by theRAIN."Love" token, awarded by Yegor."Like" token, awarded by Constantina32."Pirate Logo" token, awarded by shader."Love" token, awarded by vignette."100" token, awarded by mywa880."Love" token, awarded by BlenderRoot."Burninate" token, awarded by RoseKolodny."100" token, awarded by Onion_Samurai."Love" token, awarded by Dspazio."Burninate" token, awarded by dcvertice."Party Time" token, awarded by VaguelyButter."Love" token, awarded by jmztn."Love" token, awarded by Ravenman13."Love" token, awarded by tushantin."Burninate" token, awarded by sopranoo."100" token, awarded by Frozen_Death_Knight."Love" token, awarded by evilvoland."Love" token, awarded by christianclavet."Love" token, awarded by georg."Love" token, awarded by Alrob."Love" token, awarded by nacioss."Love" token, awarded by thomas_p."Love" token, awarded by symstract."100" token, awarded by 616."Burninate" token, awarded by Spatz."Burninate" token, awarded by slowburn."Love" token, awarded by imad_mss."Love" token, awarded by user1."Love" token, awarded by ilia_kole."Love" token, awarded by kynu."Love" token, awarded by Alex_Andr."Love" token, awarded by Noss."Like" token, awarded by hitrpr."Burninate" token, awarded by Slir."Love" token, awarded by RodDavis."Love" token, awarded by icappiello."Love" token, awarded by andruxa696."Party Time" token, awarded by franMarz."Love" token, awarded by 0o00o0oo."Love" token, awarded by RC12."Love" token, awarded by klutz."Burninate" token, awarded by Ztreem."Love" token, awarded by tiagoffcruz."Love" token, awarded by VertexPainter."Love" token, awarded by vitorbalbio."Love" token, awarded by astrand130."Love" token, awarded by SavMartin."Love" token, awarded by asmitty."Like" token, awarded by slumber."Burninate" token, awarded by LapisSea."Dat Boi" token, awarded by monio."Burninate" token, awarded by fin.eskimo."Love" token, awarded by wilBr."Love" token, awarded by pablovazquez."Mountain of Wealth" token, awarded by Brandon777."100" token, awarded by TheRedWaxPolice."Love" token, awarded by xrg."Mountain of Wealth" token, awarded by satishgoda."Love" token, awarded by Rusculleda."Love" token, awarded by SteffenD."Love" token, awarded by belich.

Details

Summary

This brush has a simple physics solver that helps when sculpting cloth
(which is one of the hardest things to do in any sculpting software).
The mass and the damping of the simulation properties of the brush.
It has 4 deformation modes that control how the forces are created.

The brush can create the constraints only on the required PBVH nodes, so
it should be easy to isolate the simulation on high poly meshes. As long
as the brush size is not too big it should be possible to keep it real
time.

Known issues:

  • The way constraints are created is extremely basic and it creates repeated constraints. Maybe there is another way to create fewer constraints while keeping the simulation quality decent. This part can also be multithreaded. (As it is it works ok, but it could be better)

Diff Detail

Repository
rB Blender
Branch
sculpt-cloth-brush (branched from master)
Build Status
Buildable 6677
Build 6677: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Im sorry, i new on this site. How install that? Pls tell me, this looks so cool!

  • Cleanup
  • Fix crash with anchored and drag dot stroke types
  • Change how pinch point works with plane falloff
  • Better grab deform type
  • Add plane falloff preview

  • Display simulation limits when sculpting outside them
  • Configure the brush strength for expand and the rest of the deform types
Ruthwik (ruthwikrao) rescinded a token.
Ruthwik (ruthwikrao) awarded a token.
Way awarded a token.Sat, Feb 8, 9:25 AM
saf awarded a token.Thu, Feb 13, 8:35 PM
saf rescinded a token.
saf awarded a token.
saf added a subscriber: saf.Thu, Feb 13, 9:06 PM

@Jeroen Bakker (jbakker) we are dying for having your Ok to thiiiis :D

Im sorry, i new on this site. How install that? Pls tell me, this looks so cool!

I'd love to try this out as well! I looked for it in the 2.83 alpha but can't find it.

@User (BlenderRoot) @Ryan Whearty (weirdy)

apply changes in a revision to the working copy with arc patch
download a patch from Differential with arc export

https://secure.phabricator.com/book/phabricator/article/arcanist/

Or simply apply this https://dev-files.blender.org/file/data/bahc4migqsjkkvrcz2ph/PHID-FILE-kakjzxzwccokkvgpxuhi/D6715.diff to your build using git. (top right corner > download raw diff)

Jeroen Bakker (jbakker) requested changes to this revision.Mon, Feb 17, 4:50 PM

I did an initial review. will need to go into more depth.

I would suggest to add a sculpt_cloth.c and forward declarations in sculpt_intern.h so we can split the brush code a bit. The common functions like calc_sculpt_plane we can put in a sculpt_common.c.
We should use SCULPT_ for these functions to make sure the strings are unique.

Note. How useful is it to add the scene dimensions to the simulation.

source/blender/blenkernel/intern/brush.c
1024

merge with the line above

source/blender/editors/sculpt_paint/paint_cursor.c
1290

missing static?

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

typo

4289

use floats; I see you copied this function from below.

4331

r_area_co could still be uninitialized at this point. best to initialize it before use.

This revision now requires changes to proceed.Mon, Feb 17, 4:50 PM
Pablo Dobarro (pablodp606) marked 5 inline comments as done.
  • Rebase
  • Review update
  • Refactor: Move cloth brush to its own file

@Jeroen Bakker (jbakker) I moved all the code of the cloth brush to its own file and rename the public functions to use SCULPT_. I did not rename the API functions I needed to move to sculpt_intern.h because doing that would add a lot of unrelated changes to this review. I will do that in a later cleanup patch.
I’m also preparing a plan on how to split sculpt.c into multiple files, I will start by splitting the biggest brushes and tools to their own files after committing this.
Regarding scene scale, there is also the Elastic Deform brush which works with physics and real world units, so probably we need a more general solution and not just something for this brush. For what I saw, it seems that the strength and mass values are enough to control the brush in most cases with different scales.