Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/softbody.c
| Show First 20 Lines • Show All 1,562 Lines • ▼ Show 20 Lines | for (i = 0; i < totthread; i++) { | ||||
| sb_threads[i].effectors = effectors; | sb_threads[i].effectors = effectors; | ||||
| sb_threads[i].do_deflector = false; // not used here | sb_threads[i].do_deflector = false; // not used here | ||||
| sb_threads[i].fieldfactor = 0.0f; // not used here | sb_threads[i].fieldfactor = 0.0f; // not used here | ||||
| sb_threads[i].windfactor = 0.0f; // not used here | sb_threads[i].windfactor = 0.0f; // not used here | ||||
| sb_threads[i].nr = i; | sb_threads[i].nr = i; | ||||
| sb_threads[i].tot = totthread; | sb_threads[i].tot = totthread; | ||||
| } | } | ||||
| if (totthread > 1) { | if (totthread > 1) { | ||||
| BLI_threadpool_init(&threads, exec_scan_for_ext_spring_forces, totthread); | BLI_threadpool_init(&threads, exec_scan_for_ext_spring_forces, totthread, "SBSprings"); | ||||
| for (i = 0; i < totthread; i++) { | for (i = 0; i < totthread; i++) { | ||||
| BLI_threadpool_insert(&threads, &sb_threads[i]); | BLI_threadpool_insert(&threads, &sb_threads[i]); | ||||
| } | } | ||||
| BLI_threadpool_end(&threads); | BLI_threadpool_end(&threads); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 664 Lines • ▼ Show 20 Lines | for (i = 0; i < totthread; i++) { | ||||
| sb_threads[i].do_deflector = do_deflector; | sb_threads[i].do_deflector = do_deflector; | ||||
| sb_threads[i].fieldfactor = fieldfactor; | sb_threads[i].fieldfactor = fieldfactor; | ||||
| sb_threads[i].windfactor = windfactor; | sb_threads[i].windfactor = windfactor; | ||||
| sb_threads[i].nr = i; | sb_threads[i].nr = i; | ||||
| sb_threads[i].tot = totthread; | sb_threads[i].tot = totthread; | ||||
| } | } | ||||
| if (totthread > 1) { | if (totthread > 1) { | ||||
| BLI_threadpool_init(&threads, exec_softbody_calc_forces, totthread); | BLI_threadpool_init(&threads, exec_softbody_calc_forces, totthread, "SoftBody"); | ||||
| for (i = 0; i < totthread; i++) { | for (i = 0; i < totthread; i++) { | ||||
| BLI_threadpool_insert(&threads, &sb_threads[i]); | BLI_threadpool_insert(&threads, &sb_threads[i]); | ||||
| } | } | ||||
| BLI_threadpool_end(&threads); | BLI_threadpool_end(&threads); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 1,403 Lines • Show Last 20 Lines | |||||