Sculpt Branch Status Report

This blog post is about the new main features that were added to the sculpt-mode-features branch in the last 3 months, as well as my opinion on how to merge these features into master.

New Features

Brush cursor, normal radius and curve presets

New brush cursor, scrape brush with 0.2 normal radius

The patch of the sculpt cursor which follows the surface has been around for a while (D3594). It can work either by sampling the real normal of the sculpting operation or by using the normal of a single face. The normal sampling code is disabled when a sculpt stroke is active, so it should not affect performance. The cursor is also responsible for updating and displaying the active vertex (more on that later) across all the enabled symmetry axis in real time, with radial symmetry and tiling support.

The normal radius property limits the radius of the sampling sphere that is used to calculate the normal and the area center. It affects how closely the brush will follow the surface of the sculpt, but in some other brushes it produces some desirable effects. By tweaking this value, you can use the scrape brush to sculpt hard surface, which was not possible before.

I also added another brush which always applies the deformation on top of the original coordinates, useful for making insertions or creases in a much easier way. On top of that, you can now use the same curve presets that were used in edit mode proportional editing for the brush falloff. These curves produce a more pleasing deformation than the defaults that are shipped with the brush falloff editor right now. This also fixes the deformation issue with the grab brush when using the current default curve preset.

Old and new grab brush smooth falloff preset

Voxel remesher

Voxel remesh operator

The voxel remesher uses an OpenVDB level set to generate a new manifold mesh from the current geometry (it does not actually use voxels, but I thought that this concept is easier to understand as it is related to volume). The operator can be executed from both sculpt mode and object mode, and it is fast enough that it also was added to the remesh modifier, including OpenVDB filters and volume based CSG operations (done by Martin Felke).

This OpenVDB operation is ideal for sculpting. It produces a mesh with perfectly even distributed topology and it does not have any performance penalty once the new mesh is calculated. Thanks to this new workflow it should now be possible to sculpt at a much higher level of detail than it was possible before with dyntopo, even if the resulting mesh has more vertices. It also supports vertex color and paint mask reprojection, so it is possible to keep the colors of the model while blocking its shapes. Besides sculpting, this new OpenVDB mesh operations can also be used for 3D printing and simulations.

With the new concept of a static remesher in Blender is now easy to add other external libraries for different use cases, like Quadriflow for automatic retopology.

Sculpt vertex colors

Sculpt vertex colors and remesh color reprojection

This new type of color data is stored in the model the same way the sculpt mask is. By doing this, I was able to reuse all the optimizations and features from sculpt mode. This brings a huge performance improvement to vertex paint, the ability to sculpt and paint at the same time and more maintainable code. The undo code was also tweaked to support color data and color + deformation data and I ported some tools from vertex paint to this system, like the color picker and the paint brush. In the future, the code from vertex paint could be replaced internally with this system without any changes in the UI.

The only problem with this new approach is that the new vertex paint data is stored on the vertices and the old one was stored on the face corners. The old system allows to have a different color per face, and the new system does not (unless you duplicate the vertex). This data incompatibility may result in data loss for some users working with low poly models. In order to avoid that, the sculpt branch has the two systems in place and I added two operators to convert the color data between them. For this reason, the new vertex colors are not connected to the renderers, so you can’t use them in real time from EEVEE/lookdev, neither previewing them in workbench without copy the layer first to a regular vertex color layer.

Mesh, mask and colors filters

Mesh and color filter tools

The purpose of these tools is to apply an operation to all the vertices of the mesh as the same time, taking the mask into account. Internally, they are quite similar to brushes (some of the code is shared, like smoothing). Having these tools can save you a lot of time, and they are crucial for certain workflows.

Mesh and color filters discard totally masked PBVH nodes before starting, so they are quite fast when working with high poly meshes when they are partially masked. This approach does not make sense for the mask filter, so it is considerably slower. In general, updating all the nodes of the PBVH constantly for real time tweaking is not a fast operation, so these tools may become a lot faster in the future.

Transform tool

Transform tool

Internally, the transform tool is just a mesh filter controlled by the transform code and gizmo. The SculptSession now has a pivot point with position, rotation and scale. This point is transformed by the standard Blender transform code and all vertices of the sculpt are updated accordingly in parallel, using the same code as the mesh filter. This approach has some limitations (individual snapping from every vertex, for example), but it allows you to work with meshes that are impossible to handle in edit mode. On top of that, some new symmetry code was added to calculate the vertex transformations accordingly.

In order to position the pivot I added an operator which includes several options (pivot to center, to unmasked area, to active vertex…) and which also takes symmetry into account. I would like to add an option to transform the pivot only without affecting the sculpt, but without seeing the gizmos when a transform operation is active it would not be that useful (this is a planned feature, so it should be supported in the future).

Mask expand operator and transform rotate tool

I also added the mask expand operator, which was specifically designed to be used with the rotate tool to create a pose tool. It expands a mask from the active vertex as you drag the cursor, following the topology of the model. After the operation is done, the pivot is updated automatically to the corresponding rotation center. This tool is quite fast, all the iterations are cached as soon as you invoke the operator, so it just needs to check which vertices are masked for a certain iteration when updating the preview.

Automasking and mask generators

Mask by normal operator and mask filters

The original idea was to have a system which enables the user to stack multiple masking operators. For example, you should be able to affect only connected vertices, which are not part of an open edge and with 50% influence to cavities. Right now this system has the topological and the open edge masking implemented, but the UI is not ready and you can only enable them separately with a checkbox. Despite that, you can already use the grab brush with topological masking, which was a highly requested feature.

I also added several operators to generate masks automatically. Mask by color generates a mask based of the color of the active vertex. Mask by normal generates a mask limited by the angle between the normal of two connected vertices. This is useful for selecting “faces” on hard surface sculpts. I still need to find a way to solve the big UI problems these two operators have. They only can be invoked from the keymap, as they need the cursor to be visible and to be over the sculpt. Also, you can’t adjust the threshold of the masking operation from the undo panel, so you need to change the values for the operator from the keymap before running it.

Other features

Relax brush
  • Option to control the mask opacity (already in master).
  • Option for the lasso mask tool to ignore back facing vertices.
  • 2D viewport navigation, which helps to keep the working area under control when working with brushes, as well as giving a more predictable zoom speed when using a pen tablet.
  • The distance that is used to generate new brush steps can now be measured both in screen space and in world space.
  • Relax brush tool, which distributes the topology automatically without affecting the volume of the model.

Merging the branch

If you have tried the sculpt-mode-features branch, you may have noticed a quite obvious bug: almost none of the new features work with the multires modifier or with dyntopo enabled. They may be disabled, or they may crash Blender.

Internally, sculpt mode has 3 different modes, FACES (when you are sculpting on a mesh), GRIDS (when sculpting on any of the levels of the multires modifiers) and BMESH (when dyntopo is enabled, it does not matter if it is modifying the topology dynamically or not). The interface hides this complexity, but when you change between dyntopo, multires or meshes, you are using a totally different data structure, undo stack and rendering code. You can think of it as supporting 3 totally different sculpt modes at the same time. This is why some bugs are specific to a mode and why they have noticeable performance differences.

Most of the brushes are implemented using a pbvh_vertex_iter helper which acts as an abstraction layer for the 3 systems. This works for most of the brushes, but for example, the smooth brush (which needs topology information from the mesh) needs 3 different implementations in order to work with the 3 modes (you can check the smooth() function of sculpt.c).

All the new features of the sculpt-mode branch rely heavily on topology information and a static mesh data structure, like the smooth brush, but they are way more complex. Supporting dyntopo and multires is not about laziness or feature polishing, it is about avoiding an insane code triplication all over sculpt mode.

That said, here are some options to merge the branch into master:

Merge the branch as it is now, without dyntopo and multires support

This may be doable for 2.81 – 2.82, but it will lead to the deprecation of dyntopo and multires sculpting. All the new features will be disabled from the interface when those modes are enabled, so they will start falling way behind in terms of functionality. Sure, we can support those modes triplicating the code for all the tools and operators, but it is not a problem about how much work could it take, it is about code maintenance. There is already plenty of bugs in the tracker specifically related to dyntopo and multires sculpting with the current code and continuing the development this way would make the problem even worse. In my opinion, doing this is an irresponsible decision.

Make an abstraction layer for the current modes to support the new tools

This is how most of the brushes work right now. The pbvh_vertex_iter functions let you modify the vertex coordinates of a mesh with the same code, no matter if the PBVH type is GRIDS, FACES or BMESH. We could try to add more functions to expose topological information and a ‘fake’ static geometry in order to make the new tools work. This could potentially have a performance impact and it will add some new hacks to the sculpting code. Also, I don’t know if this is really possible with the current code design or if all new tools can be supported in all modes after doing this.

Make a new data structure from scratch designed for sculpt mode

Now we have a working Blender version with most of the features that a modern digital sculpting application should have. This information should help us to make a new design for the internals of sculpt mode, without all the code duplication and hacks that Blender has now. All the new tools would be supported, and hopefully, with much better performance. This project should also try to fix bigger issues Blender sculpting has, like multires detail propagation, waiting times when switching modes, dyntopo performance and geometry errors.

This is not an easy task, and it will probably take several versions to get this ready for master before any of the tools can be ported. You can think of this process like going from the pbr-viewport branch to the draw manager and EEVEE. In the meantime, the current sculpt-mode-features branch could be supported as well, as some tools it has are crucial for some people’s workflow.

There are some features in the branch which don’t depend on the internal sculpt modes and data structure. Those features can be merged at any time, as soon as they are reviewed. This includes:

  • Sculpt cursor and normal radius (the cursor needs some code duplication to make it work, but that was already done)
  • Brush curve presets
  • OpenVDB voxel remesher/Quadriflow (it may have some issues with the current undo system)
  • 2D viewport navigation
  • A slower version of the transform tool (needs to be redone

This project was never about adding fancy features to Blender for the sake of adding features. In my opinion, this is the most basic functionality any sculpting software should have. I started coding these tools because I needed them to make my portfolio, so my priority was having everything working as soon as possible. The main blocking issue for merging this is not the number of features that were added (they are actually not that complex), is that Blender sculpt mode code was not designed to support this properly. Making a new design or bigger changes was way beyond my skills when I started the project, so the options were doing everything on top of the current design or keep waiting until someone changes it while making feature requests. I don’t know how long would it take to make a plan to merge everything into master, but I know that the workflow of a lot of artists already depends on this branch. I will try to keep supporting this branch until merge happens, updating it to master and adding the few remaining features I had initially planned.

Pablo

60 comments 28,933 Views
  1. You’re the best Pablo!
    I’m not knowledgeable enough about the subject to contribute anything meaningful, but I want to say that I trust you on this. I’m also curious to hear everyone’s opinions!

  2. I hope that dev fund money can be put aside to address sculpt mode internals, but meanwhile, I´d happily use the sculpt branch as long as it´s synched with master and my addons work 🙂

  3. Awesome work Pablo, i want to ask about performance will this banch have improvements that could help blender in general? and if there is any plans to make it happen in the near future even if it means making it from scratch…thanks.

  4. As this stands as a work from your iniciative alone, once I believe you’re not exactly part of the dev fund money, I believe that these changes should go into master as soon as possible because they’re already really, really good to be lost in the case of you abandoning the project for some reason.

  5. Good work Pablo ! what you did is amazing

    What are the thaughts of the BF on this ? is sculpting tool a priority for them ? ( i’m asking because Ton want to focus on rigging & animation )

    • Improved sculpting is something we want to work on once 2.80 is released, starting with integrating features from the sculpt mode branch that are close enough to ready. It’s not just Animation & Rigging that are a priority, see here for the last update on this:
      https://code.blender.org/2018/12/blender-development-fund-projects-for-first-half-2019/

      • Does that mean you want to start with integrating things that don’t depend on the internal sculpt modes and data structure? or does that mean any feature close to ready? even if its a “hack” job?

        • We would start with features that don’t depend on the sculpt mesh data structures. And if it’s a hack job, we would not consider it close to ready.

  6. First of all awesome work, the improvements are great and really fast, i really like the remesh workflow, it is a big improvement.
    Secondly, I would ask you if you consider to expand the transform tool with some of the options from the LinearDeformer from MiraTools https://blenderartists.org/t/miratools/637385 bend, bend spiral, twist and tape would be a great addition imo.
    thanks for all.

  7. Pablo, how possible would it be that you use your branch in a non-cut video version for a human stylized sculpt (like the ones you show on your twitter account) but with your voice over?
    It doesn´t have to be perfect, or edited. Just upload the 3 -4 hours but narrating the tools you use. I would completely watch it non-cut, because this is an amazing implementation branch to blender. Thanks!

  8. Looks beautiful. There is a layer of quality to everything I’m beyond impressed. Thank you everyone.

  9. I would go with “Make a new data structure from scratch designed for sculpt mode”.
    Yes its going to take longer but in the long run its a lot better for further improvement, something like bmesh, back in the day it took several long long long versions for bmesh to be merged in master, an a few different attempts if i remember properly, but it bring a lot of benefits long term.

  10. Hi, Pablow Is it possible to support your work to help the branch development?

  11. I’m all for the third option. Having a unified, well thought out, and specifically put-together sculpting mode in Blender with better performance and a straightforward, compatible toolset would be really great. Merging the tools now seems like it will only create confusion for newer artists since some things just won’t work while other things are active. Also, the depreciation of dynotopo and other important aspects of sculpt mode seems like it could seriously hurt the overall development of sculpting in blender (I could be wrong about this though).

    The third option is obviously the easiest to choose, since it seems like it’s just best of both worlds, but I believe the extra time/effort required would be worth it, and especially worth the Blender Org’s investment.

    Thanks so much for all your work on this Pablo, I’d like to know of a way to support your project as well.

  12. Wow man, great read, I do not know anything about sculpting but your work and others peoples engagement with it speak for itself.
    kudos to you, I hope that the rewriting of the culpt code that you propose is something that can be done they way you’re proposing, because we’re in for the long run, and maybe in the process it serves you well to plan for the future!.

    again best to you, you got my vote!

  13. This work is amazing. Digital sculpting is hugely popular and bringing this level of functionality to the blender would be an amazing accomplishment.

    How can we fund this directly? I love digital sculpting and would love to support some kind of official code quest specifically to update blenders sculpting tools and get them into master ASAP!

  14. Since 2D wiewport navigation isn’t tied to the sculpting module we’d get to use it with Greasepencil animation right?

  15. Amazing work!
    Never interested in such stuff, but now I want to try this out as soon as possible!
    I hope, one day we will see this in master branch!

    Keep this up!

  16. Very nice work!

    As for your suggestions on how to merge these tools into Master, wouldn’t it be possible to go for option 1, and then just solely focus on option 3 to fix the underlying issues? To me it is pretty obvious that option 3 is the best course of action if Blender is ever going to have powerful tools to do professional sculpting down the road. However, I would still like to play around with the tools you’ve already added until option 3 is resolved, since some of these improvements are just too good not to be able to use for possibly years.

    Anyway, if that is not feasible, please focus on option 3. Simplifying the coding aspect to make every tool work nice with each other will make improvements for the Sculpt Mode a lot faster in the long run.

    Again, thanks for all your hard work! I’m really excited to see what more you have in store for us. 🙂

    • Indeed, perhaps it could be made an exclusive choice between the current system and this system, and a user can opt in for one or the other in the Blender user preferences. That way there is nothing confusing about the UI, and it can stay hidden to avoid confusion for any users that are missing features. The setting that enables this in place of the current system could provide a description that warns users of the incompatibility and disabled features. But it’s a good way to keep these either-or features in the main program without having to download updates every day from GraphicAll and it would then be less work to maintain this branch by taking on the laborious task of keeping it synced with master. But implement it in a way that is designed to be easily stripped out once the option 3 overhaul can be completed.

  17. what could be cool in scuplt is a volume memory with maybe like some shapekeys to do the transition with a previous volume state. and complementary a brush eyedropper (pressing ctrl) using the depth info on a point, compare to a zone around set with the left clic of the brush and itsr size with the scroll mouse. and an option in the clone brush with the depth information and same thing applied on a zone with an average height…

  18. Just Wonderful Brunch!
    can’t wait to see it in master branch…

  19. Sorry for the ignorant question – is it possible to use this branch already, and if yes how? I’d love to test it!
    Anyway, this work is amazing. You’re literally kicking ZBrush so hard in the balls that they’re gonna roll off a cliff and die. Lol

    • I think in time it will give Zbrush a run for their money. Loooool!

      • i don’t think so, zbrush is far superior in pretty much everything, from performance to powerful features, many tools and how they feel when you use them..etc, zbrush will always have it’s place especially in big productions same with maya ,3ds max and houdini but if blender keeps improving it will be a nice alternative for people who can’t afford them.

        • It’ll happen. It’s just a matter of time.

        • I’d say blender has quite a few areas where it clearly has the advantage but I guess for that kind of use cases it isnt really going to matter as long as the performance is lacking.

    • You can get the builds from rightclickselect/graphicall (might have to look for a bit since there is lots of builds coming out atm)

  20. Thank You Pablo,

    Keep up the good work 🙂

  21. It looks like some priority may need to be placed on the goals of Option 3’s implementation, not only for this branch, but for future sculpting and topology features to come.

  22. Basically the last option is the only real option. But seeing it happen without help and coordination from foundation seems pretty nigh. I sure hope this gets the attention and support it needs :/

    I guess at least the voxel remesher should be fairly certain for 2.81 I guess that is something.

  23. This is the most important. Good job Pablo, this is the thing in Blender Development I’m looking forward to the most!

  24. Would it be possible to vertex paint with a texture?

    AND

    Would it be possible to vertex paint to multiple vertex colour layers with multiple textures at the same time, while also sculpting?

    I’m thinking something along the lines of, imagine a ‘brush’ that has a rock material on it. A seamless PBR material with albedo, displacement, spec, metallic, roughness textures. And as you apply it to the model, it updates all of the vertex colour layers while also effecting the topology with the displacement texture.

    If Blender had a function like that.. artists could work CRAZY fast with that kind of functionality. You could just bash out insanely high detailed models so quickly, then do a quick bake at the end to turn the vertex colours into textures. It would be amazing!

  25. Best Ever.
    I wish blender make one Control Rig for all character .like Maya and MotionBuilder.
    to make character animation so faster…
    MotionBuilder has a “Story” Tab .With this tab you can copy character animation from one character to other characters ,Merge Animations ,change character animation direction, and much more, and It’s so fast and easy.

    • You can do all that with Auto Rig Pro add-on. Transfer character animation by using built in remapper feature. Only thing you would have to export animation as fbx or bvh then import and use remapper. Also, if you are savy write a python script that exports animation via tab or button.

  26. i cant belive that you can do it thanks you and keep up the good work :v

  27. This is awesome. A new mesh data structure like “sculptMesh” would be my vote for integration with a convert to/from option to regular mesh. would support the most features with a clear boundary for users.

  28. Are Vector Displacement Brushes planned at some point?

  29. These improvements look truly amazing, and are long overdue! They’ll help every Sculpt workspace user at a very fundamental level.

    The realist in me however realizes that this is a classic case of the 90/10 rule; the features look to be at the 90% level, but that remaining 10% will actually be 90% of the total work. It very much sounds that Option 3 (maybe Option 2, if it’s possible?) would be necessary for BF to consider merging the most important of these features to Master, but that amount of work will need a concerted effort. Otherwise I fear that these features will be lost to burnout.

  30. i heard Pablo is interested in making a future retopo projects both for Auto & Manual, is that true?what’s the take of Foundation on this!!

  31. That relax brush is a thing of beauty. It holds the form so well. Very, very impressed. There masking brush is super slick. Also. Very very impressed.

    Question.
    I’m a new blender user. Please tell me we can change the z axis to y as a preference or something?

  32. Pablo you are doing a doing a massive job for blender & the community, Beldner foundation should hire ASAP & i hope you say a BIG YES 🙂
    if u ever read this comment then i want to ask for two things, one if we can have a laso hide tool & also if we can get masking to work as passive tools with the possibility to drag in empty space to invert or click to un-mask..that would a killer workflow for us..thank you.

    • sorry for the errors, i meant to say “blender foundation should hire you”, i was so damn excited that i didn’t check before posting 😉

  33. +1 from me for ” new data structure from scratch designed for sculpt mode” & “merging the independent features & many other features like mask extraction, insert mesh, quad remesher, sculpting layers,something like zbrush’s polygroups….etc, Plz Blender Team hire him for so he can work on this for many many years & improve not only the sculpting mode but many other areas too , don’t let this awesome person go away ,especially Pablo is a skilled Artist & a Developer who knows what the best tools & Workflows that users need, if this opportunity is missed then our dreams will be shattered.

  34. Selection highlight for selected part and proper organizing meshes something in the way of zbrush’s tools ,subtools and folder systems taking into account merge, split, bool,extract..etc

  35. Hi guys, i’m new to blender and just started with 2.8 from Cinema 4D. My question is how can i get Sculpt Mode Features? What are the dependencies needed to add on Blender? OpenVDB and things like that is what i hear. Can i get a step by step explanation about how to install?

    Thanks in advance

    • you don’t have to compile it yourself if you don’t want to. There is an up-to-date build that you can just download from https://blender.community/c/graphicall

      The windows sculpt branch:
      https://blender.community/c/graphicall/Tdbbbc/

    • https://blender.community/c/graphicall/dcbbbc/

      First, you need to open the above link, read through and download the file from the pop-up, and unzip when done. When you’re done with that an unzipped folder will show up, then all you need to do is to look for an executable with the name blender, and double click(you are to search for it if you’re having trouble finding it in the unzipped folder).

      **There will also be a link to the documentation in the link, so don’t forget to open that in a separate

      **These “instructions” are supposed to be for windows, but as long as you can get to the link I’ve sent, you should be fine with “them”.

  36. Please, add this to release build.

  37. Blender is Blender!

  38. voxel 1920x1080x1080 xyz plus pixel vertex color = freeddom

  39. Hi Pablo,

    You’re doing a great job, keep it up.

    Some feedback —
    What I’m still really missing in Blender Sculpt Mode is:

    * Topological brushing (but maybe this is already present in the latest Sculpt Mode Features builds?)
    * Better smoothing algorithms that preserve volume.
    * General smoothing functions with the same volume preservation, like Deformation ➔ Polish, Relax and Smooth.
    * An option in Dyntopo to have smoothing (Shift + brushing or when the Smooth tool is activated) also affect topology.
    * A hotkey to easily reapply the last brush stroke (like the ‘1’ key in ZBrush).
    * Polygroups, including polygroup tools such as Polish By Groups, Group By Normals, Auto Groups, Merge Similar Groups, etc..
    * Fast masking, slicing, clipping and trimming using easy on-screen gizmos (line, circle, ellipse, rectangle, etc.)
    * ZRemesher (but [QuadRemesher](https://exoside.com/quadremesher/) will soon be available for Blender)
    * Better OpenVDB or other voxel remesh algorithms implementation (Dynamesh is still better than the current OpenVDB remesh functions in Blender)
    * InsertMesh functions, preferably working like the 3ds Max Autogrid option, so you can add any Blender mesh on the surface normals of a mesh.
    * Easy extraction of a masked area to a new mesh with smoothed edges, like the ZBrush Extract function.
    * Laplacian deformation inside Sculpt Mode, like a blend of rigging and the grab brush. For example: you mask everything but an arm, and can deform the arm with Laplacian volume and shape preservation. [See this video for an example.](https://www.youtube.com/watch?v=oxkf_N-QCNI)

    Thanks again for your work.

  40. I am incredibly enthused about the voxel remesher- I’ve been wanting a volume-based “keep the shape, just slice it up neatly” like that for SO long.

  41. i have installed the new blender 2.8 but my sculpt mode dont have any of the features above yet, i dont understand , someone pls explain , thanks

  42. Phenomenal work – these features are crucial to Blender’s sculpting workflow efficiency. Option 3 is going to be slow going, but it’s the only sane way forward. I will donate what I can. God speed.

  1. Leave a Reply

    Your email address will not be published. Required fields are marked *

     

share this story on