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 5,507 Lines • ▼ Show 20 Lines | static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings *ups) | ||||
| * constrained by the radius. */ | * constrained by the radius. */ | ||||
| /* Pose needs all nodes because it applies all symmetry iterations at the same time and the IK | /* Pose needs all nodes because it applies all symmetry iterations at the same time and the IK | ||||
| * chain can grow to any area of the model. */ | * chain can grow to any area of the model. */ | ||||
| /* This can be optimized by filtering the nodes after calculating the chain. */ | /* This can be optimized by filtering the nodes after calculating the chain. */ | ||||
| if (ELEM(brush->sculpt_tool, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_POSE)) { | if (ELEM(brush->sculpt_tool, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_POSE)) { | ||||
| BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); | BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); | ||||
| } | } | ||||
| else if (brush->sculpt_tool == SCULPT_TOOL_CLOTH) { | else if (brush->sculpt_tool == SCULPT_TOOL_CLOTH) { | ||||
| if (brush->cloth_simulation_area_type == BRUSH_CLOTH_SIMULATION_AREA_LOCAL) { | |||||
| SculptSearchSphereData data = { | SculptSearchSphereData data = { | ||||
| .ss = ss, | .ss = ss, | ||||
| .sd = sd, | .sd = sd, | ||||
| .radius_squared = square_f(ss->cache->initial_radius * (1.0 + brush->cloth_sim_limit)), | .radius_squared = square_f(ss->cache->initial_radius * (1.0 + brush->cloth_sim_limit)), | ||||
| .original = false, | .original = false, | ||||
| .ignore_fully_ineffective = false, | .ignore_fully_ineffective = false, | ||||
| .center = ss->cache->initial_location, | .center = ss->cache->initial_location, | ||||
| }; | }; | ||||
| BKE_pbvh_search_gather(ss->pbvh, SCULPT_search_sphere_cb, &data, &nodes, &totnode); | BKE_pbvh_search_gather(ss->pbvh, SCULPT_search_sphere_cb, &data, &nodes, &totnode); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Gobal simulation, get all nodes. */ | |||||
| BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); | |||||
| } | |||||
| } | |||||
| else { | |||||
| const bool use_original = sculpt_tool_needs_original(brush->sculpt_tool) ? true : | const bool use_original = sculpt_tool_needs_original(brush->sculpt_tool) ? true : | ||||
| ss->cache->original; | ss->cache->original; | ||||
| float radius_scale = 1.0f; | float radius_scale = 1.0f; | ||||
| /* With these options enabled not all required nodes are inside the original brush radius, so | /* With these options enabled not all required nodes are inside the original brush radius, so | ||||
| * the brush can produce artifacts in some situations. */ | * the brush can produce artifacts in some situations. */ | ||||
| if (brush->sculpt_tool == SCULPT_TOOL_DRAW && brush->flag & BRUSH_ORIGINAL_NORMAL) { | if (brush->sculpt_tool == SCULPT_TOOL_DRAW && brush->flag & BRUSH_ORIGINAL_NORMAL) { | ||||
| radius_scale = 2.0f; | radius_scale = 2.0f; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,457 Lines • Show Last 20 Lines | |||||