Search the Community
Showing results for tags 'ForEach'.
-
Hi! This is my first post to this wonderful forum, my teacher recommended it to me since I'm the only one in my CG-course to want to work with Houdini and the autodidactic approach can be harsh sometimes I was following the classic "vex isn't scary"-tutorial on for loops and decided I wanted to try to make the "infected" points also move into a new position within the foreach-loop after they've become infected, which worked fine. But then I tried to create a float parameter that blended the initial position of each point and the new position, so that you are able to see them moving towards the center as they became infected, and got completely lost in the sauce. Anyone know how to write that in VEX? I attached the file with directions. Looking forward to spending time within this community, you guys are awesome! FORLOOPS_VEX.hipnc
-
Hello everyone, this is my first post on this forum so thank you for welcoming me and please be indulgent if I'm not posting on the correct channel. I've been trying to wrap my head around an issue that I'm facing with VEX for a couple of days but I'm really stuck. My goal was to iterate through each points of a input and to create a Polyline between two points if there are close enough from each other Problem is that if point 1 is close from point 6, it will create a Polyline (so far, so good) but when my VEX script reach point 6, the invert is also true. So VEX will create a second line from point#6 to point#1... I'm trying to add some line in my script to raise a flag if a point has already been "activated" (used if you prefer) to use that as a check before creating anything. From my understanding VEX scripts are running on each points sequentially so I tried to create an attribute called "active" that I can raise to 1 every time this point has been going through my script. When I'm trying to get my attribute "active" from my foreach loop, it returns 0 if "active" has been initialized on the same VEX wrangle node but it's returning the right value if it has been set in a previous node. What am I missing here ? Thanks float radius = chf('radius'); int ptArray[] = nearpoints(0,@P,radius, 2); @active = set(1); i[]@array = ptArray; foreach(int pointNum; ptArray) { int activated = point(geoself(),'active',pointNum); printf("activated = {%g}", activated); if(pointNum != @ptnum && activated != 1){ int line = addprim(0,"polyline"); addvertex(0, line, @ptnum); addvertex(0, line, pointNum); setpointattrib(0,"active",pointNum,1,"set"); } }
- 5 replies
-
- attributes
- foreach
-
(and 1 more)
Tagged with:
-
I am trying to rearrange all the primitive blocks using for loop but couldn't find a solution. I want to revert all the pieces back to their original place from the centroid. I used 2 transform nodes in the for each node to bring all the pieces to the origin. Now, I want to bring all the pieces back to their original position aka the first screenshot. Heres the hip file. Thank you for reading reaarange_test.hip
-
Hello, I'm learning houdini and so far I'm loving it but I'm having a problem to understand a concept of manually editting something that has already been generated. I guess this could be quite a common use-case but I haven't found solution anywhere so I'm trying to seek help/guidance here: I am working on procedural generation of buildings from their footprints. To simplify, I have a geometry node in which I have a foreach loop SOP that iterates over footprints (primitives) and extrudes them based on their height attribute. Now, is it possible to select a specific footprint and change its height attribute so that this specific footprint will be extruded by different amount? What I'm trying to achieve is that user is able to select any procedurally generated building and adjust/override its default/random parameters like height, roof type, texture... and after that - this building will be re-generated reflecting these changes (while other unchanged buldings won't be regenerated to speedup this process) Does houdini provide such functionality? Or are there any best practices how to approach this problem? Thanks
-
Hi, I've created a basic picket fence setup. Each picket is positioned on a ground fence segment based on its width, as well as the segment's length. There's a curve_height that I want each individual picket to extend to. I'm currently stuck as to which part of the for-loop to put it in. The curve_height section is in the red network box. Thanks for the help. picketFence_w21_alternateHeight1.hipnc
-
What do these two lines mean? I do not understand. Please explain. addvertex(0, prim, @ptnum); addvertex(0,prim,pt); I don't konw why "ptnum" is needed here.
- 4 replies
-
- nearpoints
- vex
-
(and 2 more)
Tagged with:
-
I have this code below: i[]@TP = neighbours(0,0); foreach(int i ; @TP) { @P.y = 1; } how can I tell Houdini to just move the points insideTP array? foreach move all the points.
- 10 replies
-
- foreach
- neighbours
-
(and 2 more)
Tagged with:
-
Hi All, sorry for the heading, Its a hard one to describe lol. I have a booleanfracture piece and want to process only the middle points , then with that create geo that knows the distance to top and bottom of its local position (as the slice fracture is not a flat plane, hopefully a picture helps). Im not sure the best approach, I would start with nearpoints in some way ,finding the top points and test down for a middle storing the lowest for distance checks?? lol, well its a tricky one
-
Hi guys, I'm a little lost on how to calculate distance between successive points (picture) of my floor mesh. I guess i have to use a "for each point" in Vex. This distance will help me to creat wall with the exact scale between angles. Thank you for your help.
-
Hey! I'm fairly new to Houdini and have been trying for hours to work this out! I'm making a greeble tool want to be able to scatter assets on top of the greeble. The (placeholder) assets are in their own subnet and are all in the one object merge within the greeble node network. Is there any way I can randomly switch between these objects while they're in the one merge? So that then user could add more objects into the merge as well using the UI without having to edit things inside of the greeble node network?
- 2 replies
-
- switch
- object merge
-
(and 1 more)
Tagged with:
-
Hello everyone ! I have some trouble with the foreach loop, and after some search I have not found an answer... I want to connect points from two scatters and do some operation on each pair of points : connect them to a line, resample, noise and set pscale depending of point number of each loop. Here is what I have : A scatter "A" creates two points. For each of thoses points I want to scatter (with scatter "B") another point and connect them together. Here is my two issues : 1- I don't know how to scatter from a sop outside the foreach loop. 2- I connect my points using the add sop setted to "Polygons > By Pattern > Polygon 0 > 0-$N". Will it work on the second iteration ? Here is an image of my network : Thanks for helping ! scatterForEach.hipnc
-
Hello everyone, I come to you because I have a little trouble understanding a tutorial. Indeed I look at the tutorial "Abstract Effect a Houdini" the problem is that it is a version prior to 17 and since the node "For Each" has changed. So in the Tutorial it does as in the picture 1 to get the picture 2 I block here (picture 3) and there are plenty of node for each and I do not know which to choose. . . I tried several times but I can not get the same result. Do you have any ideas ? Thank you in advance everyone. os: sorry for my english, i use a translator
-
Hey all, Trying to wrap my head around this... thought it was going to be easy until I got into it. I'm tying to randomize each level in a copy transform in my setup. I get close but I end up randomizing all prims instead of each level. I attached the hipfile. jl_iterLevel_01.hip Please Help, Thanks!
-
Hello I'm doing a RBD (bullet) sim with custom concave geo (proxies) that I pack my self using assemble. I use a scatter and copy to points to set up my inital state, run the sim. I use a dopimport, and I would like to fetch the hi rez geo. Tutorials show that if I had the high rez geo scattered the same way I could plug it and it would work straight away. However I would like, with only my points, to retrieve the high rez geo. I thought I would use a foreach and apply primintrinsics or transformpieces or even a copytopoints as seen in some tutorials like here but nothign works, my scales and pivots don't seem to work. To give you an idea of what my network looks like before the dopnet: I cross posted on Sidefx forums but it wasn't published sorry for the crosspost. If you have any info on this I'm very interested.
-
Hi, I have attached a scene file for reference, in the scene, I have fractured a box and used a for each loop to adjust its pivot points and position and again I have used a grid and scattered point to copy it. I have used for each loop to and a copy to points node. My problem is that, all of my fractured geometry gets copied to each point, while I know copy stamp method but is there any other way that I can use to copy each fractured piece coming out of a loop randomly over the scattered points via a copy to points node. Please let me know, I have attached a file below. * Also can you please let me know how to add strings in attribute vop node, suppose I want to create a string called "piece" inside the vop node and add the id or any random number to it and combine both the values as strings and also export it as a string attribute. Thanks copyToPoints.hipnc
- 10 replies
-
- copytopoints
- copyinstance
-
(and 3 more)
Tagged with:
-
i am trying to run over named primitives, but the for each loop seems to pick randomly for each iteration which batch to process. i want the loop to respect the sorted primitives and run over each named primitive as it is in the geometry spreadsheet. How does it pick the first batch for iteration number 0? can i change that? image 1 is before the loop,sorted primitives image 2 is inside the loop with a single pass to see iteration 0 As you can see the first batch the loop chooses to process is not the first batch as sorted before. First batch should be the one named color_229_229_0
-
Hi, I would like to create a stack with some pieces of geometry and scale down each of them based on the previous bbox. The final look should be a pyramid based on the geometry you are using .. My problem is that I haven't been able to figure out the correct VEX syntax to use a point wrangle and read the bbox from the previous iteration. Any help out there? Thanks I attached a graph example testing.hipnc
-
Hey guys, I never got how does a foreach works in vex (at all!), can someone please explain me this? It does the same thing as the For-Each Loop node?
-
Hello, I want to create a fire from multiple moving objects. I tried to merge them and create a Pryo source then plug this into Pryo Solver but this was a bad solution as the bounding box is getting very large. I tried to run foreach loop on each moving object and then create a pyro source and then plug the result into Pyro Solver but the Bounding box is now tracking the first object but not all the other. If anyone have good solution for this problem please share it with me, also .hip files are very welcome if you don't need to write a long solution i can just dig inside Thanks.
-
Hello guys I am still quite new in VEX coding and I am all day fighting with set of gravitational rules based on a membership of the points in groups. I am emitting particles, the particles are sorted to groups by 3-6 nearest points. So after couple of frames of emitting particles I have 100 groups and each groups has 3-6 points. Now I need to set some gravitational rules for every group so the points in every group will be attracted to each other just inside the group. I got stuck here. If anyone has any idea how to solve this issue, it would be perfect. Many thanks in advance. ap_ParticleGravitationalAttraction_01.hipnc
-
Hi community! I have a huge destruction scene, where I'm stuck with the ground impact dust. Basically i need to make a smoke sim on every collision with the ground. I have my impact points in place, with birth frame data as well. My guess was to make a for-each loop with a DOP inside of it for every point. It works, but every frame it recalculates the whole sim until the current frame, which is of course is not good. The scene is so huge and scattered, doing this in 1 sim would take an eternity. How can I do this in a correct way? I`m sorry, but i can not post any of the hip file. Thanks for reading this, also a huge thanks if you answer. Cheers. **edit: im on H16.0
-
Hey! I was wondering how to copy Geo to points using the Foreach Loop block, but without using a switch. Instead I am trying to use groups to switch between the input Geo. Unfortunately I was not successful yet. Maybe anybody has an idea what I am doing wrong here? Best, M CopyLoop_01.hip
-
Hello Everyone! How can I loop so that the output geometry is used at the beginning of the cycle? Where am I wrong? I only get two dice, but no more .. Procedural_house_base.hipnc My result (only 2 blocks) My goal (several blocks with copying on the new ones points ) Have a good day All