timur04 Posted March 18, 2020 Share Posted March 18, 2020 So I found a simple tutorial that showed how one point can infect other points around it and spread its color. But I'm having trouble doing the same thing in the AutoDopNetwork I run this in a PointWrangle and nothing... if(@infect == 0){ float search = ch('search'); int spnts[] = nearpoints(0,@P,search,5); int pt; foreach(pt;spnts){ if(point(0,'infect',pt) == 1){ @infect = 1; @Cd = {1,0,0}; } } } Any idea of what I'm doing wrong? Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted March 18, 2020 Share Posted March 18, 2020 3 hours ago, timur04 said: So I found a simple tutorial that showed how one point can infect other points around it and spread its color. But I'm having trouble doing the same thing in the AutoDopNetwork I run this in a PointWrangle and nothing... if(@infect == 0){ float search = ch('search'); int spnts[] = nearpoints(0,@P,search,5); int pt; foreach(pt;spnts){ if(point(0,'infect',pt) == 1){ @infect = 1; @Cd = {1,0,0}; } } } Any idea of what I'm doing wrong? Hi, it should work. Maybe you did not create "search" parameter or its value equal 0. Hard to tell without scene. Quote Link to comment Share on other sites More sharing options...
anim Posted March 18, 2020 Share Posted March 18, 2020 maybe your points are practicing social distancing 1 Quote Link to comment Share on other sites More sharing options...
timur04 Posted March 18, 2020 Author Share Posted March 18, 2020 Hahaha! Here is my scene file. test_07.hip Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted March 18, 2020 Share Posted March 18, 2020 Just copied wrangle form solver SOP into sopsolver DOP. test_07_01.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted March 18, 2020 Share Posted March 18, 2020 on your popwrangle2 you need to set Input1 to Myself in the Inputs tab also it would help to disable popcolor1 (which is resetting all the color to red every timestep) and set guide visualization type to none as it's currently visualizing temperature attribute Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 18, 2020 Share Posted March 18, 2020 6 hours ago, anim said: maybe your points are practicing social distancing The new buzz phrase. Just listen to The Police song; I hope my reference is understood ? Quote Link to comment Share on other sites More sharing options...
timur04 Posted March 22, 2020 Author Share Posted March 22, 2020 Beautiful boys! Worked like a charm. One more thing, if the virus spread is too fast and reducing the search value doesn't do the trick.. How can I hake it that there us a 50/50 chance of infection? I tried this but it didn't work @infect = (rand($F)>0.5,1,0); Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 22, 2020 Share Posted March 22, 2020 On 3/19/2020 at 5:11 AM, anim said: on your popwrangle2 you need to set Input1 to Myself in the Inputs tab also it would help to disable popcolor1 (which is resetting all the color to red every timestep) and set guide visualization type to none as it's currently visualizing temperature attribute OT: is there any definitive guide/tute on this very confusing subject ? The Input Myself blah blah...how's one noob supposed to know what to set it to ? Quote Link to comment Share on other sites More sharing options...
anim Posted March 22, 2020 Share Posted March 22, 2020 1 hour ago, Noobini said: OT: is there any definitive guide/tute on this very confusing subject ? The Input Myself blah blah...how's one noob supposed to know what to set it to ? https://www.sidefx.com/docs/houdini/nodes/dop/popwrangle.html#inputs Quote Link to comment Share on other sites More sharing options...
anim Posted March 22, 2020 Share Posted March 22, 2020 2 hours ago, timur04 said: I tried this but it didn't work @infect = (rand($F)>0.5,1,0); you need to use @Frame, also if 0.5 is a chance of infection then you want to use <= @infect = rand(@Frame) <= chf("infection_chance"); but that will be steppy as all the potential infectees will either get infected or not per frame, so you may want to base it on frame and per particle so make sure your particles have valid id attribute (since you are using Flip, check flipsolver1/PArticleMotion/Behavior/AddIDAttribute) and then this should work @infect = rand(@Frame, @id) <= chf("infection_chance"); Quote Link to comment Share on other sites More sharing options...
timur04 Posted March 22, 2020 Author Share Posted March 22, 2020 Wow! Amazing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.