1-4期
195人加入学习
(33人评价)
Houdini 影视特效实验班

6个月零基础到入职

价格 ¥ 6198.00
教学计划
承诺服务

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;
    
    // 设置一个点云的handle
    int handle = pcopen(1, "P", current_P, seach_radius, max_points);
    
    // 开始进行点云的查找迭代
    while(pciterate(handle)){
        pcimport(handle, "point.number", found_ptnum);
    }
}

    

 

 

 

     if(branch_count_temp > -1 && branch_count_temp <= branch_time_temp){
        branch_count_temp += 1;
        setpointattrib(0, "branch_count", idx, branch_count_temp, "set");
    }else if(branch_count_temp > -1 && branch_count_temp > branch_time_temp){
        branch_count_temp = -1;
        setpointattrib(0, "branch_count", idx, branch_count_temp, "set");
        
        setpointattrib(0, "Cd", idx, {0,0,0}, "set");
    }

这一整段代码的作用是使分支闪电存在的时间大于我们设定的时间范围之后,让分支闪电消失掉,之所以写在点云查找迭代的前面,也是因为SOPsolve这个节点在DOP网络里粒子系统中的循环,没有要改动的地方,唯一要改的可能就是我们自己设定的分支闪电存在的时间

[展开全文]

detail级别的属性调取方式“P”

点级别的是@P

[展开全文]

setpointattrib(哪个输入接口,写这个接口里的什么属性,写到哪个点的属性,把这个点的什么属性写入,模式)  一共5个元素

debug中:setpointattrib(0, "Cd", idx, {0,0,0}, "set");

把第一个输入进来的几何体,写入设置的000颜色属性,写给当前正在迭代的idx粒子

 

 

本节代码未完成,配合下节才能看懂

 

!!看完04-06节后再回来!!

果然这里for循环中,branch_count并未成功计数,这个if和else if并不会生效

[展开全文]

pc啊

intial  0

target 1 

if intial can find one oar more target 

we can setdown its ptnum or id

appen it to some of  a groop or array 

 

iin detail mode maybe thee @P @Cd can notwork??  

you must say oh 

 

vector cd = point(0,"Cd",idx)  here the @ptnum is not work?  okay  so 

by the way that use a emmunaate (枚举)

onebyone untail the @ptnum which is  the max number of the points` number+1;because the number is from zero;

 int idx; idx<npoints(0);'idx++

[展开全文]