Jump to content

Search the Community

Showing results for tags 'foreach'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Lounge/General chat
    • Education
    • Jobs
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
  • Coders Corner
    • HDK : Houdini Development Kit
    • Scripting
    • Shaders
  • Art and Challenges
    • Finished Work
    • Work in Progress
    • VFX Challenge
    • Effects Challenge Archive
  • Systems and Other Applications
    • Other 3d Packages
    • Operating Systems
    • Hardware
    • Pipeline
  • od|force
    • Feedback, Suggestions, Bugs

Found 26 results

  1. Can anyone tell me why this happens? I divided some quads from a grid. In a foreach loop i grouped prims with 3 points: if(npoints(0)==3){ f@group_delete = @ptnum; } but it only adds half of the triangles to the group. If i do npoints()==4 no prims are added to the group. If i do unique points before the loop only some of the quads are added. I suspected that this has to do with vertex numbers v.s. point numbers. so i tried primvertexcount() but got the same result. how can i remove all triangles from this geo? thanks b
  2. Creating subfracture group

    Good Evening, Im trying to improve the look of my fracture setup using booleans. The pieces look great but due to the boolean cutters the pieces dont read so well in DOPS. I decided to measure the chunks and shatter only the larger pieces in a bid to improve the collision geometry. I want to use a forEach loop for each large chunk, shatter it and then assign it to a group or assign an attribute so that I can use them later in the constraints network. Those chunks will have glue constraints set to -1 so they dont break basically meaning they are the same as the original piece but will read in DOPs better for collision geometry. I dont want the subfractured individual piece info just the original whole piece. Is there a way to create a group for each loop of the forEach. Then I would have groups like unbreakable_01, unbreakable_02? Would appreciate some pointers before I go insane haha hip attached. Thanks, Duncan forEachLoop.hiplc
  3. Hi all, I've started putting an asset together which allows me to create multiple 'threads' from a single line, then effect them as if they are fraying/weaving. I'm quite happy with it, however my approach doesn't lend itself well to anything other than straight lines, and I'd like to apply it to more/multiple complex curves - so that it follows their contours exactly. At the moment it does 'work', however it distorts the original curve quite a lot, which I'd like to avoid. Could anyone suggest a way for me to adapt my current VOP setup to calculate the trigonometry per curve? Or an alternative to using the 'wireU' attrib? Or alternatively, if there is a different approach I should be taking all-together? any pointers in right direction would be much appreciated .hip attached - Thanks in advance! (N.B. This setup is loosely based on a thread I originally found here on odforce some time ago - but I cannot for the life of me find it now, so a hat tip goes to OP if reading.) thread_tool_asset_003.hip
  4. I have a Foreach loop which processes a bunch of primitives, one-by-one. Inside the loop I have I a Ray SOP. For its target geometry (i.e. what I'm projecting on), I want to use the original target geo (coming from outside the Foreach loop) plus all the projected primitives processed so far, i.e. the progressively accumulated results of previous projections. I don't want the loop as a whole to work in "feedback" mode i.e. working on previous iterations. I want the loop to process primitives one by one. I just want the to Ray SOP to accumulate iterations (previous projections). Any advice how to arrange this?
  5. uhm... Im trying to avoid using copy stamp as suggested in H16 and use a For Each loop instead... but I cant seem to make sense out of it! (I watched a few videos and checked the help - but they seem pretty useless / over-complicated). I simply want to copy some geometry (eg. circles) onto some points (eg. on a line) + each point has an attribute --> I scale each geometry based on the point attribute. Seems like a perfect iterative loop over points task! When I put my copy to point(s) node inside the for each loop everything works fine (the copy node only receives one point which is fed iteratively from the the for loop). HOWEVER when I apply the transform node and I use vex (@attribute_name) to try to access the attribute value associated to that point to scale my geometry it doesnt work (I get 0). If I try to access the same attribute using a wrangle node it works. Maybe Im doing something silly wrong with the transform node... but what I do seems intuitively right (type the vex attrib name in the scale Thanks!
  6. Hi guys, first topic, it's a beautifull moment. So i have a really really simple thing to do but i can't figure a way. I have like 3 objects, i want to go threw a for loop to get the bbox of these 3 objects and the generate a bbox from a cube with every of these objects. So at the end i will have 3 boxes with the size of the windows. I want to make it automatic so if i plug a new window it will be generate. Easy right? But i can't find the way to do it with the for each loop, some help? thanks So just for you to know, i loop in every windows and i take the bbox in a wrangle with this v@bbox= getbbox_size(0);
  7. Point Wrangle inside foreach loop

    I'll get right to it. I am running a foreach loop on a bunch of prims. For each prim I scatter a number of points. Still within the foreach loop, I run a point wrangle on those points. In the wrangle I run intersect on each of the points and if one hits I want to set an attribute on the prim (foreach loop peice) that the points were scattered on. In the end I don't need the scattered points, I just need the prims output with the attribute @keepage. What I cant figure out is how to set up the forloop so that this works.
  8. This has been driving me insane for the last half an hour so I thought I'd see if anyone here has any insights. I've made two near identical setups. One in a foreach subnet (working correctly) and on in a foreach block (not working correctly). I've attached a simplified setup to demonstrate the problem. I suspect it has something to do with the "merge each iteration" option. Which seems to work slightly differently on the blocks. It's like it's not feeding the results back into the next iteration correctly. Any ideas? There's no real reason that I can't use a subnet, I'm just intrigued as to why the results are so different. I'm sure it's just me doing something wrong. FOREACH_Loop_vs_Subnet_01.hiplc
  9. I have replaced the file with just a cube so you guys can still see what is going on. It's very basic. It's just a box with points at the center of each piece telling what is active and what is not active. however when I put this expression: point("/obj/Angel/AC", groupbyvals("/obj/Angel/AC", D_POINT, "name", $OBJNAME), "ACTIVE", 0) in the active value DOP that I got from another dude on a forum on here, that expression doesn't work. Can someone please tell me what I am doing wrong here? This is for a demo reel project so I am on a time crunch..that's why I'm posting this. Thanks so much!! Angel_Destruction_3.hip
  10. 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
  11. Hello, I am working on a project helping a friend where I have a fractured character/object (made of a cloth like material) that is basically disintegrating and blowing away using the spring SOP with help from a CMIVFX Tutorial The only issue is that I need the pieces to dissolve away to nothing as well. I figured the "foreach" node (with a transform node shrinking as time passes with $FF) would be the way to go, but I am still learning Houdini and VEX expressions, and despite any research, I have not been able to really understand how to get it to do what I want. The foreach node still kind of confuses me at the moment. How can I get each piece to shrink way over time to nothing? Thank you in advance for any help. Thanks, Dustin
  12. Hey guys, I am using a foreach block in a solver sop but the foreach causes my point orders to changes, if I bypass the the foreach my point order stays intact as the points accumulate. In the foreach I am using a static point attribute that exists on the points before they enter the solver, and in the solver I want to use the attribute to apply different transforms to the points based on geometry with a matching attribute. Everything about the setup works apart from the point orders changing as the point increase messing up my system later down the line. I attached a simple example to illustrate the problem. Any ideas for what I am doing wrong or could do differently? Thanks, Zybrand foreach_point_order.hip
  13. Hey everyone! totally beginner question. I'd like to use an attribute to extrude geometry after fracturing. In the attached example I'm painting my point density, fracturing a plane and then run through pieces with the extrudeLevel attribute but the extrusion never seem to work. Any tips very appreciated! basicSetup_1.hip
  14. Hi, I'm trying to make an object explosion and I prefractured the object using the voronoi fracture node. Then I use the foreach to calculate the volume of every object and delete it if smaller then n. All works well, but if I enable the option "Add Interior Detail" when the geo passes through the foreach the point number and the prim number change (not the number of points) and I use it to delete the object ... Any idea why this is happening? Thanks in advance! Marco voronoi_fracturing_and_foreach.hipnc
  15. EDIT The problem comes from the clusterpoint node which seems to add a duplicated piece name with no path: I am trying to do a bullet cluster sim. i am having a problem when doing the glue network. For some reason the connectadjacentpiece node doesn't want to compute on one of the cluster created. Whatever the number of cluster, there is always one cluster that will not be computed by the node. It seems that the problem isn't the foreach as when i try to select the problematic group and apply the connadjpiece outside the foreach, i still get no connection computed for that particular cluster in this particular example bullet_cluster.hipnc i added a partition to debug and see which cluster doesn't compute. You can change the cluster group and see that it works for all other cluster thank you for helping.
  16. Shadows over loops

    Hi! So we can't have nested foreach() loops? This: int thoseNumbers[] = array(0, 1, 2); int otherNumbers[] = array(3, 4, 5); foreach(int this; thoseNumbers) { foreach(int other; otherNumbers) { } } throws this: warning.WTF? Happy rainy day!
  17. Hi Folks! My new tut is uploaded. Hope it will help! Please share with me if you have some better suggestion on this technique. THANKS in advance! CHEERS! Link:
  18. Selfmade image blur filter

    Could anyone please give me some advice on how to program a simple box filter in COPs using python or VEX? Basically calculating the average of every pixel and its immediate surrounding pixels over and over again? I created one in a VOPCOP2filter, but due to the lack of a foreach-node in COPs I cant repeat it multiple times without copying nodes over and over again (see attachment). boxblur.hipnc
  19. Geo cutter setup problem

    Hello, I'm trying to create setup, where multiple objects are cut by multiple lines. I got inspired by this great thesis. So I guess it should contain two foreach sops: one for each geometry (based on piece attribute from connectivity sop) and the other for each curve (based on line attribute from connectivity sop). But I cannot get it working. Would you be kind to look into attached file and suggest a solution? Thanks geo_cutter.hipnc
  20. Hi, guys. So there is a problem when i created a point solver SOP in foreach. I have three moving point which i want generate their trail each, so i merge their last frame in solver SOP. After above steps, the point haven't get a nice trail, it looks like only one point works, the rest of them just disappeared. I will be appreciated if someone can help me out. Thanks. point_solver_in_foreach2.hip
  21. Hi. Im trying to do a fracture and make some glue constraint but the problem im havin is that the glue adjunct pieces doesnt work inside my foreach. Please help! Thnx see attachment! ForEachConnectAdjunctPieces.hip
  22. Hello All I have a question regarding control of individual pieces of voronoi geometry using some sort of velocity expression.(I am a noob when it comes to expressions so go easy on me) I think this can be implemented using a ForEach within the AutoDOP What I'm trying to achieve is basically this- Once my voronoi pieces leave the main body of geometry I need to scale down the piece to nothing or make it vanish at a set point in the scene. I'm trying to give the pieces the illusion that they are disintegrating. I plan to attach a small emitter to each piece to add to the look. I'm currently using a glue network that is controlled by Cd attribute using a distance threshold on a sphere to delete the glue network when I need to release the pieces from the main body of geometry... anyway rather than babble on I have attached the file to this message so the script can be looked at. The file poc_RESIZE_v2r5(elongated).hipnc is the script where i generated the sky_for_sim.bgeo and the poc_v9r3_elongated(finished_poc_sky).hipnc is the main file where the sim is implemented. Any help with this would be fantastic as my back is well and truly against the wall Cheers C C poc_v9r3_elongated(finished_poc_sky).hipnc poc_RESIZE_v2r5(elongated).hipnc
  23. Sequentially Carve Lines

    I've got a foreachSOP but I'm not sure how to get the carveSOP to read each primitive number and carve them one by one. SequentialCarve_v01.hip
  24. Hi guys, I’m new to this forum and to houdini I am working on a setup to fracture a tower consisting of a couple of pillars and platforms. My setup of the pillars basically looks like this: -geo -file -copy -foreach - subnetwork - fracture setup - subnetwork - glue setup -dopimport The goal is to have as many pillars to fracture as I want (on top of each other to form a tower), but the problem is, that if there are more than 1 pillar, the dynamics behave very strange (if one pillar is hit by something all of them react etc...). I think the problem is that the voronoi fracture creates a name attribute for each piece which is used by the dop network, but if there are 2 copies, I have 2 pieces with the same name. Maybe there is a way to name the pieces accordingly to their pillar (like: pillar1_piece01). I've tried using a connectivity node (before the foreach node) to create a attribute "copynumber" but I don't know how I can access it in the voronoi fracture node where the names are set. But this is just my assumption, maybe there is a whole other problem with this setup, but I hope that my problem is understandable and that somebody can help me out
  25. Hello, I'm trying to find a way to write out certain values from inside a foreach iteration to somewhere else, so that I can refer to it in subsequent iterations. On showing off my newly acquired Houdini knowledge to a friend I was tasked with procedurally generating something much like a pine cone. -I have bitten off more than I can chew. I've found it very tricky to procedurally generate this object. -The idea is that the 'scales' of the cone start off large at the bottom of the cone, and as it moves up they get smaller and smaller. For simplicity right now I've just gone with putting scales over the surface of a cone like shape. I'm using a FOREACH node to do all the work. -I have a curve that represents the height of the cone. -Inside the FOREACH node I use a 'carve' sop to cut the line at a certain point for each iteration and put in a circle of scales. Initially I was using a maths function that didn't need any knowledge of what the previous iteration had done, but I'm not getting enough control over the distribution. (Bottom scales too big, top scales too small) What I'd really like to do is write out the distance travelled up the line in each iteration to somewhere, so that it can be referred to by the next iteration. For example, the bottom scales are 10% of the total height and I want them to shrink by 1% each time. -> 10% - 9% - 8% - 7% - 6%: My maths isn't good enough to just know how high up the line the next iteration needs to be placed. Ideally I can keep a running total of what;s been done that the sops inside the foreach node can refer to. I'd appreciate any help on this. 'regards Sim.