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
    • Tools (HDA's etc.)
  • 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 293 results

  1. Hey! I was going through some tutorials on growth solvers, and I noticed that a lot of them are driven by the "food" group looking to get "infected" if you know what I mean. I wanted to try and make a growth solver that workes differently, looking instead at the points that are already infected and infecting more from their perspective. A very simple summation of what I'm trying to achieve: 1. List the points around me 2. If they are food, they are candidates 3. Infect only 1 of the found candidates rinse and repeat I've put the code underneath in a point wrangle in a solver, but it doesn't work well. I tried running the command on the seperate food and infected groups but that doesn't seem to improve either. What happens when it doesn't go well: 1. nothing 2. Almost every point gets put into the infected group in 1 framespan and then the solver doesn't do anything anymore. //initialiation of radius to search for, and random seed; float radius = 0.2; float seed = 8008135; //stalking prey (finding a list of points to infect); int neighbours[] = nearpoints(0,@P,radius,5); //hopefully grabbing a random one out of the stack of many; float array_length= len(neighbours); //random number between 0 and the length of the list of neighbours; int targetp = rint( rand(seed) * array_length); //looking up point ID in list of neighbours; int point_to_infect = neighbours[targetp]; //actually infect the point, if it is food; if (point(0,"infection",point_to_infect) == 0){ setpointattrib(0,"infection",point_to_infect,1); }; I haven't any clue what's going on, I got no errors other than a little green line under the local variable "targetp" when it gets created. I've attached my .hip! It might be something else I'm doing wrong. I hope you can help me, thanks in advance, Sasbom active infection.hip
  2. Hey Came to London to work for Crowd at MPC. Here's a summary of the challenges I responded to in Houdini: At the moment, I'm looking for the next thing to hop on. Most jobs for Houdini are VFX centric and I'm mostly a generalist leaning more towards geometry, rigging and motion processing side of things. Here's some public Orbolt Assets: https://orbolt.com/search/?q=probiner Building one right now to upload, to alike the matrix one, visualize arrays of vectors: https://i.imgur.com/ZPki1XN.png Let me know if there's something fit mid-term going be it for Houdini or XSI or even just if you're around and want to have a chat! Thanks
  3. Hey Folks, I wrap my head around this and cant find any solution can somebody explain me why this is not working and how I can get it to work ? // roomsizes vector zim3 = {5.25, 2.50, 3.82}; vector zim2 = {3.65, 2.50, 3.90}; vector zim1 = {3.65, 2.50, 2.82}; vector kueche = {2.50, 2.50, 3.82}; vector bad = {2.83, 2.50, 3.74}; vector flur = {1.50, 2.50, 5.71}; vector aRaum = {1.50, 2.50, 0.96}; // create Rooms // create _LivingRoom int pos0 = addpoint(0, {-(zim3.x*0.5), 0, -(zim3.z*0.5)}); int pos1 = addpoint(0, {(zim3.x*0.5), 0, -(zim3.x*0.5)}); int pos2 = addpoint(0, {(zim3.x*0.5), 0, (zim3.z*0.5)}); int pos3 = addpoint(0, {-(zim3.x*0.5), 0, (zim3.z*0.5)}); int roomPrim0 = addprim(0, "poly"); int vert0 = addvertex(0, roomPrim0, pos0); int vert1 = addvertex(0, roomPrim0, pos1); int vert2 = addvertex(0, roomPrim0, pos2); int vert3 = addvertex(0, roomPrim0, pos3); seems very simple but I miss something... and yes i am running in Detail mode thx deHeavy
  4. Hey everyone, I'm starting my houdini journey because the company I'm going to intern at in the summer does a lot of houdini stuff. I don't want to be left in the dark, so I'm studying on my own for now. When I was at the company in question, last time, someone showed me a way to use a volume from a mesh (he used the test_rubbertoy geo) to get a intersection plane without using boolean. I remember he used some wranglers, and ended up with a grid with color data which he used to delete the unnessecary parts outside the colored intersection area. Then he somehow turned the mesh into a isosurface, to smooth it out. I've been trying this for some time now and I can't for the life of me figure out how he did it. I've had two nearly succesful attempts, one where I used the Intersection Analysis to get the intersection between a grid and the (rubbertoy -> vdb -> vdb to poly (to fuse seperate meshes together)), then filled the edges I got from that, and then remeshed, which admittedly gets me at least a flat intersection plane. One major problem is that this approach makes the normals of the resulting mesh flip upside down randomly everytime I move the intersecting mesh, which is a pain if you'd want to use it for particles or something. I tried using a wrangle to copy the point normals of the nearest points to the points of the remesh, but I haven't had much luck with that. The other thing is that since the Intersection Analysis only returns edges, the shape of the surface is not taken into account, above method only returns planes and distorted planes on surfaces. The other one I used a attribute transfer with a (mesh -> vdb fog -> wrangle to fit density to 1 everywhere -> scatter -> color {1,0,0}) to project red points from the point cloud to a grid surface, which works, but VERY slowly. one bonus with this technique is that you can blur the resulting "intersection" but its way too slow. So, what I've been thinking is this: A VBD is basically a point cloud, so there needs to be a way to compare mesh points to the points in the volume, and assign a color to those points that are close to points on the geo. I remember said someone doing something like that with a pcopen, but I don't really understand how. I think I get the method, but if someone knows something better, please say so. I've been struggling with this for a couple of weeks now. I strive to be more than a shelf tool user, at the least. Thanks in advance, sasbom
  5. Array values to points

    While trying to create a point attribute based on array values from second input, I was expecting this to work: v@Cd = v[]@opinput1_colors[@ptnum]; // only works on point 0 I also tried getcomp(), but it seems I am missing something. vector a = getcomp(v[]@opinput1_colors, @ptnum); // uses first array value on all points addpointattrib(0, "Cd", a); camera_to_screen.hiplc
  6. Replicating circular points around normals

    I am currently using cross products and matrix transformations to replicate points in circles that are oriented by normals. Are there any more straight forward ways to achieve this with VEX? int points = chi('points'); float scale = 0.02; vector up = {0, 1, 0}; for(int i = 0; i < points; i++){ vector dir = normalize( cross(@N, up) ); float amount = (i / float(points)) * $PI * 2; matrix m = ident(); rotate(m, amount, @N); dir *= m; dir *= scale; int pt = addpoint(0, @P + dir); }
  7. Dynamic Vex Variable Names?

    Hi there! Is it possible to dynamically declare variables in a for loop with the index in the variable name? Current problem: I want to store primitives with similar normal angles into an array. The maximum number of arrays would be 4 (cardinal directions) but in most cases the normals head in only one direction. Thanks in advance. Cheers
  8. Hi guys I've been fumbling around with this for ages and I cant figure out what to do. I have a bunch of points scattered over a grid with a solver running through them (exactly like the infection system that simon holemadel uses) changing an attribute named 'infect'. Not infected = 0 infected =1. What I want to do is fade the color of each point from black to white over a specified amount of time from when each point became infected. I'm falling at the first hurdle of storing the time at which an individual point was infected in VEX. Im using an attribute wrangle and I think I'm on the right track with 'setdetailattrib' function, however I cant get it to take. here's the Vex code I have been using: float @timestart; if (@infect == 1) { setdetailattrib(0,"timestart",@Time,"set"); } and I have uploaded a screen shot and the scene file. If anyone can shed some light on this it would be much appreciated. Cheers Al Set_Time_Attrib_on_points.hip
  9. Color to cloth attribute transfer

    Hi guys. I'm pretty new to Houdini and I'm really unsure of the avenue to pursue achieving this effect. Essentially I have a grid with a solver changing the color of the points over time, like the infection system Simon Holmedal used in the HypervenomII spot. I then want to use this attribute to activate the cloth solver (black not affected, white affected). I really stumble at what stage in DOPs I can implement this attribute. I tried to add POP force however this doesn't work with cloth. I played a little with the multisolver node and mask input to the gravity however I have no idea how they work. If anyone could shed some light on this it would be massively appreciated. Scenefile attatched. Cheers Al Infect_To_Cloth.hip
  10. Hi folks Im a Houdini-noob, but somewhat techsavvy nerd, tryin to learn Houdini by fiddling with it, building stuff! atm tryin to re-create the "sharing" system visualised w the gif here ( i originally created it w pflow dataops in 3dsmax, but a fine case for houdini i thought ) idea of the system is each point representing a unit with a certain amount of energy if a point have a overcapacity of energy its look if a neighbour nearby is in need of energy if a energy-wealthy point sends energy to another, its withdrawn the amount of energy the lucky energylacking neighbour receives probably a deep plunge but thought, Hey I can easily write this w vex wrangles inside a SOP solver and voila - turns out not so easy... I sort of solved the exchange of energy btw groups of points, but struggle with visualising the "sent" energy as a "extra point flying from the energy-wealthy point to the energy-lacking one... seems fx i cant assign a velocity to the extra added point, only move it by moving its position Am i taking the totally wrong approach to this or is there hope? sharing v01.hipnc
  11. I Speak Whale - Houdini Project

    Hi guys, i would like share with all of you my latest personal project i did on my spare time. Hope you like it.
  12. Hi Everyone I'm currently trying to create circular point groups, inside a voronoi fracture. My outputs are groups currently are primitives but when I conver them to points, i have to many clustered together. I'm thinking of a solution by either getting the max/min two points of each primitive inside my group and delete the other points from the group. Unfortunately my VEX skills are very limited, I seem to be declaring my max function wrong. If someone could help me figure it out that would be great, also an explanation to why my attempt didn't work/ any other solutions towards achieving the same result would be more than welcome. Cheers Example.hipnc and for any questions im trying to make a tool that creates ground slams, as you can see there's distinct circular fractures which im trying to replicate, but also make procedural.
  13. wrangle nodes pragma?

    Does anyone knows if it's possible to define the UI of Wrangle nodes using some kind of vex #pragma?
  14. dops

    how different is the "pop vop" from the "geometry vop" in dops? After reading the manual i think there are subjects i dont understand and more i dont know .
  15. Hey all! I have a bunch of points travelling around, and I would like to create a new set of points, where each of them is orbiting around the given point, in the direction of the main point, I guess the image attached explains it a little better than words...just trying to do it with vex code cheers
  16. I was looking at the ripple sop and wanted to add some extra noise, I found that you can't just dive inside but it is compiled vex code so I figured it can't be too hard to recreate. Well I got pretty close but for some reason I am missing the high frequency displacement the original ripple has. Attached is an example of the ripple Sop vs my pointvop I guess I'll post the whole code first and then point out where my struggle lies: #include <math.h> #pragma oplabel "Ripple" #pragma opname "ripple" #pragma opicon SOP_ripple #pragma opmininputs 1 #pragma opmaxinputs 1 #define random0(xxx) (random(xxx)*2.0 - 1.0) #pragma label usecenter "Use Center" #pragma label t "Center" #pragma label freq "Frequency" #pragma label height "Height" #pragma label decay "Wave Decay" #pragma label scale "Scale" #pragma label speed "Wave Speed" #pragma label nripples "Num. Ripples" #pragma label seed "Random Seed" #pragma label up "Up Direction" #pragma export freq all #pragma export height all #pragma export nripples all #pragma export decay dialog #pragma export scale dialog #pragma export speed dialog #pragma hint usecenter toggle #pragma hint t vector #pragma hint up vector // Direction vector #pragma disablewhen t { usecenter off } #pragma range nripples 1 10 #pragma range decay 0.01 10 #pragma bindhandle tx xform "Center" tx #pragma bindhandle ty xform "Center" ty #pragma bindhandle tz xform "Center" tz #pragma bindhandle usecenter xform "Center" onoff #pragma bindhandle height ladder "Height" parm0 #pragma bindhandle scale xform "Scale" sx #pragma bindhandle up1 vector "Up" vx invisible(1) #pragma bindhandle up2 vector "Up" vy invisible(1) #pragma bindhandle up3 vector "Up" vz invisible(1) #pragma bindselectorreserved vex_group points "Ripple Points" \ "Select the points for Ripple and press Enter to complete" \ all 0 "" 0 0 1 sop ripple(int usecenter = 0; vector t = {0, 0, 0}; float freq = 1; float height = 0.15; float decay = 0.75; float scale = 1; float speed = 3; int nripples = 3; int seed=0; vector up = {0, 1, 0}; ) { float xc, yc, phase; float dist, len; vector pos; vector origin; vector offset; int i; if (usecenter) { origin = set(scale*random0(seed), scale*random0(seed+1000), 0); offset = t - origin; } else { offset = { 0, 0, 0 }; } for (i = 0; i < nripples; i++) { xc = scale * random0(i+seed); yc = scale * random0(i+(seed+1000)); phase = M_PI * random(i - (seed+1000)); pos = set(xc, yc, 0); pos -= P; pos += offset; len = length(pos); dist = height * exp(-decay*len) * sin(len*(freq*M_PI*2) - Time*speed + phase); P += up * dist; } } I am thinking the high freq noise is coming from the phase and there seems to be a distinction between random0 and random xc and yc are being generated with random0 and phase with random. Also if you look at the code in houdini the random is colored blue (whatever that means.. I always wonder what all the colors mean but I guess that's for another post) This part of the code: xc = scale * random0(i+seed); yc = scale * random0(i+(seed+1000)); phase = M_PI * random(i - (seed+1000)); How do I translate this into VOPs is the big question for me. Thanks in advance!
  17. Per point distance VEX

    I am not able to get per point distance (parallel processing?), got the value from the last iteration in the loop for each point. // Mesure distance between pairs of point in each line // Return as a @distance attribute int allPoints[] = expandpointgroup(0, "!*"); f@distance; foreach (int currentPoint; allPoints){ vector pointPosition_L = point(0, 'P', currentPoint); vector pointPosition_R = point(1, 'P', currentPoint); @distance = distance(pointPosition_L, pointPosition_R); } circlesBetweenLines_002.hipnc
  18. Hello magicians! I'm doing a project where I have to loop textures on multiple goes. Basically a sprite randomization with textures, but I can not figure out a way how to loop the texture sequence like padzero does. I have to do it in VOP or vex, since the shader expects a specific filename as a map on the geo. Sadly, I can not upload a scene file, but hopefully my problem is understandable. Thanks for reading it. Cheers
  19. Vex Volume Procedural Grid Rez

    Hi! I've found many examples with volumes using this render approach, but there is somthing I'm missing out. How does this VEX Procedural Volume gets its divSize/resolution? I've seen the "octree" option but it's another thing (An optimization for getting less render time) So how does this volume define it's grid resolution? I'm just curious!! Thanks.
  20. Hi all, I have an arrays-in-loops puzzle. I thought of a shortcut to do a thing, it doesn't seem to work, and I should move on -- except I would like to understand why it doesn't work. Minimal background: I've got some point data, I've polywired it together using Connect Adjacent Pieces, and gotten a restlength on the primitives from that. I need to set a pscale on the points before moving on to my next step. Half the distance to the nearest neighbor is good enough for now. I could use nearpoints() to figure that out (and it seems to work!), but I thought, "hey, I already have restlengths; why not just look up the shortest restlength and use that?" That turns out not to work, or at least not as I think it should. Where have I gone wrong? After my connect step, each point ends up connected to 4-20 other points by primitives with restlengths between .9 and 3.9. My first stab at this was: use pointprims() to get an array of primitives associate with each point; create an empty float array to hold the restlengths; foreach loop over the primitives, read the restlength with primattrib(), and push the result onto the lengths array; sort() the lengths array into a new array; read out the shortest length and use that to calculate a pscale. Here's the actual code: int myprims[] = pointprims(0, @ptnum); float mylens[] = {}; foreach (int myndx; myprims) { float mytmp = primattrib(0, "restlength", myprims[myndx], 0); // f@checktmp = mytemp; push(mylens, mytmp); // f@checkrslt = mylens[myndx]; } float lensort[] = sort(mylens); float shortest = lensort[0]; f@pscale = shortest/2; I think it's failing at the push statement. If I write out mytmp as a point attribute just before I push it, I get a reasonable number (commented code). If I check the stored value right after the push, I get either zero or the restlength of prim zero. If I check after the foreach loop completes, I get restlength of prim zero. So the push doesn't work. Looks like example code in the docs, but I'm missing something. Any thoughts?
  21. As I can understand from the Houdini documentation, the "@opinputn_name" will access attributes from the secondary inputs. I am trying to access the "numpt" by "int numLastPoint = i@opinput1_numpt;" but this does not work. Im I missing something?
  22. I don't usually meddle with functions in VEX, but today decided to give it a go since I wanted to have some functions being used by other functions. I'm having issues calling functions inside functions. The code below for example will trigger errors. float foo(float a, b) { a = clamp(a, 0, 1) ; return a + b ; } float bar(float a, b) { return foo(a+.1, b+.1) ; } And it can be "solved" in multiple ways: If for example I comment out the clamp part it passes: If instead I remove the +.1 from foo it works as well. I have other examples where such simple corrections and the multiple corrections don't work or are not straightforward so what I'm after is understanding what's the main cause of this. Either I'm missing some method here ( I did try C++ style declaration / definition) or maybe there's some issue with calling a functions from a function. Cheers PRB_RFE_VEXFunctionCallBug.hiplc
  23. [SOLVED] VEX in Volume Wrangle

    Hi all, I'm trying to write some vex in a volume wrangle but I'm really struggling atm, not sure if the problem is the syntax or my inexperience with voxels. I have a volume which I set up with random densities and then, in the next step, the density of a voxel should be affected by the surrounding voxels. I've done the first step but can't figure out how to access the "closest neighbour voxels". I guess they have some sort of index but can't figure out which voxel has which index or if I should access them by their position. Tried to use the function volumeindex() to find index and volumesample() to take a sample from a position but both only returns 0 so I'm obviously doing something wrong. I wrote it like this: vector pos = {2, 2, 2}; float temp = volumeindex(0, "@A", pos); printf("%f\n", temp); @A += temp; It doesn't seem to matter what position I use for the vector pos, the functions always return 0 either way. So if someone knows anything about this it would be great volumeRandom.hipnc
  24. Can any VEX experts help with the following. Getting a "Read only expression on left side of assignment' error for the last line in the following VEX snippet vector axis = vector(rand(@ptnum)); float angle = radians(ch('amount')); matrix3 m = ident(); rotate(m, angle, axis); @orient = quaternion(m);
  25. Sampling positions from UV map using uvsample()

    I am trying to place a point on a uv-unwrapped mesh based on its UV coordinates interpolated position and normals using uvsample(). float uv_x = chf('uv_x'); float uv_y = chf('uv_y'); vector uv_pos = set(uv_x, uv_y, 0); @P = uvsample(1, "P", "uv", uv_pos); @N = uvsample(1, "N", "uv", uv_pos); While this kind of works, it unfortunately jumps from one row to another instead of smoothly running across the surface. Is this a bug or my fault? pos_from_uv.hipnc