GSoC: Multires/sculpting/brush improvements (N. Bishop ect...), discussion thread

I saw those commits yesterday has anyone made any builds to play around with

Hi all,

Uploaded a little screen cast showing mask layers in action:

This work is not committed yet, still need to clean it up and also make it work with multires.

-Nicholas

Thank you!. Great feature Nicholas. Looking forward to it. :yes:

Hey Nicholas,
I like the work you’ve done so far and it works quite nicely (apart from some bugs most of which have to do with changing in and out of sculpt mode).
One question I have is whether you plan to extend the mask creation beyond just the mask brush. I really would like to be able to create masks by border or lasso selecting an area. Since a mask is somewhat like a selection It would be nice for it to be consistent with the other modes.
Similarly It might be useful to be able to hide parts of the mesh based on a mask, although there might be technical difficulties in this area.

Keep up the great work.

Can we use an image (as stencil) to create a mask? and then apply any brush?. By the way… amazing job, congratulations.

I think it would be cool to be able to use uv mapped images as masks so you could make a pretty mask in the gimp and then sculpt ‘between the lines’.

Don’t know if a uv texture lookup would be fast enough though unless it was pre-loaded into the lookup tree along with the current mask colors.

What happens when you hide a part and there is symmetry on it?
I’m thinking on features like hands,it makes sense to hide everything and keep only one hand visible when you work on it,but if the other hand loses the changes made it’s hard to redo the work(Zbrush can trasfer with mask the symmetry work from one part to the other side,something similar could be really useful) .
Not sure if it’s related to this project or to the other.

Nicholasbishop,

On the wiki page under TODO, you listed “Implement masks for other paint modes”. As I understand, in sculpt mode the masking works based on vertices, would masking in texture paint then work on texture’s pixels?

sergof - Regarding lasso mask select, I might look into it. I can see how it might be useful. As for hiding from masks, I think that’s a good idea, and not too hard to do.

SamCameron - You can use an image to create a mask by attaching a texture to the mask brush, just like any other brush.

UncleEntitiy - That’s a good thought, I’ll look into that as well.

renderdemon - I agree, a way to restore symmetry would make hiding a much more useful tool. I’m not too sure what the best way to approach that is though; I’ll ponder that :slight_smile:

Lamoot - My todo is a little unclear there; I’m only referring to vertex-based paint modes, not texture paint. However, Konrad’s GSoC project might address texpaint masks.

Thanks for the feedback, these are very useful comments :slight_smile:

-Nicholas

Don’t know if this was already suggested, but would be nice to be able to do “one-click element masking” (element = each piece of connected geometry).

That way if you have for instance a character with cloth and accessories you could just click for instance a belt / a backpack / earring / piercings and the whole element is instantly masked.

It could be two types of masking:

  • add / remove element to the mask
  • and element “Solo”.

This could be a way around multiple objects sculpting at once before it’s really implemented.

(BTW: this looks amazing)

So good to hear that, that’s what I missed. now I just wish to have bump mapping painting directly, but I think that’s another project.

I’ve just committed support for multiple mask layers and better undo/redo. Bug reports welcome :slight_smile:

Here’s a win32 build to test :

Peace !

I don’t think I got all of them but here it goes:

When in sculpt mode entering edit mode and then going into any other mode exits blender because of a failed assertion.
This only happens when the mesh has a multires modifier with at least 1 level of subdivision.
blender/source/blender/blenkernel/intern/multires.c:651: multiresModifier_disp_run: Assertion `stored_grids’ failed.

Adding a multires modifier to a mesh that has a mask (and subdividing) exits blender because of a failed assertion.
blender/source/blender/blenkernel/intern/multires.c:652: multiresModifier_disp_run: Assertion `CustomData_number_of_layers(&stored_grids[i], 26) == gridkey->mask’ failed.
This does not happen if the mesh had a mask created under multires before.

Removig all mask layers causes brushes to behave abnormaly, smooth brush “eats holes” into the mesh (only with multires) others stop working (around those holes).

Deleting higher subdivision levels of multires messes up mask.

When having several mask layers and inverting one all other layers are ignored.
Maybe I just haven’t thought this through, mask layers seem to just add all the values of the layers so what should happen if one of them gets inverted?

Mesh hiding only works with a regularl mesh and multires modifier, but not other modifiers. I suppose this is not as much a bug but more like a missing feature.

There are several shading problems (maybe intentional for testing?):
When a mask exists mesh is drawn pure while.
When removing all mask layers the mesh gets an orange overlay same goes for fast navigate (multires level 0) and removing the multires modifier.

I have similar problems to sergof.

Additionaly - if I go sculp mode -> add multires level 1 -> do one stroke -> undo = always crash. In fact in crash after any count of strokes

I think maybe brecht fixed that one in trunk.

Also seem like the masks only get taken into account when they add up to 1, any fractional value (like 0.4) seems to be ignored…at least for the layer brush.

Thanks for the excellent bug reporting :slight_smile:

sergof - Fixed the first three in SVN, still working on the fourth issue. The mask inversion is behaving correctly; masks are combined as a saturated add, so if you have a mask layer that’s completely masked, the whole mesh will be masked regardless of what other layers contain. Mesh hiding indeed does not work with other modifiers, but sculpting performance in general is really bad in that case; best to avoid it if possible. The weird issue with orange meshes is a bug, probably due to me trashing some OpenGL state, but I haven’t tracked down where yet.

JoseConseco - confirmed, looking into this.

Uncle Entitiy - what’s happening here is that the mask values are being used, but each brush can apply itself to a single vertex many times during one stroke. So if the mask is allowing even a tiny bit of the brush’s effect through, it can easily build up so the mask appears to have no effect. I do consider this a bug that should be fixed, but I haven’t looked into it much yet.

Thanks again,
-Nicholas

Well, here is the next batch:

Changing from sculpt mode into edit mode and then into another mode with multires (subdivided) and with a mask exits blender because of a failed assertion.
blender/source/blender/blenkernel/intern/multires.c:666: multiresModifier_disp_run: Assertion `gridkey->mask == 0 || stored_grids’ failed.

Changing from sculpt mode into edit mode and back and then adding a mask exits blender because of a failed assertion. Only with subdivided multires.
blender/source/blender/editors/sculpt_paint/paint_mask.c:162: paintmask_adjust_multires: Assertion `cd’ failed.

Another issue is the strength of the mask brush. Every value above a certain threshold (depends on the spacing) results in 100% (although with less falloff) and gives you very little range.
What happens is that dabs are added on top of each other without compensation. This is a general problem with sculpt and I believe Jason’s “adaptive strength” atempts to solve this?
Clipping the strenght at a high value might be necessary though since it is nearly impossible to get 1.0 strength using the radial control. Although it would be better to modify the radial control so it is easier to get full strenght.

You’re getting there, I can almost taste it.

JoseConseco - fixed your bug.

sergof - I think both of the new bugs should be fixed now.

I agree about mask strength saturating too quickly, hopefully that’ll be fixed when Jason’s work is merged.

Regarding the strength radial control, you can set 1.0 more easily if you hold down CTRL to snap. However, I figure that setting exactly 1.0 is not a typical/important use case? I intentionally made the radial control easier to set lower values.

Thanks again for the reports,
-Nicholas

HI nicholasbishop
I see undo bug is fixed. Thx for that. Unfortunately i have bunch more (multires rev29870 64bit):

1.When you have multires, lets say level 3, when I switch subdivision algorithm to simple and then back to Catmull-Clart I get this (mesh has to have at least one brush stroke):


Similar thing happens when I’m in object mode. Creases seems to appear on base mesh edges. Looks like simple subdivision algorithm takes base mesh for input, and not current multires level, as it should

  1. This is only cosmetic thing but mask have some weird pattern when painted:
    http://i46.tinypic.com/ayved1.jpg
    Again it looks like check board shows where base mesh edges are.

  2. When i undo mask, it doesn’t disappear from mesh surfece but vertexes are ‘unfrozen’:
    http://i46.tinypic.com/fa8rjt.jpg
    Clear mask works ok

  3. This bug is kinda hard to reproduce and it’s from sculpt branch but I get this:


    when switching to lower multires level. This usually appears when I do more finished headbusth. I can’t reproduce it on simple sphere thought.

I hope I didn’t discourage you form work lol. Anyway this is getting more and more exiting.