for(int i = 0; i < npoints(0); i++){
vector current_P = point(0, "P", i);
int current_id = point(0, "id", i);
int branch_count_temp = point(0, "branch_count", i);
int branch_time_temp = point(0, "branch_time", i);
float seach_radius = chf("seach_radius");
int max_points = chi("max_points");
int found_ptnum;
int handle = pcopen(1, "P", current_P, seach_radius, max_points);
while(pciterate(handle)){
pcimport(handle, "point.number", found_ptnum);
int bool_A = branch_count_temp == -1 ? 1 : 0;
int array_check = find(temp_array, found_ptnum);
int bool_B = array_check < 0 ? 1 : 0;
if(bool_A && bool_B){
setpointattrib(0, "branch_point", i, found_ptnum, "set");
append(temp_array, found_ptnum);
temp_array = sort(temp_array);
setpointattrib(0, "Cd", i, {1,0,0}, "set");
}
}
pcclose(handle);
}
setpointattrib(0, "already_taken", 0, temp_array, "set");
这整段代码是用来确定被找到的分支闪电的目标点的唯一性,其原理是来自于SOPsolve这个节点在DOP网络里粒子系统中的循环,我不知道该怎么来形容,不过就是这么个意思,关于这种分支闪电是非常高级的应用技巧了,在实际镜头运用中我想不到除了这个效果,其他有什么作用,关于这种效果可以直接拿过来使用,唯一要改的地方只有bool_C和bool_D两个条件设置的参数,用来确定闪电分支的多少