Jump to content

Search the Community

Showing results for tags 'vex'.

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 232 results

  1. Silly question, but total wrangle noob here... I want to set random grey scale values on points, not sure if I should be using @id or @ptnum and how the expression would look? TIA
  2. Hey all: I have a particle simulation with particles shooting outward from the origin. I am using the particle replicate to emit particles from particles. Here is the problem, I want the particles close together at the top but further away toward the bottom like the photos shown below. My Idea was to do a point jitter based of the age of the particle, so that new particles will have no jitter while old particles will have jitter. Would it be possible to accomplish that using vex in an attribute wrangle? Or could it been done in a point VOP with a slider to adjust jitter by age? Or is there a better way to have the older particles move out further outward? than using point jitter? explosion001.hipnc
  3. Hello, guys! I keep having an issue when I try to compare attributes from two distinct points. The VEX program tests if they are equal, like this: if(ptu == t_start) And although I see in the geometry spreadsheet that they are, the VEX code say they aren't. I thought It was a precision problem, so I rounded both values to a three float precision value //round t_start = rint(t_start * 1000)/1000; t_end = rint(t_end *1000)/1000; ptu = rint(ptu * 1000)/1000; This was the solution for some points and for others, the problem persisted. Some still have the same values in the spreadsheet and the VEX code interprets them as different values.
  4. Hi guys, I was hoping someone might have a clue here...I have a vop with an object running over an rbd simulation to activate pieces, the only problem is they seem to be becoming inactive again after being activated. So the basic question here is if there is a way to fix an attribute once it reaches a number (in this case 1) so it cant change back to 0? Cheers!
  5. Jake's HIPs Don't Lie

    HI FRIENDS! So over the past year I've been doing far too much Houdini in my free time, and I noticed that all of the people I look up to in the community have their own cute ODForce threads. So with the release of my latest blog post on Voronoi Diagrams and Remeshing, I thought it best to make one of those threads, to avoid flooding the Education section with tons of new posts... Anyways here's a link to my new blog post: https://medium.com/@jakerice_7202/voronoi-for-the-people-60c0f11b0767 And if the link itself isn't enough, here are a couple of GIFs from the blog post, including one that didn't make the cut. All credit for the post title goes to @mestela <3 Big thanks to @toadstorm for editing my grammar as well, and the whole ThinkProcedural discord for putting up with my insanity
  6. Hi all! Posting this challenge here means i've spent a lot of time searching for a solution at this problem, no succed. It's quite simple: You have a set of points, a randomly event occurs for each one of them and once that happens I want to set the frame of the incident into a point attribute. I think is simple but i've been stucked for a few days, hope you guys can find a solution and bright me one more time. Thanks! I attach an example (failed) file. setFrameIntoAtribute.hipnc
  7. Hey!!! I am trying to add smoke to a shattered statue simulation. The falling pieces will emit smoke. I want the geometry to be deleted until the pieces reaches a certain velocity (if (@v.y < ch('threshold'));) , so that the emitter geo wont appear until the geometry is actually moving. That will keep smoke from emitting while the statue isn't falling apart. Finally, I need the geometry to be deleted when it is about to hit the ground, so I guess delete by Y position. I am trying to do this in an attribute wrangle. All the pieces have their own name attribute, piece1, piece2, etc. Here is my logic so far, I just don't know how to right it in vex: if (@v.y < ch('thresholdvelocity')) or (@p.y < ch('thresholdposition') then delete that whole piece. Any help would be appreciated. I am new to vex and I am trying to learn these things on my own, but sometimes I need help : ) Thanks edit: I can't add my original scene, but I made a sample scene. delete_geo.hipnc
  8. hi everyone.wish you have a nice day. i need some help about scripting.but my English skill is not well.sorry for that. i have a hip named "test_hipfile_v001.hip".in this hip file i have a geometry ROP node that i want cache something like pyro,particles.and i want the cache named like "cache_pyro_v001.bgeo",the important thing is the cache version equal file version. here is the function i want achieve: when my hipfile update version to v002,i want the cache version auto-update to v002. i know $HIPNAME can fetch the file name ,but i don't know how to fetch the version info from $HIPNAME and transfor to .oh,i forgot another thing is i want code only in the Geometry ROP Node,because i achieve this function in SOP use Attribute Wrangle SOP Node,and transform the version info to ROP Node,but i think this too messy. can you gays give me some advise?thanks.
  9. Creating VEX libraries

    Hi, I've tried to find information about this but it's hard to come by or maybe I'm not looking in the right spot. After all I'm an improvise programmer. I want to create VEX libraries of functions and possibly structs (but let's start with functions). You know, functions I would use often and that I would not have to copy paste from AttribWrangle to AttribWrangle nodes. These functions should be accessible using #include (I think). So here is a few questions to get me started... 1) How to structure the inside of the file? I don't want to compile them into an asset. For example if I put this straight into a .vfl file and compile it will it work or it needs a header? // Function to Round at specified intervals int roundToInterval(float val; int interval) { float new_val = ceil(val / interval) * interval; return int(new_val); } 2) How to compile those files? Seriously I don't understand any of the compiler stuff... Do I even have to compile them??? What is a .h and do I need to use it? 3) Where to put the files? I want a common location that is not inside any of Houdini folder structure. Where do you specify that Houdini should look in an external folder for these extra functions? You know like adding HOUDINI_OTLSCAN_PATH to the houdini.env file. Is there a HOUDINI_VEX_PATH that I could use??? 4) Finally, is using the files as simple as doing #include? It would be nice that this was written somewhere because some of us don't have the programming background necessary to understand these easily. Any help would be appreciated. Thx! Christian
  10. Particle Driven Wave Simulation

    Hi guys, I was following along a tutorial and wanted to implement the VOP's I got into VEX but for some reason I cant sort this bug out. This is inside an attribute wrangle after pop collision: vector center, newVect, Cd1; if(1==0){ //@P.y = noise(@P); }else{ for(int i = 0; i<chi("Ripples"); i++){ Cd1 = @Cd; vector PTemp = @P; offset = @Time; freq = ch("Frequency"); ampli = ch("Amplitude"); center = @hitpos; dist = distance(PTemp, center); trig = ampli * sin(dist * freq + offset); if(@Cd=={1,0,0}){ newVect = setcomp(PTemp, trig, 1); fVal = getcomp(@Cd, 0); //@P.y = lerp(@P, newVect, fVal); //@P.y = blend; @P.y = lerp(PTemp, trig, fVal); @P.y*=i; } } } and this is what the attribute VOP created in CVRipplesPro.hipEX: // Code produced by: distance1 dist = distance(P1, hitpos); // Code produced by: input2 input21 = 12.699999999999999; // Code produced by: multiply1 product = dist * input21; // Code produced by: sine1 sine = vop_sin(product); // Code produced by: multiply2 product1 = input2 * sine; // Code produced by: vecsetcompon1 newvec = vop_setcomp(P1, product1, 1); // Code produced by: vecgetcompon1 fval = vop_getcomp(Cd1, 0); // Code produced by: mix1 #ifdef __vex blend = lerp(P1, newvec, fval); #else blend = mix(P1, newvec, fval); #endif // Code produced by: geometryvopoutput1 vector _P = blend; vector _v = vector(); vector _force = vector(); vector _Cd = vector(); vector _N = vector(); { // Code produced by: geometryvopoutput1/P P = _P; } }
  11. Is it possible remove the attribute use wrangle sop. I can't find any attrib delete or remove function in VEX. Thanks!
  12. U coordinate on closed prim

    How can I read the U coordinate (from 0 to 1) of closed primitives in VEX? I tried xyzdist and primuv ... int prim; vector uv; xyzdist(0, @P, prim, uv); v@uv_profile = set(uv.x, 0, 0); ... but I only got results that did not represent the relative distance between the vertices.
  13. Read point array attribute from detail wrangle

    I am in a detail wrangle and want to read the first component of a point array attribute. Unfortunately neither point() nor attrib() seem to offer this. I couldnt find suitable array functions, either. int npts = npoints(0); i[]@prim_list[npts]; for(int i = 0; i < npts; i++){ @prim_list[i] = point(0, "sourceprim", i).[0]; // try to access first component }
  14. This is driving me crazy. Trying to get a simple colormap VOP example working. No errors but my image is not showing up mapped to my grid. Could any vexperts possibly have a look at my .hip? As good as the revised H16 documentation is, it could greatly benefit from actual downloadable .hip files! colorMap_VOP.hiplc
  15. In Vex, I'm trying to find a signed angle between two vectors i.e. an angle which treats one vector as a "base" and the other as a rotating "clock hand", so that I get positive angle for a concave angle between the two (0-180 deg) and a negative angle for a convex angle between the two (180-360 deg). The dot product on normalized vectors gives me the angle, but it's symmetric. Is there a trick that gets me the sign?
  16. Hey, I have been reading the houdini manual section on vex. I must be understanding the documentation incorrectly. For instance, here is the syntax in the documentation for "if" statement: if (condition) statement_if_true [else statement_if_false] What I don't understand is that syntax doesn't work. If I write: if (@id < 60) force.y = 20 [else force.y = -20]; that does't actually work. I must write this: if (@id < 60) force.y = 20; else (force.y = -10); Writing it that way works. Why would it show the syntax the other way if it doesn't work? Thanks
  17. Detect surface using VEX

    Suppose I have a position (e.g. [100,200,300]) and directional vector (e.g. [1,0,0]), is there a way in VEX to fire a line trace/ray from that point along that vector and get the position of the first surface primitive that's hit?
  18. Hi guys, how do I compare to each other and get max and min values of attribute for different elements. Basically I want to compare these guys and get min and max.
  19. Hey all! I'm pretty stuck in a rut trying to think my way through what I want to accomplish with a brick tool I've been working on. Currently I can feed in a box, tube, or an L-shaped box that I've modeled and I can get well stacked bricks around the perimeter. What I'm stuck on is then taking this and adding in holes for windows/doors/etc. Similar to what is seen here: https://letshoudini.wordpress.com/2016/06/19/031-procedural-modeling-for-destruction/ What I want to be able to do is copy a pre-fractured brick to the points, like the simple box I have now in the attached hip file, with rotations to help vary the layout a bit. Thus, should I boolean out holes from the mesh after generating bricks? Maybe taking into account where windows are (will be) and then not placing brick points there? (then I would have to have half bricks to copy). Not sure the booleans would behave as I want to be able to instance high detail geo to the pieces after simulation. The solution in the link looks to be a boolean as the simulation then only runs with simple bricks clustered to add some interest to their breakup (https://letshoudini.wordpress.com/2016/09/18/037-earthquake-building-collapse-rd-01/). I don't think I'm seeing this problem clearly right now and would really appreciate some nudges in a direction to help grease the logic wheels! Hartman- BuildingForDestruction.hiplc
  20. VEX array of structs

    Hello, I'm a newbie with vex and I'm trying to create an array of structs. In my wrangle node I defined the struct in the outer code section as suggested here my struct looks like this: struct node { int pt; int nbrs[ ]; } In my code I later declare node nd; node array[ ]; I manage to initialise the nd variable normally. Then I tried the following int pt = nd.pt; //works fine int nbrs[] = nd.nbrs; //works fine array[0] = nd; //seems to work fine pt = array[0].pt; //nope nd = array[0]; //nope By doesn't work I mean that the node turns red saying the following Error The sub-network output operator failed to cook: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1 Warning: Errors or warnings encountered during VEX compile: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Errors or warnings encountered during VEX compile: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Error: Vex error: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1) Failed to resolve VEX code op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1 Unable to load shader 'op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1'. Warning Errors or warnings encountered during VEX compile: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Warning Errors or warnings encountered during VEX compile: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1). Warning Vex error: /obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1: Internal compiler error. (15,1) Failed to resolve VEX code op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1 Unable to load shader 'op:/obj/new_version/tree/growing_alg/find_neighbour/outer_code/attribvop1' Any ideas? Thank you Marta
  21. How to read matrix values?

    4@m = ch4('transform'); @test = @m[2][3]; The first line assigns a 4x4 matrix channel to 4@m. I tried different things, but unfortunately the second line does not read the corresponding value from the matrix. How would I do that?
  22. 2D walker

    Hi there, i'm trying to animate multiple points that move randomly within a boundary. So far i have the random movement done, but i want to be able to get the points to collide with the boundary and carry on moving. Any help would be great. A walker.hipnc
  23. 2d walker

    Hi there, i'm trying to animate multiple points that move randomly within a boundary. So far i have the random movement done, but i want to be able to get the points to collide with the boundary and carry on moving. Any help would be great. A walker.hipnc
  24. hi... i want random value between 0 -3 in the ratio of 2:2:6... i used "fit(rand(@ptnum),0,1,0,3)" and it gives me random no. between 0 to 3 but i also want to get them in exact ratio in a procedural way thanks in advance
  25. Squashy effect

    Hi node guys! I have a question that i breaking my non-programing head. I have this points selected based in the bounding object, I would like to push them out and make it look like is Squashing against any object in his way. I'm not using FEM because it didnt work in this case, actually dont know why. Thanks for any help or idea you can give me Jason.