Dirty mask was inside the mask filter in the sculpt branch, but it didn't make much sense. I split it into a different operator. It still misses some parameters from the vertex color operator that I can add later when we know how these operators are going to be used from the interface.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- sculpt-mask-filter (branched from master)
- Build Status
Buildable 4454 Build 4454: arc lint + arc unit
Event Timeline
- Use exec instead of invoke
This allows repeating the operator with Shift+R without opening the pie menu again
From just reading the changes, this seems fine to me.
However, this patch doesn't apply cleanly for me in the latest master. Could you update your patch?
Other than my comments below, I didn't really find any other issues.
| source/blender/editors/sculpt_paint/sculpt.c | ||
|---|---|---|
| 325 | Missing prototype warning. I'm guessing you want to have this be a static function? | |
| 6977 | I'm getting a "set but unused warning here". I think you can just remove this variable. | |
| 7159 | Same as with the other prop, just remove this. | |
The filter tool doesn't show an adjust operator settings panel, which I think would be useful to tweak the iterations? It's not immediately obvious from the code why it's not showing here though.
| release/scripts/startup/bl_ui/space_view3d.py | ||
|---|---|---|
| 4787 ↗ | (On Diff #17882) | Mask edit -> Mask Edit |
| 4797 ↗ | (On Diff #17882) | These operations should not only be in the pie menu, but also the Sculpt menu in the header. |
| source/blender/editors/sculpt_paint/sculpt.c | ||
| 6966 | Mask filter -> Mask Filter | |
| 6996 | Auto iteration count -> Auto Iteration Count | |
| 7017 | Weird indentation. | |
| 7024–7026 | Change to: float angle = max_ff(saacosf(dot), 0.0f); return angle; saacosf avoids NaN in some rare float precision cases. | |
| 7045 | Always use {} for if. | |
| 7065–7068 | Move to utility function from other patches | |
| 7075 | Dirty mask -> Dirty Mask | |
| 7084 | Slightly faster to compute the vertex count once instead of for every iteration. int num_verts = sculpt_vertex_count_get(ss);
or (int i = 0; i < num_verts; i++) {
}This goes for all similar loops in this patch. | |
| 7133–7135 | Maybe free nodes before undo push. Doesn't really better but has slightly slower memory peak then. | |
| 7147 | Dirty mask -> Dirty Mask | |
- Update for revision
I never get a sculpt mode operator to work with the redo panel. But even if it does, on a high poly mesh some filters need a high number of iterations to get a usable result. Adjusting the filter in the redo panel from the iteration 100 to the 101 will recalculate 101 iterations, so it is going to be faster running the filter again. I would like this to work similarly to the mesh filter, adjusting the iteration count in real time from a modal operator.
| source/blender/editors/sculpt_paint/sculpt.c | ||
|---|---|---|
| 327–334 | Slightly faster: float mask = sculpt_vertex_mask_get(ss, index);
if (mask > max) {
sculpt_vertex_mask_set(ss, index, max);
}
else if (mask < min) {
sculpt_vertex_mask_set(ss, index, min);
} | |
| 6841 | Add ; after sculpt_vertex_neighbors_iter_end(ni) to solve weird indentation. | |
| 6852 | Add ; after sculpt_vertex_neighbors_iter_end(ni) to solve weird indentation. | |
| 7013 | Add ; after sculpt_vertex_neighbors_iter_end(ni) to solve weird indentation. | |