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


Forums

  • 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 274 results

  1. 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?
  2. 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?
  3. 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
  4. 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
  5. 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);
  6. 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
  7. Hi, I'm trying to increment a point attibute value over time in vex. A basic exemple would be to animate a group node to increment a counter each time it select points. Then, emitt particles if the points have been selected 3 times, or be able to know if a point has already been selected before. So I tryed to do a setpointattrib to a node that is not time dependent, but it doesn't seem to work. Is there a way to do it in vex ? Thanks, Charles
  8. Rotate object based on oriented bounding box

    I put a slightly oblique scanned object into an oriented bounding box and picked two points that are supposed to be straight. Now I am struggling to counter-rotate my mesh according to the bounding box´s orientation. vector scan_orient = normalize( point(0, "P", 0) - point(0, "P", 3) ); vector straight = {0, 0, 1}; matrix3 rot = dihedral(scan_orient, straight); rot = invert(rot); @P *= rot; What am I missing?
  9. ForEach VEX doubt!

    hey guys, I have various primitives and those have different amount of points on them, for example each one primitive might have 10 points and other might have 20 so it varies like this, Now i want to have an attributes which ranges from 0 to 1 for each primitive just like what we get from curveu attribute in resample node. I know how to do this in for each sop but i want to do this in vex, am somehow not able to get that loop working correctly. I store the array using primpoints to get the points on that primitive and iterate that through a for loop but i am not able to get normalised value ranging from 0 - 1. Can please someone help?
  10. This is probably not as hard as I think but I'm trying to find a way to draw a line down the center of an animated object using vex. I have a tube that is a cache and it is deforming. The points and polys don't change. I want to create a curve that goes directly down the center of the tube. I was successful by manually deleting some poly loops, and using a divide node with remove shared edges and then packing the shared faces then using an add to connect the center points, this is a quick and DIRTY way that worked. But I would like a more robust procedural way of doing this, if I had a lot of objects this way would be a pain. I have attached a .hip for if someone would like to help me out with this it would be much appreciated thanks in advance. Rob FindthecenterTest.hip
  11. Dear all, Sorry if my question looks naive, as you're all surely usual with this : matrix reading /printing. But i'd like to "printf" it element by element. Usually, generally a matrix looks like : matrix M[r][c] -> then your iter through. eg : print(M[1][1]+"\n"); But here in Hou it is : matrix M Yes printf() prints the thing but the whole thing. Then, how to read elements one by one separatly, please? i humbly dunno. Am usual with this practice in other languages because Matrices could be used as a fantastic "Chest" to store values, compiling vectors pack, and on and on... So any advices to this practical question are welcome. Thank you a lot. Bests,
  12. http://www.orbolt.com/asset/XiaoAn::non_circular_gear_no_teeth
  13. VEX nearpoint

    Hello OD ones, I am relatively new to vex and houdini but I am going with my guts on this. I want to get the nearpoint P2 on geo2(input1) for every point p1 on geo1(input0). I am doing this in a wrangle node, the wrangle node is in geo1 stream. I have a few restrictions 1) I am running the wrangle on primitives, so I am finding the nearpoint for all the points per primitive, the search is limited to a particular primitive on geo2 that shares a flag with the primitive on geo1. 2)since nearpoint doesn't allow me to make group in geo2(input1) [ or i could have just grouped the points on the specific primitve on geo2 on the run and use the actual 'nearpoint' function over that group]. So using nearpoint is out of question [or is it?] 3) So I wrote the code of how I think nearpoint would work [find distance from P1 to each point on the primitive on geo2, asign it to array and get the minimum value of array and find the ptnum of the point with the min distance value.] 4) but this is taking too long to run since I have hundreds of thousands of primitives to run on, I thought it will be fast but its not, using nearpoint is so much faster even when it runs on the whole geometry of geo2, but that will get me a point from a primitive that doesnt share the same flag which I set for each primitive on geo1. Any improvements to the algorithm or a function which i missed is much appreciated!!!
  14. Closest point to line

    Hi. I want to find closest point to line. Geometry has millions of points and the line is located somewhere in space. Need some fast solution. image
  15. Hey all, I'm super new to Houdini with a background in game development. I was going through tutorials on pluralsight and I'm loving it so far. So I've been expanding on the content and diving into Vex, and I hit a snag trying to run a Solver that changes generated point colours, because I wanted read from and modify persistent data on a separate point outside of the solver network. I simply created details on the point in an Attribute Wrangle in dataHolders and thought it would be easy to read and write to them from an attribute wrangler infectedPoints in the solver. The problem is the vex script in the attribute wrangler can't actually read the details ie: int pointsVaccinatedSoFar = detail("../../../dataHolders/dataHolderPoint","pointsVaccinated",0); int maxPointsToBeVaxxed = detail("../../../dataHolders/dataHolderPoint","maxPointsToBeInitiallyVaccinated",0); printf("points Vaxxed so far: %g\n",pointsVaccinatedSoFar); printf("points Vaxxed so far: %g\n",maxPointsToBeVaxxed); The font node pulls the details properly and prints them. But the printf always yields 0 when maxPointsToBeVaxxed should be 10. I'm guessing I'm breaking some kind of data context/scope protocol in Vex buuut I don't know enough about Houdini yet to really understand what's going on if that's the case. Or I guess I'm not using detail() properly, or both Any help would be appreciated! I'm using Houdini Indie so if you guys can read it I can upload the .hiplc file. Thanks!
  16. Is there a environment variable that will allow Houdini to open in manual when Houdini is fired up? That being said, is there an env variable that will also allow me to save incrementally? Thanks for your help Midi
  17. Hey guys ! I 'm searching a way to get an attribute that never decrease, in function of a noise. I want it to increase or stay at the max past value of the noise. This picture illustrates the value I want my attribute to have over time. I tried to calculate the last frame value and to clamp my actual value to the previous one or to take the highest value between the actual and the previous one. It works, it always takes the higher values between the two. But at the next frame, it doesn't prevent the two values from decreasing because of the noise value decreasing. So it doesn't work. I also tried to do an array with my firstframe and add the value of noise(@Time) to this array at every frame and then use the max() function of the array. But it adds the elements of all the frame range and gives them the value of current frame noise (that is logical). Do you know how I can create a list that adds the value of noise(@Time) at each frame ? Do you have any idea of how I could get an attribute never decreasing depending on a noise over time ? Thank you for your help ! (don't hesitate to ask if I am not clear)
  18. hi everybody, it's my first question here and i'm all out of noobish solutions. I'm trying to recreate this (see attached) using vex only, as an excercise. Now i managed to create the circles, and i want to select random points from where i can influence the radius of the neighbours. In order to do so I created an array of all the points, created an attribute that stores the ptnum of a random one and refreshes every 30 frames. The problem is now i want to store these values in a new array over time, but the append function only refreshes the current number. Is there a way to append a new value to an array every "x" frames? Hope I explained my situation clearly enough, and thanks to anyone who wastes a little bit of his/her time answering optical_with_circles.hipnc
  19. Float into vector (basic)

    I know this must be pretty basic, but for some reason, I can't figure out how to do this. I'd like to be able to alter one of the values of a vector using a float variable, like this: float dist = length(@P); v@force = {0, dist, 0}; To me, this seems like it should work, but always returns a syntax error. Any tips? Thanks!
  20. VEX on Copy To Points

    Why is the cube also rotating? VEX_rotateCopys_01.hipnc
  21. Hi everyone, I'm trying to follow an old tutorial in Vex, but i can't find Geometry Operator in Houdini 16.5 I hope you can help me.
  22. Find Adjacent Faces

    Hi, For a tool I've been working on, I need to have a way of finding adjacent faces between the inside of fractured pieces. I want to store this as a primitive attribute, that gives the number of the adjacent primitive. The way I have done it is by calculating the centroid of each primitive (using getbbox_center) and then iterating through the primitives in a for-each loop, finding the other primitive with the same centroid. (it turned out that the centroids were different by a tiny amount, so I introduced an accuracy value that you can set, and it finds the adjacent primitive within that distance). It then stores this as a primitive attribute. All seems to be working fine on simple fractures, but as soon as you sent the number of fractures higher than 22, it seems to bug out and all the adjacent faces are incorrect. I have visualized this in the HIP file by having a subnet that draws lines between adjacent faces. Attached is my HIP file. If anyone has any idea what could be causing this issue, I would be very grateful! I have also noticed that it seems to be a bit slow to calculate the adjacent faces, so if anyone knows a more efficient way of doing this, I'd also be pleased to hear it. Best, Stephen FindingAdjacentFace.hipnc
  23. what if more than one point satify the condition of nearpoint? i'm a little confused.
  24. Particles along surface

    Greetings to the best forum on the web I am struggling a little with wrapping my head around the xyzdist() and primuv() functions in vex. I have attached a scene file that holds a dopnet with some points created on frame 1. I would like those points to stick to the geometry coming into the second input on the dopnet. any suggestions to how this could be done is appreciated. I am in particular interested in the usage of the xyzdist() and primuv() solution, however other methods is also encouraged! should there be some people that wanted to "show off" a little vop magic that is cool too. looking to learn so hit me with everything you got. All in all a simple task but good fun. Thanks for playing Cheers particles_on surface.hiplc
×