Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 10,044 Lines • ▼ Show 20 Lines | static void SCULPT_OT_dirty_mask(struct wmOperatorType *ot) | ||||
| RNA_def_boolean( | RNA_def_boolean( | ||||
| ot->srna, "dirty_only", false, "Dirty Only", "Don't calculate cleans for convex areas"); | ot->srna, "dirty_only", false, "Dirty Only", "Don't calculate cleans for convex areas"); | ||||
| } | } | ||||
| static void sculpt_mask_expand_cancel(bContext *C, wmOperator *op) | static void sculpt_mask_expand_cancel(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| SculptSession *ss = ob->sculpt; | SculptSession *ss = ob->sculpt; | ||||
| const bool create_face_set = RNA_boolean_get(op->ptr, "create_face_set"); | |||||
| MEM_freeN(op->customdata); | MEM_freeN(op->customdata); | ||||
| for (int n = 0; n < ss->filter_cache->totnode; n++) { | for (int n = 0; n < ss->filter_cache->totnode; n++) { | ||||
| PBVHNode *node = ss->filter_cache->nodes[n]; | PBVHNode *node = ss->filter_cache->nodes[n]; | ||||
| if (create_face_set) { | |||||
| for (int i = 0; i < ss->totpoly; i++) { | |||||
| ss->face_sets[i] = ss->filter_cache->prev_face_set[i]; | |||||
| } | |||||
| } | |||||
| else { | |||||
| PBVHVertexIter vd; | PBVHVertexIter vd; | ||||
| BKE_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) | BKE_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) | ||||
| { | { | ||||
| *vd.mask = ss->filter_cache->prev_mask[vd.index]; | *vd.mask = ss->filter_cache->prev_mask[vd.index]; | ||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | |||||
| BKE_pbvh_node_mark_redraw(node); | BKE_pbvh_node_mark_redraw(node); | ||||
| } | } | ||||
| if (!create_face_set) { | |||||
| sculpt_flush_update_step(C, SCULPT_UPDATE_MASK); | sculpt_flush_update_step(C, SCULPT_UPDATE_MASK); | ||||
| } | |||||
| sculpt_filter_cache_free(ss); | sculpt_filter_cache_free(ss); | ||||
| sculpt_undo_push_end(); | sculpt_undo_push_end(); | ||||
| sculpt_flush_update_done(C, ob, SCULPT_UPDATE_MASK); | sculpt_flush_update_done(C, ob, SCULPT_UPDATE_MASK); | ||||
| ED_workspace_status_text(C, NULL); | ED_workspace_status_text(C, NULL); | ||||
| } | } | ||||
| static void sculpt_expand_task_cb(void *__restrict userdata, | static void sculpt_expand_task_cb(void *__restrict userdata, | ||||
| const int i, | const int i, | ||||
| ▲ Show 20 Lines • Show All 1,183 Lines • Show Last 20 Lines | |||||