Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
| Show First 20 Lines • Show All 611 Lines • ▼ Show 20 Lines | static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | ||||
| SculptSession *ss = ob->sculpt; | SculptSession *ss = ob->sculpt; | ||||
| Sculpt *sd = CTX_data_tool_settings(C)->sculpt; | Sculpt *sd = CTX_data_tool_settings(C)->sculpt; | ||||
| eSculptMeshFilterType filter_type = RNA_enum_get(op->ptr, "type"); | eSculptMeshFilterType filter_type = RNA_enum_get(op->ptr, "type"); | ||||
| float filter_strength = RNA_float_get(op->ptr, "strength"); | float filter_strength = RNA_float_get(op->ptr, "strength"); | ||||
| if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { | if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { | ||||
| SCULPT_filter_cache_free(ss); | SCULPT_filter_cache_free(ss); | ||||
| SCULPT_undo_push_end(); | SCULPT_undo_push_end(C); | ||||
| SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_COORDS); | SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_COORDS); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| if (event->type != MOUSEMOVE) { | if (event->type != MOUSEMOVE) { | ||||
| return OPERATOR_RUNNING_MODAL; | return OPERATOR_RUNNING_MODAL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| } | } | ||||
| SCULPT_vertex_random_access_ensure(ss); | SCULPT_vertex_random_access_ensure(ss); | ||||
| BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_topology_info, false, false); | BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_topology_info, false, false); | ||||
| if (needs_topology_info) { | if (needs_topology_info) { | ||||
| SCULPT_boundary_info_ensure(ob); | SCULPT_boundary_info_ensure(ob); | ||||
| } | } | ||||
| SCULPT_undo_push_begin("Mesh Filter"); | SCULPT_undo_push_begin(C, "Mesh Filter"); | ||||
| SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS); | SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS); | ||||
| FilterCache *filter_cache = ss->filter_cache; | FilterCache *filter_cache = ss->filter_cache; | ||||
| filter_cache->active_face_set = SCULPT_FACE_SET_NONE; | filter_cache->active_face_set = SCULPT_FACE_SET_NONE; | ||||
| filter_cache->automasking = SCULPT_automasking_cache_init(sd, NULL, ob); | filter_cache->automasking = SCULPT_automasking_cache_init(sd, NULL, ob); | ||||
| switch (filter_type) { | switch (filter_type) { | ||||
| ▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines | |||||