Page MenuHome

Sculpt tiling seems to break some brushes
Closed, ResolvedPublic


System Information

Blender Version
Broken: cmake win32 hash : cdf2dbe

Short description of error
flatten and scrape brush misbehave with tiling enabled

Exact steps for others to reproduce the error
Load that blend :

with "Load UI" enabled so you can easily see the problem, use the already selected brush on the zone i am pointing on the screenshot (Dyntopo is enabled)

The brush is the Scrape brush with locked "Area Plane" in order to use the brush to polish nicely like that :

You should obtain some horrible thing like that :

Now go disable the X/Y/Z tiling and redo the brush stroke, you should obtain the expected (and desired) :

I observed the same problem happening with the flatten brush.

Event Timeline

Sanc Tuary (sanctuary) set Type to Bug.
Sanc Tuary (sanctuary) created this task.
Sanc Tuary (sanctuary) raised the priority of this task from to Needs Triage by Developer.

calc_sculpt_plane() is used by do_scrape_brush() to calculate its reference-plane. I think at the moment it returns the same plane for all tiled strokes. To work correctly it should update the planes origin. For symmetry this function updates the plane by flipping or rotating its normal and origin by using mirror_symmetry_pass and symm_rot_mat. When using tiling it should also move the plane around (Maybe by using an offset that gets updated in do_tiled()).

While looking at this I found there is also an issue with the initial calculation of the plane (and other stuff) when painting starts: When tiling is enabled the first stroke is not issued at the original painting position. Instead it starts at the tiled stroke with the minimum coordinates. At this position the brush is usually partially outside of the mesh and will probably calculate some unexpected normals and other stuff on initialization.

Committed the quick and dirty solution - recalculate the sculpt plane always in tiled sculpting.

I do not know if it's because of the "dirty" solution or if it is what you mean by "TODO" in the fix.
But in case you aren't already aware, while the brushes after that fix do not horribly destroy the meshes where you stroke fortunately, even with the fix they are still not working correctly with "Area Plane" locked when you use tiling, in fact they work as the user had not locked the "Area Plane".

( using , today's buildbot)

They work correctly only if i disable X/Y/Z tiling in sculpt.

You are right, the commit of this task effectively disables the locked "Area Plane". Yesterday I submitted a patch that corrects this behaviour: D1438


I do not know if your patch fixing the problem has been included in Blender since you submitted it , but i tried today's buildbot ( ) and unfortunately the problem is still present, the locked planes are ignored if sculpt tiling is enabled.

No it's not, I will be committing the fix tomorrow, unless someone else does so first.

Just reporting that i tested on today's buildbot ( ) and i confirm that it's now working greatly.

Thank you very much for the patch and the commit.