With the previous behavior, it was impossible to manipulate areas with a lot of complex shapes like fingers, as the pose origin was calculated only with the topology inside the radius.
With pose offset, the previous method is used to calculate the direction of the "bone", and an extra offset is added on top of it. This way you can set the pose origin in the correct place in this kind of situations. The pose factor grows to fit the new rotation origin.
Details
- Reviewers
Jeroen Bakker (jbakker) - Commits
- rB6a74b7c14b39: Sculpt: Pose brush origin offset
Diff Detail
- Repository
- rB Blender
- Branch
- pose-brush-offset (branched from master)
- Build Status
Buildable 5091 Build 5091: arc lint + arc unit
Event Timeline
| release/scripts/startup/bl_ui/space_view3d_toolbar.py | ||
|---|---|---|
| 428 | Should be elif | |
| source/blender/editors/sculpt_paint/sculpt.c | ||
| 3609 | Note for future investigation: Check if spinlock would fit better. | |
| 3790 | Use madd_v3_v3fl | |
| 3848 | This is still part of calculating the pose_factor. should be called from inside the sculpt_pose_calc_pose_data Need additional look in how to make this faster. It seems like in large meshes there is a lot of overhead towards checking nodes that are actually not interested and also have not been interested in the previous iteration. Have you checked how many iterations you typically get and how many hits vs misses? | |
| 3850 | grow_next_iteration? | |
| 3858 | Can this be done outside the while loop? | |
- Review update
This brush is intended to be used in the lower levels of a multires or a low poly mesh. I often get 4/5 iterations and I didn't notice any performance difference.
Iterating over all nodes is an issue in the mask filter. The code is almost the same, but if you are working in a high poly mesh you often want to do about 100 iterations in one step. The only optimization I'm doing is to only tag to redraw nodes where the mask data changed.
The big bottleneck in sculpt mode happens when you tag to redraw a lot of nodes at once, so just by doing this performance is not that bad.
| source/blender/editors/sculpt_paint/sculpt.c | ||
|---|---|---|
| 3645 | Move the init and end of the mutex to outside the while loop. | |
| 3818 | This is not safe! 50% of the reads are using the new values. reading and updating values in the same loop. ss->cache->pose_factor[vd.index] is uninitialized when total is 0, should it be set to 0? | |
| source/blender/editors/sculpt_paint/sculpt.c | ||
|---|---|---|
| 3577–3584 | In stead of the mutex we can use the tls parameter and store there the accumulations that this thread has handled. | |
| source/blender/editors/sculpt_paint/sculpt.c | ||
|---|---|---|
| 3592 | This resets the count + average when a worker/thread is reused. | |
| 3605 | 'gftd[n].pos_avg' => gftd->pos_avg the userdata_chunk is already localized | |
| 3619 | This method is called per task, no need to loop. | |
| 3642 | No need to allocate for every task here. this is done in task.c#1227-1235 | |
| 3647 | only the size of a single element needed. | |
Seems to be that rebasing introduced more changes...
| source/blender/editors/sculpt_paint/paint_cursor.c | ||
|---|---|---|
| 1355 | prev_active_vertex_index can be read uninitialized. This is undefined behavior, best set to a useful default. | |