YoungLegend

YoungLegend

About Me

Houdini FX-TD
EXPERTISE
VFX Artist
INDUSTRY
Film/TV

Connect

LOCATION
Canada
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Reset attribute | solver infection April 18, 2023, 12:16 p.m.

Tanto
You have to reset @age at some point, otherwise the @age>15 condition will remain true.

Yup, you're right. I probably need a coffee.

Just had to add if(@infect==0)@age=0

Thanks!

Reset attribute | solver infection April 18, 2023, 11:28 a.m.

Just a simple infection solver; but I'm trying to reset the "infect" attribute so my grid of points can be infected again. I'm using age attribute to set infectioin to 0 after certain frame. But i need it to feed it back in. How can i do this?

Q: Attribute wrangle > Attribute promote May 25, 2021, 1:09 p.m.

Promote is actually a bit faster as well for some reason. Especially when it comes to multiple attributes.
Pasting my final vex, incase anyone's curious. Packed into an hda.



wrangle 1 :
int runover = chi("../runover");
string att = chs("../attributes");
string atts[] = split(att,' ');

foreach(string i; atts){
    float val = runover==1?prim(0, i, @primnum):point(0, i, @ptnum);
    adddetailattrib(0, i + "_min", 1e10);
    adddetailattrib(0, i + "_max", -1e10);
    
    setdetailattrib(0, i+"_min", val, "min");
    setdetailattrib(0, i+"_max", val, "max");
}

wrangle 2:
int runover = chi("../runover");
string att = chs("../attributes");
string atts[] = split(att,' ');

foreach(string j; atts){
    float val = runover==1?prim(0, j, @primnum):point(0, j, @ptnum);
    float min = detail(0, j+"_min");
    float max = detail(0, j+"_max");
    
    if(ch("../toggle_fit")==1){
    float fit = fit(val,min,max,0,1);
    setpointattrib(0, j, @ptnum, fit, "set");
    }
    
    if(ch("../toggle_promote")==1){
    setpointattrib(0, j+"_min", @ptnum, min, "set");
    setpointattrib(0, j+"_max", @ptnum, max, "set");
    }
    
    if(ch("../toggle_avg")==1){
    float avg = avg(min, max);
    setpointattrib(0, j+"_avg", @ptnum, avg, "set");
    }
}