Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_detail.c
| Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| mul_v3_fl(center, 0.5f); | mul_v3_fl(center, 0.5f); | ||||
| sub_v3_v3v3(dim, bb_max, bb_min); | sub_v3_v3v3(dim, bb_max, bb_min); | ||||
| size = max_fff(dim[0], dim[1], dim[2]); | size = max_fff(dim[0], dim[1], dim[2]); | ||||
| /* Update topology size. */ | /* Update topology size. */ | ||||
| float object_space_constant_detail = 1.0f / (sd->constant_detail * mat4_to_scale(ob->obmat)); | float object_space_constant_detail = 1.0f / (sd->constant_detail * mat4_to_scale(ob->obmat)); | ||||
| BKE_pbvh_bmesh_detail_size_set(ss->pbvh, object_space_constant_detail); | BKE_pbvh_bmesh_detail_size_set(ss->pbvh, object_space_constant_detail); | ||||
| SCULPT_undo_push_begin("Dynamic topology flood fill"); | SCULPT_undo_push_begin(ob, "Dynamic topology flood fill"); | ||||
| SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_COORDS); | SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_COORDS); | ||||
| while (BKE_pbvh_bmesh_update_topology( | while (BKE_pbvh_bmesh_update_topology( | ||||
| ss->pbvh, PBVH_Collapse | PBVH_Subdivide, center, NULL, size, false, false)) { | ss->pbvh, PBVH_Collapse | PBVH_Subdivide, center, NULL, size, false, false)) { | ||||
| for (int i = 0; i < totnodes; i++) { | for (int i = 0; i < totnodes; i++) { | ||||
| BKE_pbvh_node_mark_topology_update(nodes[i]); | BKE_pbvh_node_mark_topology_update(nodes[i]); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines | |||||