Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_hide.c
| Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | static int hide_show_exec(bContext *C, wmOperator *op) | ||||
| get_pbvh_nodes(pbvh, &nodes, &totnode, clip_planes, area); | get_pbvh_nodes(pbvh, &nodes, &totnode, clip_planes, area); | ||||
| pbvh_type = BKE_pbvh_type(pbvh); | pbvh_type = BKE_pbvh_type(pbvh); | ||||
| negate_m4(clip_planes); | negate_m4(clip_planes); | ||||
| /* Start undo. */ | /* Start undo. */ | ||||
| switch (action) { | switch (action) { | ||||
| case PARTIALVIS_HIDE: | case PARTIALVIS_HIDE: | ||||
| SCULPT_undo_push_begin("Hide area"); | SCULPT_undo_push_begin(C, "Hide area"); | ||||
| break; | break; | ||||
| case PARTIALVIS_SHOW: | case PARTIALVIS_SHOW: | ||||
| SCULPT_undo_push_begin("Show area"); | SCULPT_undo_push_begin(C, "Show area"); | ||||
| break; | break; | ||||
| } | } | ||||
| for (int i = 0; i < totnode; i++) { | for (int i = 0; i < totnode; i++) { | ||||
| switch (pbvh_type) { | switch (pbvh_type) { | ||||
| case PBVH_FACES: | case PBVH_FACES: | ||||
| partialvis_update_mesh(ob, pbvh, nodes[i], action, area, clip_planes); | partialvis_update_mesh(ob, pbvh, nodes[i], action, area, clip_planes); | ||||
| break; | break; | ||||
| case PBVH_GRIDS: | case PBVH_GRIDS: | ||||
| partialvis_update_grids(depsgraph, ob, pbvh, nodes[i], action, area, clip_planes); | partialvis_update_grids(depsgraph, ob, pbvh, nodes[i], action, area, clip_planes); | ||||
| break; | break; | ||||
| case PBVH_BMESH: | case PBVH_BMESH: | ||||
| partialvis_update_bmesh(ob, pbvh, nodes[i], action, area, clip_planes); | partialvis_update_bmesh(ob, pbvh, nodes[i], action, area, clip_planes); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (nodes) { | if (nodes) { | ||||
| MEM_freeN(nodes); | MEM_freeN(nodes); | ||||
| } | } | ||||
| /* End undo. */ | /* End undo. */ | ||||
| SCULPT_undo_push_end(); | SCULPT_undo_push_end(C); | ||||
| /* Ensure that edges and faces get hidden as well (not used by | /* Ensure that edges and faces get hidden as well (not used by | ||||
| * sculpt but it looks wrong when entering editmode otherwise). */ | * sculpt but it looks wrong when entering editmode otherwise). */ | ||||
| if (pbvh_type == PBVH_FACES) { | if (pbvh_type == PBVH_FACES) { | ||||
| BKE_mesh_flush_hidden_from_verts(me); | BKE_mesh_flush_hidden_from_verts(me); | ||||
| } | } | ||||
| SCULPT_visibility_sync_all_vertex_to_face_sets(ob->sculpt); | SCULPT_visibility_sync_all_vertex_to_face_sets(ob->sculpt); | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||