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

  1. Hello houdini-community! I'm trying to create an outline filter using vex. You can find the code below, I copied it from the SideFX-Forum. I put the code in a vfl file and compiled it to a hda-file using vcc. Then, I imported the HDA into a simple project, got a Render compositing node and wired its output into my custom outline-node. As a result I just get a completely black image. I've looked into the components of the matrix3 that ninput returns and they are always just 0, although my render-output has almost no black pixels. Is there anyone who has an idea what I might be missing? Any help is highly appreciated! Edit: I fogot to mention that I tried to get the same result using a Convolve Compositing Node with the same kernel as used in the code. That works. However, this is just an experiment for me I really want to know how to implement such a filter using VEX. cop2 outlines(float effect = 1) { matrix3 kernel; matrix3 pixels; vector4 col; float result; int i, x, y; col = 0.0; // this builds a kernel with -1/8 in all elements but the center, which is // +1 (an edge detect kernel, sums to 0); for sharpen, use effect+1 // for the center pixel kernel = 0; for(x=0; x<3; x++) for(y=0; y<3; y++) setcomp(kernel, -effect/8, x,y); setcomp(kernel, effect, 1,1); // iterate over all components in the current plane (PL) for(i=0; i<4; i++) { pixels = ninput(0, PL, 0, i, IX, IY, FR); // sum the results of the kernel x pixels result = 0; for(x=0; x<3; x++) for(y=0; y<3; y++) result += getcomp(pixels,x,y) * getcomp(kernel,x,y); setcomp(col, result, i); } assign(Cr, Cg, Cb, C4, col); }
  2. Hi, So I came across a problem, I like to create a flight route for a plane, but I don't want the plane to crash into an object. I managed to create a curve (flight route) that can avoid a point, so the curve goes around the point...GREAT!!! (Check Screenshot 1) But if I want to avoid a large area, lets call it a "no-flight zone", the code has some sort of scaling limitation. (Check Screenshot 2) I've checked the code several times, but I can't find the solution, can somebody help me out? No_Flight_Zone.hip
  3. I created my vex function, ofcourse i can <include> it in wrangle. But can i compile and use it as intrinsic vex function? I tried to do this, but after all, function is still undefined. I compiled with this command: vcc.exe -c cvex --generate-intrinsic-lib myfunc.vfl After that i copied in houdini\vex\intrinsics directory What i did wrong? Or it's not possible?
  4. Hi) Can I somehow get the maximum(and the minimum) value of an attribute in VEX? I want to use them in a FIT function.
  5. Custom VEX function input type

    Hi there, I'm trying to wrap my head around custom vex functions, mainly from a theoretical point at this stage so not really addressing a specific use, just general knowledge. When I create a VEX function I believe that I have to specify exactly what type of data it is expecting from the arguments and exactly what type of data it will return. eg. function int my_function(float a){ return int(a); } in which case I have to feed it an INT argument and it will always return an INT value. My question is this, is there any way of creating a VEX function which can accept multiple arguments, but not fail if one or more of those arguments are absent when the function is called? Or better yet a way of taking a single argument with out specifying what type of data that argument should be? I'm guessing that this is somehow possible as most of the existing Houdini VEX functions work with multiple flavours of input. Thanks in advance. M
  6. Recently I started learning VEX, but now and then I hit a wall. In this case I can't find the answer on my own. What I'm trying so solve here, is to read the pscale from the closest point. //PSCALE @pscale = random(@P);; //NEARPOINT string me = itoa(@ptnum); i@near = nearpoint(0,'!'+me,@P); //READ PSCALE FROM NEARPOINT @npt_pscale = point(0, "pscale",@near); Getting an attribute with the point function works fine in most cases, like with the @P or @Cd, but with pscale it gives me a value of 0.0. Not sure I this is the best method, or maybe I'm overlooked something. I really can use some help. nearpoint_pscale.hip
  7. Array Function VEX

    Hi there, I'm playing around with creating some custom VEX functions and came across something a bit odd that I just can't seem to get working. If I want to create a custom function that returns an array, say a vector array I will need to declare the return type at the beginning, according to the docs the following should work // A function which returns an array of vectors vector[] rgb_array() { ... }; However if I run this in a wrangle I get a syntax error on line1. Is this a bug? Or am I declaring my function type incorrectly? Thanks in advance m
  8. Get, set, length of wire via VEX

    Trying to simulate a field of grass with wind. Using wires for each blade of grass. Problem is they elongate slightly when bending. How would you get, set the length of an individual wire via VEX?
  9. The Array Enigma 101

    So for the last view weeks I've been learning vex, great stuff. So now I want to turn my new awesome vex knowledge into practise. The goal of this operation is the measure the distance between each point to their closest neighbour. First, I use the pcfind function to grab the nearest point of each point number and put them in an array. Second, now I like to grab the values from the array and put them into a distance function. (BUT HOW?) I find array a bit of a vague concept. I get its a list of values, but I'm not really sure if the point numbers in the array also hold the position vector. Not sure if I'm doing this right, and probably there better way. If this method is right, pretty please help me out. kind regards, The new kid on the block measure_distance_nearpoint.hip
  10. Introduction to FX using Houdini - workshop

    Hey what's up guys, Only 1 week left to sign up for my fast-track Houdini workshop "Introduction to FX using Houdini". Limited student capacity! Over the course of 9 weeks and 33+ hours of tutorial content students learn how to do procedural modeling, particle-, RBD-, pyro-, FLIP- and whitewater simulations. On top of that we're going to talk about lighting, shading, rendering and we're going to dive deep into VEX scripting. I would love to answer any questions that you might have!!! Cheers, Manu Find the complete course syllabus here: https://www.cgmasteracademy.com/courses/16-intro-to-fx-using-houdini Also for more detailed information on the workshop, check out an interview that was done on 80.lv recently: https://80.lv/articles/making-first-steps-in-vfx-with-procedural-tools/ Here's a quick teaser:
  11. Move curve point with Vex

    Hello everybody, before anything I'm going to introduce myself. I am a Belgian Technical Artist working in the game/interactive software industry from some years now. I was more a environment artist after my studies, but moved to development with Unity, Unreal and native C#/C++ software development. I began to learn Houdini one year ago and having a developer background, it was more easy for me to understand how Vex is working. I now try to use Houdini at work to improve our production pipeline with Unity and Unreal. Mostly using Vex. And it is a wonderful tool. I am currently working on a river tool with heightfield and curves. I first put the curve on top of the terrain then resample the curve and project each point on the terrain with the intersect function. (I also remove points that are outside the terrain) @P.y = getbbox_max(1).y + 100; vector p, uvw; int isIntersecting = intersect(1, @P, {0,-10000,0}, p, uvw); if(isIntersecting == -1) removepoint(0, @ptnum); else { @N = @N; @P.y = p.y; } The problem is that a river always flow from top to bottom, but the projected curve on the terrain sometimes go up and down. To fix that I loop through each points and check if the current point height (@P.y) is higher that the previous point height. But it is not working as expected. First try with Point Wrangle Run Over Points if(@ptnum > 0) { vector lastPointPosition = point(0,"P", @ptnum-1); if(@P.y > lastPointPosition.y) @P.y = lastPointPosition.y; } Second try with Point Wrangle Run Over Detail(only once) int ptNumber = npoints(0); for(int pt=1;pt<ptNumber;pt++) { vector currentPoint = point(0, "P", pt); vector lastPoint = point(0, "P", pt-1); float currentHeight = currentPoint.y; //printf("%s %s\n", pt, pt-1); if(currentHeight > lastPoint.y) { vector newPos = set(currentPoint.x, lastPoint.y, currentPoint.z); setpointattrib(0, "P", pt, newPos, "set"); } } What am I doing wrong ?
  12. Hey guys, Somewhat of a newbie to Houdini here - please excuse this (hopefully) simple question... I'm trying to process a number of FBX models to establish a kind of "connectivity tree" for future animation operations. Essentially I want to divide my models into numbered visual chunks then tag them to associate them with a "parent chunk". This parent chunk would be the neighboring chunk they are primarily attached/grounded to. I plan to use this order to reveal the chunks one-by-one - so I never have a floating chunk (chunk #0 will be on the ground plane). I've got some way into this but am struggling with tying up the final stages. In the attached HIP example I divide the model into chunks with Connectivity SOP. Then I loop through the chunk pieces - for each one I make a padded bounding box and use it to group neighbor 'child' chunks that intersect its surface (feels a little hacky but seems to work). Next I'm trying to add a prim attribute to these grouped prims - basically the numerical ID of the 'parent' chunk I'm using to group them. When I run a single loop pass, things look somewhat OK but it falls apart on successive loops. I think the issue is perhaps how I'm accessing the parent chunk ID in the loop - or maybe my attrs are getting overwritten in subsequent loops? Any ideas much appreciated - if you have a better idea on general approach I'd love to hear it (I'm probably going about it all wrong) Thanks! stackTest_help.hip
  13. VEX Point Manipulation

    Hi everyone, I had put together this tutorial based on a n old experiment I had done. People kept asking about the build, but I had since lost the original project. Recently I had found an old backup, so decided to explain how I did things. You can view the article and video tutorial on ProVideoCoalition here: https://www.provideocoalition.com/houdini-vex-point-manipulation/ When I had originally made the project over a year ago, I was following along with Entagma's VEX geometry tutorial. I then ventured out on my own and starting modifying, adding my own stuff, and transforming it. Ended up creating a maze'esque grid pattern, a vertical stripe system with custom UI controls, and a nebula'esque looking design. Each build using the same geometry source object. It was a good learning exercise.
  14. Hi there, Lets say we have a bunch of packed primitives scattered in an area on the left side and a on the right side a geometry, like frustum. I want to detect all the packed primitives that even a small portion of their bounding box is intersecting with the geometry. I have one method of doing this but its not ideal, I was wondering if anyone knows an efficient and preferably with vex way to do this. Cheers, C
  15. Zahia Hadid Architechture

    Hi guys First post Ive been following a few tuts from entagma and would love any input on creating something closer to this. My Houdini experience has mainly been lighting for film but i want to branch out into more of the fun stuff. Any ideas? Damien
  16. POP Wrangle Group

    Hello, I want a second age ("myage") for particles, when they are in the group "active". Very simple? But it don't work
  17. One thing that I miss from Python(Try / Except) or XSI ICE (First Valid) is the ability to check if some code returns errors and if so, do something else that is safer. Is there a way to access the validity of something and if not do something else? Cheers
  18. Hello to all! I am currently writing a wrangle-thing in which I'm hoping to generate a random "hair" on every point and make it face the normal of said point. The way I planned it is as follows: 1. create the hair w/ random params on 0,0,0 2. rotate the hair to Normal of the point that it's "generated on" w/ rotate(matrix,angle,vertex) function 3. Move the hair to @P I'm not a hero with vector math, otherwise I'd generate the whole hair thing along a normal. I wonder if I somehow can construct a identity matrix, like one would do with the ident() function, and use that to transform the prim. Is there a way to simply rotate a primitive using something simpler than extreme vector math? sgamhar.hip
  19. Hi there. I’m having some trouble translating two parameter expressions in this tutorial using Houdini 14 to Houdini 16.5: https://player.vimeo.com/video/130386299 The first expression is for the Value parameter in a attribute create node (given the name “WIDTH”). It is meant to tapper the octopus tentacle geometry. The attribute was created as a Ramp Float (given the name “cross”), in a null node named “Cross_RAMP.” The expression looks like this: chramp(“../Cross_RAMP/cross”,$PT/$NPT,0) The second expression is meant to help centralize control for the Scale parameter in a sweep node. The expression look like this: point(“../WIDTH”,$PT,”width”,0) So the null where the ramp was created is being tapped in the attribute create node, which is being tapped by the sweep node. But it is not working. The errors I get for these offer some leads, but I’m too new to code expressions to sort it out on my own. Wading through the online documentation and trial and error has not yet proven fruitful. I could use some help. Would someone tell me the proper expression to write, either with a VEX snippet, or other such replacement code? Thanks in advance for time and efforts.
  20. I have 2 sets of points: 'parent' and 'child'. Both have the same number of points. I need each parent point to have a unique child assigned to it - no duplicates. I need to be able to animate in an active value for the parent points, so that they all become active in 3-4 frames. When a parent point becomes 'active', it needs to search for its nearest available animated point and set that animated point's id number as 'child_id'. An animated point is only 'available' if it doesn't already have a parent point, or in other words: if the child_id is currently unused. My issue comes from the VOP I've set up within a SOP solver. If there is more than one parent point becoming active on a single frame, I get multiple parent points assigned with the same child point. I need to be able to write to 'child_id' and read from it on the same frame, to make sure that I am not getting multiple parent points with the same child points (leaving some very lonely, parent-less child points ). Please take a look at my attached file. I've highlighted the important nodes, and the Find Attribute Value VOP in red is where the issue is originating. find_unique_child.hip
  21. I am trying to make a setup where I align an object orthographically and then after I do my operations move the result back to the original position. I have a working way for aligning but am sure there must be an easier way... My method for aligning now: - Create oriented bbox - Measure prims - delete all but largest, then delete 1 of the largest in order to just have 1 rectangle, 4 points - make a vector from point 0 to 1 to align with x - make a vector from 0 to 2 to align with y - make normals to align with z - in vops use the align vop to align the 0 1 vector to x then use the (rotated) normals to align with z Even though this works I assume (hope) there is a better way to find the vectors, using pointnumbers is not procedural enough imho so any tips here would be great. But then the part I can't seem to get... How do I rotate my result back to the original position? there must be a way to store the rotations and invert these or something but everything i tried didin't work. my vectormath and matrices could def use some work. ofcourse i can use a point deform but that would not be accurate enough plus i am 00% sure there must be a way to invert what i did in the first vop. Thanks!
  22. I add and subtract the same exponentiated coordinate and up to 6 is fine, but 7 and above it squashes with cube. code vector pos = set(pow(10,7),0,0) ; vector P = @P ; P -= pos ; P += pos ; @P = P ; Wondering if clamping is the only way to go... How do you deal with this sort of issue? Cheers
  23. 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
  24. 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
  25. 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