cwalrus Posted May 17, 2016 Share Posted May 17, 2016 Hi guy s- I have several different particle streams birthed from an initial one. I have a POP wrangle specifying a new TargetV for each of the streams, but I guess that when I mess with @targetv on one Wrangle, I change them all, in every stream? Is there a way to change the targetv for a stream that only applies to that particular stream? Here's the Wrangle: vector goalPos = point(@OpInput1,"P",@id); float windforce = ch("windforce"); v@targetv = normalize(goalPos - @P) * windforce; f@airresist = ch("airresist"); THANKS! Quote Link to comment Share on other sites More sharing options...
Atom Posted May 17, 2016 Share Posted May 17, 2016 (edited) I believe a stream is just a group with stream_ prepended to it. In the Pop Wrangle try activating group and choosing the stream from the group drop down. You may need several wrangles to modify each group with different code values. Edited May 17, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 17, 2016 Author Share Posted May 17, 2016 Atom - that sounded like it should have worked- but check it out: SH_0010_cameron_v22.hip Quote Link to comment Share on other sites More sharing options...
rbowden Posted May 17, 2016 Share Posted May 17, 2016 I think the problem may lie in your stream name in the popreplicate nodes. Try changing the name in those to something completely different (such as explode_replicate and explode_replicate2). Using those names in the wrangle node allowed me to get the L shape going. I don't know if that helps you or not but, check out the modified attached to see where I got to. -Ryan SH_0010_cameron_v22_RB.hip Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 17, 2016 Author Share Posted May 17, 2016 If I could kiss you through the internet I would! THANK YOU! To go into further detail - on the POPReplicate nodes, I had typed in the name of the top stream, thinking that's what should go there.. Actually, that "stream" Tab value is for the stream created by that replicate node ITSELF, so it confused the shit out of the solver. So I renamed them $OS (to simply inherit the name of the operator), selected THAT in the wrangle, and now it's working. thanks! Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 17, 2016 Author Share Posted May 17, 2016 also it should be noted for anyone exploring this, you need to have WAY more points in your source letters than in your sim Quote Link to comment Share on other sites More sharing options...
anim Posted May 18, 2016 Share Posted May 18, 2016 2 hours ago, cwalrus said: also it should be noted for anyone exploring this, you need to have WAY more points in your source letters than in your sim what makes you think that? it really depends on your setup Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 18, 2016 Author Share Posted May 18, 2016 I'm referring to this particular project, uploaded above. It does not seem to work any other way. Quote Link to comment Share on other sites More sharing options...
anim Posted May 18, 2016 Share Posted May 18, 2016 from your first post I suspect that the first line is the problem vector goalPos = point(@OpInput1,"P",@id); as @id possibly ranges from 0 to at least number of points in your sim, then if you are sampling a geo that has less points, it may of course seem like it doesn't work, but it's all about knowing what your data is and what you want to do so for example changing that to vector goalPos = point(0,"P",@id % npoints(0) ); or even : vector goalPos = point(0,"P", floor(rand(@id)*npoints(0)) ); may work for you better, however this is just my assumption of what your problem may be as I can't check in Houdini right now Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 23, 2016 Author Share Posted May 23, 2016 (edited) Hey Tomas! On that note, what code could I write to specify a group of points for each point to head for? For example, I am using a word with 6 letters- "ALRIGHT". I have a source point for each letter as the POP source, and their id's are 0 through 5. I want each of these source points to shoot it's particles at its respective letter. That is to say, the A source particle would shoot it's particles at the A points... I think I need to do two things: group the goal points by letter somehow (using a 'for each' maybe?) and subsequently specify this attribute in the code you wrote above, i.e. "vector goalPos = point (of your same id)" does that make sense? thanks for any help, cameron EDIT: I used textindex and promoted it from primitive to point before going into dops, so now the source points and the goal points have a common link: textindex. How do I specify that in the POP wrangle? Edited May 23, 2016 by cwalrus Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 23, 2016 Author Share Posted May 23, 2016 Hey Tomas! On that note, what code could I write to specify a group of points for each point to head for? For example, I am using a word with 6 letters- "ALRIGHT". I have a source point for each letter as the POP source, and their id's are 0 through 5. I want each of these source points to shoot it's particles at its respective letter. That is to say, the A source particle would shoot it's particles at the A points... I think I need to do two things: group the goal points by letter somehow (using a 'for each' maybe?) and subsequently specify this attribute in the code you wrote above, i.e. "vector goalPos = point (of your same id)" does that make sense? thanks for any help, cameron Here's where it stands: testPOPWrangle03.hipnc Quote Link to comment Share on other sites More sharing options...
Atom Posted May 23, 2016 Share Posted May 23, 2016 (edited) I'm not sure exactly what you want but if you just want particles to move from one location to a goal consider adding a popseek. Put the popseek in VEX mode and use this code. goal = set(v@goalP[0], v@goalP[1], v@goalP[2]); Then inside your pop wrangle use this code. i@txtindex = point(@OpInput2, "textindex", @id); v@goalP = point(@OpInput2,"P",@txtindex); if (length(v@goalP - v@P) < 0.5) { // Achieved goal. v@v = 0; } else { // Continue moving towards goal. } The 0.5 is how close a particle needs to be to the goal location before it stops moving. ap_testPOPWrangle03.hipnc Edited May 23, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
anim Posted May 24, 2016 Share Posted May 24, 2016 there is many ways, the easier would be to emit from the same points as the goal just scaled to the individual centers and if you know the original ptnum, then that point will be the goal the more flexible would be to get random goal point only from the points with the same textindex so here is that way: // get number of goal points with the same textindex value int npts = findattribvalcount(1, "point", "textindex", i@textindex); // get random index within that range int i = floor(rand(@id)*npts); // get goal point number matching that index int pt = findattribval(1, "point", "textindex", i@textindex, i); // get P from found goal point v@goalP = point(1,"P",pt); // set some force towards that P v@force = (@goalP - @P) * chramp("fade", @nage) * 10; testPOPWrangle03_fix.hipnc (and I disconnected some streams for clarity, as well added textindex to source points and removed id from goal points as that's not necessary) 1 Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 24, 2016 Author Share Posted May 24, 2016 Thanks guys Quote Link to comment Share on other sites More sharing options...
cwalrus Posted May 24, 2016 Author Share Posted May 24, 2016 Hey there - again. I want to have the letters' emissions each have a tiny offset from one another. My current solution isin SOPS - to group the points in each letter (using ceil(rand($SOURCEPTNUM*ch("../s/seed"))*4)%4==0 on a Delete sop) and then timeshifting it. However, I am wondering if this can be done in Dops instead - seems more elegant. Is there a way to offset the emission in Dops, per letter? Something involving putting an expression in Impulse Activation like $F==$SOURCEPTNUM ? (which doesn't work for some reason) thanks! 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.