Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
| Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | void SCULPT_filter_cache_init(bContext *C, Object *ob, Sculpt *sd, const int undo_type) | ||||
| for (int i = 0; i < ss->filter_cache->totnode; i++) { | for (int i = 0; i < ss->filter_cache->totnode; i++) { | ||||
| BKE_pbvh_node_mark_normals_update(ss->filter_cache->nodes[i]); | BKE_pbvh_node_mark_normals_update(ss->filter_cache->nodes[i]); | ||||
| } | } | ||||
| /* mesh->runtime.subdiv_ccg is not available. Updating of the normals is done during drawing. | /* mesh->runtime.subdiv_ccg is not available. Updating of the normals is done during drawing. | ||||
| * Filters can't use normals in multires. */ | * Filters can't use normals in multires. */ | ||||
| if (BKE_pbvh_type(ss->pbvh) != PBVH_GRIDS) { | if (BKE_pbvh_type(ss->pbvh) != PBVH_GRIDS) { | ||||
| BKE_pbvh_update_normals(ss->pbvh, NULL); | BKE_pbvh_update_normals(ss->pbvh, NULL, ss->pmap); | ||||
| } | } | ||||
| SculptThreadedTaskData data = { | SculptThreadedTaskData data = { | ||||
| .sd = sd, | .sd = sd, | ||||
| .ob = ob, | .ob = ob, | ||||
| .nodes = ss->filter_cache->nodes, | .nodes = ss->filter_cache->nodes, | ||||
| .filter_undo_type = undo_type, | .filter_undo_type = undo_type, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 497 Lines • ▼ Show 20 Lines | static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| ss->filter_cache->iteration_count++; | ss->filter_cache->iteration_count++; | ||||
| if (ss->deform_modifiers_active || ss->shapekey_active) { | if (ss->deform_modifiers_active || ss->shapekey_active) { | ||||
| SCULPT_flush_stroke_deform(sd, ob, true); | SCULPT_flush_stroke_deform(sd, ob, true); | ||||
| } | } | ||||
| /* The relax mesh filter needs the updated normals of the modified mesh after each iteration. */ | /* The relax mesh filter needs the updated normals of the modified mesh after each iteration. */ | ||||
| if (ELEM(MESH_FILTER_RELAX, MESH_FILTER_RELAX_FACE_SETS)) { | if (ELEM(MESH_FILTER_RELAX, MESH_FILTER_RELAX_FACE_SETS)) { | ||||
| BKE_pbvh_update_normals(ss->pbvh, ss->subdiv_ccg); | BKE_pbvh_update_normals(ss->pbvh, ss->subdiv_ccg, ss->pmap); | ||||
| } | } | ||||
| SCULPT_flush_update_step(C, SCULPT_UPDATE_COORDS); | SCULPT_flush_update_step(C, SCULPT_UPDATE_COORDS); | ||||
| return OPERATOR_RUNNING_MODAL; | return OPERATOR_RUNNING_MODAL; | ||||
| } | } | ||||
| static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| ▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines | |||||