borbs727 Posted November 7, 2015 Share Posted November 7, 2015 (edited) Hey everyone, I currently have a plexus effect by blending a few tutorials together (tinytuts and Danil Krivochko). I'd like to take it a step further and create a persistent plexus effect where the connections at frame 1 remain throughout the simulation- never breaking or creating new connections. I have this code from the tinytus tutorial: if (ptnum % ratio == 0) { int myprim = addprim(0,"polyline"); int nearpts[] = nearpoints(0,P,maxdist,maxpts); for (int i = 0; i < len(nearpts); i++) { addvertex(0,myprim, ptnum); addvertex(0,myprim, nearpts[i]); } } It's creating primitives based on nearby points. So in order to get the persistent plexus look, I need to use maxdist and maxpts to create the look I want, but be able to keep max distance from influencing the connections after I get my initial look. I think I need to start by establishing a connection between points at frame 1, so they remember who they were connected to during the simulation. I might be able to do this by somehow storing nearpts[] data into each point with an attr? Or maybe I can create a new if statement that says in pseudocode that may or may not look like python: int nearpts[] = nearpoints(0,P,maxdist,maxpts); if frame == 1: create a list called initpts and store any points from nearpts[] into this new list else: pass Then change the for statement to say for each initpt in initpts: addvertex(0,myprim, ptnum); addvertex(0,myprim, initpt); Is there a way that I can utilize python to create this effect here? Another thought I had was to use a solver sop because I've seen that it can calculate what went on the frame before, but I'm really struggling with how to proceed with this direction. A nudge in the right direction would help me out a lot, thanks! Here's my file so far. od_persistantPlexus.hiplc Edited November 7, 2015 by borbs727 Quote Link to comment Share on other sites More sharing options...
anim Posted November 7, 2015 Share Posted November 7, 2015 would copying P from points onto first frame of plexus work for you as a solution? od_persistantPlexus_fix.hiplc 1 Quote Link to comment Share on other sites More sharing options...
Malf Posted November 7, 2015 Share Posted November 7, 2015 Hi Mike. Tomas already posted a solution but I thought I would show you how you can achieve it with the idea that you already had. Creating an array attribute which stored the points to connect with on the first frame and then using that to connect them. I pulled out the code you had in the vop network to a straight wrangle as I find it easier to work with. Cheers Jake. od_persistantPlexus_new.hiplc.hipnc 1 Quote Link to comment Share on other sites More sharing options...
borbs727 Posted November 7, 2015 Author Share Posted November 7, 2015 Amazing! Thank you both for taking the time to help me out They work perfectly. Also, thanks for showing me how to houdini-ize my idea, Jacob, that's a big help 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.