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

  1. 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
  2. point cloud radius

    int handle = pcopen(0,"P",@P,@pscale,ch("maxpoints")); why no effect?
  3. Hello, I want to ask one quick question. What primhedge function does, according to help file it is returning the number of an arbitrary half-edge that contained in prim. If anyone know about this function and know what is the use of this function please expain me. Thanks
  4. A lot of old tutorials use the old point SOP for a color ramp, purely to assign a number between 0 and 1 for some future purpose. For instance for a line oriented along the y axis, the old point SOP has the color channels deleted and then puts an "add color" of ($BBY,0,0). Sometimes normals are deleted as well. Commonly the next node added is an attribute VOP with a ramp parameter to reassign this 0-1 range on the red channel to some spline ramp value. I am trying to not use the old point SOP for new models. I see there are two different nodes, and I am not sure which to substitute: the "point wrangle" with yellow cowboy hat (attribute wrangle) and the new "point" with red cowboy hat (attribute expression). Which is better to use? With the point wrangle, I can put in VEX code like "@Cd = set(.5, 1, 0);" to assign a constant color, but what would be the equivalent of $BBY? What is the VEX equivalent of the old point SOP "no normal" to delete normals? Thanks.
  5. Im trying to deform a curve with vex. I want to deform it with a sin function. Kinda rookie on vex but i thought this would work. I create a curve with just a start and end point. Resample it to say 50 points. Add a attributeWrangle and add this vex code: @P.y = sin(@P.y * 500) * 0.1; I get no errors in the code but i dont get any result at all either. Anyone got any clue? I tested alot of different numbers just to make sure it wasnt the size of the sin curve but i get nothing.
  6. Hi all ! I'm struggling with an addpoint function, I'd like to use a variable to declare a point but it seems that's not allowed… What is the proper way to do this ? My code in a pointwrangle : float height = fit(rand(@seed, @ptnum), 0, 1, 0.4, 0.55); addpoint(0, {0,height,0}); if I put a 1 instead of "height" it creates the point perfectly well :/ Thank you for your help !
  7. I added a custom operator interface to a Point Wrangle node to get a point position (from an add node). In the screenshot below I'm referring to the 'Target' string input in the UI / parameter name 'opPath'); Using the standard chs() function I can get the value of the node dropped into Target/opPath. Using the op: operator I was assuming this data would be live (eg. if I move the point geometry referenced in Target/opPath I was expecting the coordinates returned to the point() function to change accordingly) ... but it doesnt happen (stays whatever value is set at frame 0). The solution (screenshot) is to hard code the path to the target object using the op:operator (position coordinates get update if the geometry changes). If I uncomment the first line (and comment the second) then the coordinates no longer get updated. It's annoying as I'd rather not hardcode the path to the object in VEX and rather use the chs() UI interface. Any idea? (also some clarity on how the op: operator works and when is it needed versus just referencing paths without it would be appreciate as couldnt find much on the subject) THANKS!
  8. reset to origin.

    Hello Odforce! I often find myself in a situation wanting to take each piece of geo I have from an alembic, move it to the origin and "reset" rotation for convinience, do some operations, and then move it back to its original place with its original rotation on it. However I often find my knowledge short to do this stuff. I have crafted an example file here of my problem and hopefully some of you can help me with a few examples on how to do this. As described in the file, this is what I want to do: - move each piece of geo to the origin. - calculate the rotation thats on the piece of geo, and "reset" it so that the point with @Cd = {1,0,0} is upwards. - put the geometry back to its original position with its original rotation. I hope you guys can help fill the gap I have when it comes to this kind of stuff. Cheers calculate_transform.hiplc
  9. Hey guys, new here, nice to meet y'all! I'm new to Houdini and have been dabbling with VEX recently. It's a love hate thing. Being interested in social insects I got the idea to build a little "ant robot" that could follow a trail. It has a body (point) and three points that serve as sensors. These sensors sample the ground's trail attribute (red, works), compare their values, find the "winner" (works) and then the whole thing should rotate accordingly and move along a vector that goes from the body to the best sensor point to stay on track. (Works not so well). That's the status and at least it's doing some following the path, but I can't get the robot thing to rotate around a custom position. Instead, the matrix rotation always uses the world origin as a pivot which looks increasingly bad with distance and at a certain stage just breaks. Also, the body promptly severs itself from the rest, which is a tad unfortunate, as I wanted it to follow the sensors (stay attached) and serve as a the pivot for the rotate(). I know this is a little messy but maybe one of you would like to have a look at the hip and point me to the obvious mistakes I made. Much appreciated! Cheers, Felix Robot_movement_issue.hiplc
  10. Hi Odforce. I have POPs moving past a point and I want the stream to inherit and keep the points normal after passing. I thought this would be a straight forward pcopen() case, but I cant get it to keep the normal. It's only there for as long as it is within the search radius. I've tried a few different things in vex. wrapping it in an If statement instead of while, but to no avail. Edit: I should maybe mention that I'm in SOP right after importing from a DOP. Tried to make it work in POP wrangle but had no luck there either. Thanks, Bastian
  11. Hey Guys I wanted to share with you a small script I've done to have a better support or external editors to edit your expressions and code. It works with a system or file watcher, that means it doesn't freeze Houdini and you don't need to close your editor to see you updates It's available by a simple right-click on a parameter => expression => External Expression Editor ( you can set a hotkey ). It works with VEX and Python expressions but also regular HScript expressions ( but with no completion ). It works very well with Visual Studio Code as it has a nice VEX and Python plugins, but it could work with sublime text, notepad ++ etc. ( I haven't tested all the IDE out there so if you find a bug with one of them, feel free to send an email to contact@cgtoolbox.com ). A small video about it: https://vimeo.com/242470411 You can download it for free here: http://cgtoolbox.com/houdini-expression-editor/ PySide, PySide2 and PyQt are supported, it is compatible with Houdini 15 to 16.5.
  12. Hi @ll, Firstly, enchanted to meet you all. I was testing the VEX function “opfullpath” in a simple way : // Getting the intrinsinc detail “numprim” via the function “detailintrinsinc”. Houdini Version : Nodes : one polygon Mesh(@opinput0) + attrWrangler. Detail intrinsinc signature is : detailintrinsic(string geometry, string intrinsic) Thus #1 : string geometry must be the path to Geometry Thus #2 : the command “in theory” could be : int primCount = detailintrinsinc( “op:`opfullpath(“../myInputedGeo”)`”,”primitivecount”); printf(“prim count : %g \n”, primCount); // to display. Saddly it doesn’t work… But : op:`opfullpath(“../myInputedGeo”)` is NOT a string it generes a string Thus #3 : command could be : string fullpath = `opfullpath(“../myInputedGeo”)`; int primCount = detailintrinsinc( fullpath,”primitivecount”); printf(“prim count : %g \n”, primCount); // to display. Saddly it doesn’t work… So it’s really hard to me to spot the worry…..because if you use the “lazzy” signature : detailintrinsinc(int opinput, string intrinsinc); It works but it has really really less power than using a path as the code will just look a the input0 of the wrangler’s entry rather than all over the scene to get its info. Probably a syntax error from me ? So if any body could help, you will be welcome please !!!. Bests, alr + + + pathtogeo-v004.hipnc
  13. Arnesen Cubes in Houdini

    Christian Arnesen did an awesome piece of animation with MASH, and I wanted to replicate it in Houdini: Here is the breakdown of 3 techniques for doing so, using Alembic caches, Copy Stamping, and VEX (file is attached below or at the link): Hope it's helpful! arnesen_cubes_in_houdini.zip
  14. Creating a force array in vex

    Hi all, I am struggling to write a force array per particle, i have an float array per particle named "upforce" and i want to use this array as my "y" force. Any tips? Thanks
  15. I'm trying to delete points bases on the camera's origin. I have a vex script that was calculating the visibility: vector camera_dir = point(1,"P",1) - point(1,"P",0); f@vis = dot(@N,camera_dir); the problem is that it's based off of having two points from a ray sop. Can I just do it based off the camera origin itself? Any help would be amazing! Thanks, camOrigin01_v001.hip
  16. Hello, I have decided to study more Houdini. As i want to expand my knowledge regarding Houdini and not limit myself only with shelf tools. VEX expressions what tutorials or educational materials would you recomend and in what order? Note (need only up to date tutorials as out of date tutorials where they use nodes that are obsolite etc will not help but only create more confusion). Also what tutorials to go over regarding wrangle nodes. Best regards Tanel
  17. Converting VEX to OpenCL

    Hi My understanding is that VEX runs entirely on the CPU. But with the right hardware (ie latest Pascal based GPU) the same functionality in OpenCl could be magnitudes faster. Is anyone aware of any OTL or other project which have converted VEX code to OpenCL?
  18. Symmetrical Topology Mapping

    Hello, I have some models with a perfect symmetrical topology, all made of quads, but having a non-symmetrical pose. I wanted however to "symmetrize" them as much as I could to be able to resculpt them later using symmetry under ZBrush. I have worked on a very weak algorithm (very long, can be optimized to reduce the number of tests along the tree), who is nevetheless working to assign to each point its "topological" symmetrical twin. I wanted to share the code for people who might want to use it, and see what can come off from good coders :-) There are several functions and the last one is the main one, and takes two points as input (an edge who is on the middle of the model, on its topological symmetrical plane). Here is the code, to be used in a point wrangle set on DETAILS : // Function returning 1 if a point is in the list or 0 otherwise function int isInArray(int pointnum; int listPoints[]) { int isinit = 0; foreach (int i; listPoints) { if (i == pointnum) { isinit = 1; } } return isinit; } // Function returning an array with two numbers of the prims that share an edge defined by two points Origin and Destination function int[] findPrimFromEdge(int ptOrigin, ptDest) { int primsPtOrigin[] = pointprims(geoself(),ptOrigin); int primsPtDest[] = pointprims(geoself(),ptDest); int primsSiams[]; int count = 0; foreach (int iterPrimOrigin; primsPtOrigin) { foreach (int iterPrimDest;primsPtDest) { if (iterPrimDest == iterPrimOrigin) { append(primsSiams, iterPrimDest); count++; } if (count==2) { break; } } if (count==2) { break; } } return primsSiams; } // Function returning an array with two point numbers that represent the opposed edge to the one sent as input, with the first point returned being connected to the Origin point of the edge sent as input function int[] findOpposedEdge(int numprim, ptOrigin, ptDest) { int opposedEdge[]; int tempOpposedEdge[]; int pointListPrim[] = primpoints(geoself(),numprim); foreach (int iterPointPrim; pointListPrim) { if ((iterPointPrim != ptOrigin) && (iterPointPrim != ptDest)) { append(tempOpposedEdge, iterPointPrim); } } if (pointedge(geoself(),tempOpposedEdge[0],ptOrigin) != -1) { append(opposedEdge, tempOpposedEdge[0]); append(opposedEdge, tempOpposedEdge[1]); } else { append(opposedEdge, tempOpposedEdge[1]); append(opposedEdge, tempOpposedEdge[0]); } return opposedEdge; } // Function returning the number of the prim adjacent to the prim sent as input and sharing an edge defined by its two points, and return -1 if empty in case of open surface function int findAdjacentPrim(int numprim, ptOrigin, ptDest; int visitedPoints[]) { int adjprim = -1; int resultTest; int adjacentPrims[] = findPrimFromEdge(ptOrigin, ptDest); foreach (int iterprim; adjacentPrims) { if (iterprim != numprim) { adjprim = iterprim; } } return adjprim; } // Function that add the number of adjacent unvisited primitives to a list, and the id of the points of the shared edges with that prim to another list, from an input composed by a prim and an edge function int addList(int primnumR, primnumL, ptOriginR, ptDestR, ptOriginL, ptDestL; int listOfPrimsR[], listOfPrimsL[], listOfPointsR[], listOfPointsL[], visPoints[], visPrims[]; int compteur; int compteurlist[]) { int oppEdgeR[] = findOpposedEdge(primnumR, ptOriginR, ptDestR); int oppEdgeL[] = findOpposedEdge(primnumL, ptOriginL, ptDestL); int ajout = 0; append(visPrims, primnumR); append(visPrims, primnumL); int adjPrimsR[]; int adjPrimsL[]; append(adjPrimsR, findAdjacentPrim(primnumR, oppEdgeR[0], oppEdgeR[1], visPoints)); append(adjPrimsR, findAdjacentPrim(primnumR, ptOriginR, oppEdgeR[0], visPoints)); append(adjPrimsR, findAdjacentPrim(primnumR, ptDestR, oppEdgeR[1], visPoints)); append(adjPrimsL, findAdjacentPrim(primnumL, oppEdgeL[0], oppEdgeL[1], visPoints)); append(adjPrimsL, findAdjacentPrim(primnumL, ptOriginL, oppEdgeL[0], visPoints)); append(adjPrimsL, findAdjacentPrim(primnumL, ptDestL, oppEdgeL[1], visPoints)); if ((adjPrimsR[0] != -1) && (adjPrimsR[0] != primnumL)) { if (isInArray(adjPrimsR[0], visPrims) == 0) { append(listOfPrimsR, adjPrimsR[0]); append(listOfPrimsL, adjPrimsL[0]); append(listOfPointsR, oppEdgeR[0]); append(listOfPointsR, oppEdgeR[1]); append(listOfPointsL, oppEdgeL[0]); append(listOfPointsL, oppEdgeL[1]); append(visPoints, oppEdgeR[0]); append(visPoints, oppEdgeR[1]); append(visPoints, oppEdgeL[0]); append(visPoints, oppEdgeL[1]); append(compteurlist, compteur); ajout++; } } if ((adjPrimsR[1] != -1) && (adjPrimsR[1] != primnumL)) { if (isInArray(adjPrimsR[1], visPrims) == 0) { append(listOfPrimsR, adjPrimsR[1]); append(listOfPrimsL, adjPrimsL[1]); append(listOfPointsR, ptOriginR); append(listOfPointsR, oppEdgeR[0]); append(listOfPointsL, ptOriginL); append(listOfPointsL, oppEdgeL[0]); append(visPoints, ptOriginR); append(visPoints, oppEdgeR[0]); append(visPoints, ptOriginL); append(visPoints, oppEdgeL[0]); append(compteurlist, compteur); ajout++; } } if ((adjPrimsR[2]!= -1) && (adjPrimsR[2] != primnumL)) { if (isInArray(adjPrimsR[2], visPrims) == 0) { append(listOfPrimsR, adjPrimsR[2]); append(listOfPrimsL, adjPrimsL[2]); append(listOfPointsR, ptDestR); append(listOfPointsR, oppEdgeR[1]); append(listOfPointsL, ptDestL); append(listOfPointsL, oppEdgeL[1]); append(visPoints, ptOriginR); append(visPoints, oppEdgeR[0]); append(visPoints, ptOriginL); append(visPoints, oppEdgeL[0]); append(compteurlist, compteur); ajout++; } } return ajout; } // MAIN ALGORITHM FUNCTION function void findTopology(int ptOriginMedian, ptDestMedian) { int listPtR[]; int listPtL[]; int listPrimR[]; int listPrimL[]; int visitedPoints[]; int visitedPrims[]; int primsStart[]; int safeguard; int resulthandle; int countPrim; int counttreat = 0; int countlist[]; int currentPtOrigR; int currentPtDestR; int currentPtOrigL; int currentPtDestL; int currentPrimR; int currentPrimL; int actif = 1; primsStart = findPrimFromEdge(ptOriginMedian,ptDestMedian); append(listPrimR, primsStart[0]); append(listPrimL, primsStart[1]); append(listPtR, ptOriginMedian); append(visitedPoints, ptOriginMedian); append(listPtL, ptOriginMedian); append(listPtR, ptDestMedian); append(visitedPoints, ptDestMedian); append(listPtL, ptDestMedian); safeguard = 0; while ((actif != 0) && safeguard < 200) { countPrim = len(listPrimR); actif = 0; for (int i=0; i < countPrim; i++) { if (isInArray(listPrimR,visitedPrims) == 0) { currentPrimR = listPrimR; currentPrimL = listPrimL; currentPtOrigR = listPtR[2*i]; currentPtDestR = listPtR[2*i + 1]; currentPtOrigL = listPtL[2*i]; currentPtDestL = listPtL[2*i + 1]; counttreat++; actif += addList(currentPrimR, currentPrimL, currentPtOrigR, currentPtDestR, currentPtOrigL, currentPtDestL, listPrimR, listPrimL, listPtR, listPtL, visitedPoints, visitedPrims, counttreat, countlist); } } // Safeguard to avoid endless loops safeguard++; printf("Loop: %d\n",safeguard); } printf("ListPrimR : %d et ListPrimL : %d\n", len(listPrimR), len(listPrimL)); printf("ListPointR : %d et ListPointL : %d\n", len(listPtR), len(listPtL)); printf("Countlist : %d\n", len(countlist)); for (int index = 0; index<len(listPtR); index++) { resulthandle = setpointattrib(geoself(),"symnum",listPtR[index],listPtL[index]); resulthandle = setpointattrib(geoself(),"symnum",listPtL[index],listPtR[index]); resulthandle = setpointattrib(geoself(),"traitement",listPtR[index],countlist[index]); resulthandle = setpointattrib(geoself(),"traitement",listPtL[index],countlist[index]); resulthandle = setpointattrib(geoself(),"Cd", listPtL[index], {1,0,0}); resulthandle = setpointattrib(geoself(),"Cd",listPtR[index],{0,1,0}); } } // LAUNCH !! findTopology(8659, 2265); And then the code to put on a point wrangle set to run on POINTS : vector symP = point(geoself(),"P", i@symnum); vector moyP; if (@symnum == @ptnum) { @Cd = {0,0,1}; @P.x = 0; @group_center = 1; } else { moyP.x = (@P.x - symP.x)/2; moyP.y = (@P.y + symP.y)/2; moyP.z = (@P.z + symP.z)/2; @P = moyP; } Hope this can be useful for people out there.
  19. I'm trying to drive a BlendShapes' SOP blend parameter using a point attribute, @fade. The @fade is a point attribute and have it's value animated. But the blend parameter doesn't appear to read this animated values and keep showing 0 instead. The question: the blend parameter doesn't work with point attributes? I tried VEX and Hscript forms (@fade and $FADE). The second crashes.
  20. 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
  21. 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
  22. 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.
  23. 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!
  24. 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
  25. 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
×