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
    • Marketplace
  • 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 594 results

  1. Hi, I am trying to apply pop wind force to only non-isolated points in flip sim. Basically I don't want to apply this force to droplets. My VEX expression is like this but it doesn't seem to be working. Am I missing something or doing completely wrong? Thanks.
  2. Drop down menu in VEX

    Hello, Is there a ch function for drop down list in VEX. I am trying to create a switch case and I am not sure how I can get a drop down menu. Please help. Thanks. S
  3. Offsetting Animation in VEX

    Hey there Od Force community - I posted this on the Houdini forum as well, apologies for the double post, very curious about how to solve this! First post here, I have appreciated all the help I have gotten from this forum while learning Houdini. I am easing my way into VEX and am running into a wall with this seemingly simple task. I am using curves to create Sweeps, I then use a Carve to animate the sweeps based on frame range. My trouble is that I would like to have each Carve animate as follows: 1. Each Carve “Second V” pick a random frame between 1 - 40 to start 2. “Second V” Animate from 0 - 1 over a period of time (Random time length from 10 - 50 frames) 3. Have First V follow behind Resulting in randomly animated carves or sweeps. If there is a way to do this with CHOPS or any other technique I would love to find out. In the example attached I have set up a partial scene. Ideally, this method above would be applied to thousands of strokes with varying lengths! Any VEX help would killer - really trying to get through this learning curve! -Patrick sweep_vex2.hiplc
  4. Working with primintrinsics in VEX

    Hey all, I'm attempting to find the number of unique values across the intrinsic:typename attribute for incoming geometry, but I'm having no luck in getting the uniquevals() function to detect any intrinsics. Originally I assumed that this was just a limitation of the function, but I then realized that the docs explicitly state that you're able to provide the name of 'any attribute (or intrinsic) to read.' For context, let's say I've got a polygonal box and a NURBs curve, which both have unique values for their typename. If I try and access those values in a wrangle, I just get an empty array. I've tried setting the attribute class to 'primintrinsic' instead of 'prim', I've tried removing the 'intrinsic:' prefix from the attribute name, and any number of other gotchas that come to mind. I get the same results when trying to use nuniqueval() and uniqueval() as well. It isn't the end of the world since there are ways to do something similar in python, but if anyone's got some secret sauce to get these VEX functions in particular to play nicely with intrinsics, I'd appreciate the help. Thanks in advance.
  5. Coloring points from arrays

    Hey im relatively new to coding in vex but i am having issues writing out the points to an array then reading them to use them for pretty much anything, for example colors...here is the code in question: My question is how do i assign color to individual points from the array . for example if i wanted to assign (without using relpointbbox()) using the array readout to assign the color red to points above 500 and the color blue to below 500. int my_array[] = i[]@my_array; vector pos = set(0,0,0); //for point space and amt of X int nopointx = chi("point_amountX"); float ptspacex = chf("point_spaceX"); //for point space and amt of Y int nopointy = chi("point_amountY"); float ptspacey = chf("point_spaceY"); //for point space and amt of Z int nopointz = chi("point_amountZ"); float ptspacez = chf("point_spaceZ"); for (int z = 0; z < nopointz ; z++) { for (int y = 0; y < nopointy ; y++) { for (int x = 0; x < nopointx ; x++) { pos = set (ptspacex*x, ptspacey*y, ptspacez*z); int newpt = addpoint(0, pos); append(my_array, newpt); } } } for (int z = 0; z < 500 ; z++) { @Cd = set(1,0,0); } i[]@my_array = my_array;
  6. HOUDINI - VEX - OSL CONVERSION

    I’m looking for someone who can convert some OSL code to VEX code. I have a fractal formula written in OSL that needs to be volume density output VEX. For now the simple mandelbulb fractal conversion is enough but I'm looking for someone that could convert many other complex formulas.(200-300 lines of code). New to Houdini, and can't find a way to get this working...after days of looking around, this forum is my last option. OSL CODE TO CONVERT: shader OslGeometry( int Iterations = 10, float Power = 2.0, float Bailout = 20, output _sdf c = _SDFDEF) { vector pos = P; vector z = P; float dr = 1.0; float r = 0.0; for (int i = 0; i < Iterations ; i++) { r = length(z); if (r>Bailout) break; // convert to polar coordinates float theta = acos(z[2]/r); float phi = atan2(z[1],z[0]); dr = pow( r, Power-1.0)*Power*dr + 1.0; // scale and rotate the point float zr = pow( r,Power); theta = theta*Power; phi = phi*Power; // convert back to cartesian coordinates z = zr*vector(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta)); z+=pos; } c.dist = 0.5*log(r)*r/dr; } OSL CODE THAT WORKS BUT NEED IT TO BE LIKE THE OSL: function int Mandel(float x0, y0, z0; int Iterations){ float x, y, z, xnew, ynew, znew, n=ch('n'), r, theta, phi; int i; x = x0; y = y0; z = z0; for(i=0; i < Iterations; i++){ r = sqrt(x*x + y*y + z*z); theta = atan2(sqrt(x*x + y*y) , z); phi = atan2(y,x); xnew = pow(r, n) * sin(theta*n) * cos(phi*n) + x0; ynew = pow(r, n) * sin(theta*n) * sin(phi*n) + y0; znew = pow(r, n) * cos(theta*n) + z0; if(xnew*xnew + ynew*ynew + znew*znew > 8){ return(i); } x = xnew; y = ynew; z = znew; } return(Iterations); } //--- Main --- int maxiter = 8; if(Mandel(@P.x, @P.y, @P.z, maxiter) < maxiter){ @density = 0.0; } else { @density = 1.0; } AAND MY CONVERSION THAT DOES NOT WORK function int Fractal(int Iterations, float Power, float Bailout, vector pos, vector z, float dr, float r){ for (int i = 0; i < Iterations ; i++) { r = length(z); if (r>Bailout) break; // convert to polar coordinates float theta = acos(z.z/r); float phi = atan2(z.y,z.x); dr = pow( r, Power-1.0)*Power*dr + 1.0; // scale and rotate the point float zr = pow( r,Power); theta = theta*Power; phi = phi*Power; // convert back to cartesian coordinates z = zr*vector(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta)); z+=pos; } return 0.5*log(r)*r/dr; } int Iterations = 10; float Power = 2.0; float Bailout = 20; vector pos = @P; vector z = @P; float dr = 1.0; float r = 0.0; if(Fractal(Iterations,Power,Bailout,@P,@P,dr,r) < Iterations){ @density = 0.0; } else { @density = 1.0; } Thanks in advance. Cheers, Scappin Matteo www.machina-infinitum.com
  7. I have a popforce node which I would like to fade amplitude from a value to zero over time. The expression below eases in using age. amp *= smooth(0, 1.5, @age); How can I ease out?
  8. vex function

    Hello, How can I write the following functions in VEX? There are two box objects in different positions. How do I get a matrix that can move the first object to the second object?
  9. Hi everyone, Today I have a bit of a challenge that I think can be solved with some clever vex. One of my favorite modeling nodes for Houdini is 'circle from edges,' because you can pretty much select any curved geometry and get a perfect circle. As you may know from C4D creating circles on curved geometry is quite painful. Here is what the basic node does: Now what if instead we wanted a rectangle with rounded edges: Such as this one which I've modeled many times before, and it always requires taking two circles, expanding edges etc. It would be fantastic if the circle from edges could also support this shape and work just as well on curved geometry such as a sphere. I'm not sure where to start with this one, since I've only been working with vex for some short weeks now. However, any hints/tips or ideas are welcomed. Even a way to expose the code used in circle from edges would give me some ideas. My goal is to use VEX to build a bunch of tools that help model industrial models very quickly in Houdini - usually these sorts of details are very common in industrial modeling. Thank you.
  10. I've created a sphere primitive in vex, using: centre_pt = addpoint(0, pos); sphere_prim = addprim(0, 'sphere', centre_pt); I want to be able to vary its size in the viewport but can't work out how to do it. When a sphere prim is added using a SOP, the sphere's size can be changed using scale (the Uniform scale slider). I thought that this vex would therefore do the same thing: setprimattrib(0, 'scale', sphere_prim, chf('sphere_size'), 'set'); but changing chf('sphere_size') has no effect on the sphere's size. (I've also tried replacing 'scale' with 'radius', and also with 'radx', 'rady' and 'radz'.) I've found this link cgwiki which explains how to do it for a prim that has multiple points but a sphere prim only has its single central point. How can I change a sphere prim's size in vex?
  11. VEX: add point to prim

    Hello, lets say I have a prim with 3 points and I want to add an new point on that prim, by splitting one of the 3 edges. I assume that the prim will have to be deleted and drawn again but what I am wondering how to get the correct order with the new point so the prim will close properly.
  12. Hey, I have a bunch of moving curves that appear and disappear (meaning the prim id keeps changing), and I scatter points on them which I'm using a solver to kill at the right time but therefore they become static and I want to use an attributeInterpolate to track the point back to their curve. The problem is that the attributeInterpolate is asking for a sourceprim id but as I said above the the prim id keeps changing. I was able to create a unique integer attribute for the primitives which then is inherited by the scattered points. how can I now get the prim id from the curves to the scattered points based on a matching attribute? I tried an attribute wrangle but I'm really new to vex and this is what I wrote which doesn't really work haha. i@sourceprim = int idtoprim(1, id); first input is the points, second input is the curves. Thanks
  13. I have particles in my scene. I want to fade out my particles pscale based on controller geo and a falloff. But I want to add a bit randomness to it. In cinema 4d I would just grab a linear field and a random field. In Houdini, my plan was to use a grid with maskfromgeometry and attribtransfer that on the particles. However, this will just scale down all the particles that are in one axis the same way. I have no idea how to add randomness on the particles scale, (I want that some particles scale down faster, and some particles need longer to be scaled down)
  14. When you have complex ocean spectra layered together using masks with varying speeds, and even animated timescales, retiming them while keeping the same approved look becomes a technical challenge. In this lesson you will see how to achieve this as a procedural post-retime operation, without having to modify any ocean spectra individually.
  15. Assigning material to prim group

    Hi, I have the following geometry with prim group. I wish to assign a specific material to a specific prim group, I am using an Attribute Wrangler SOP to perform the VEX operation but can't work out the variable name I should be using to do the comparison printf('%s',s@path); printf('nicholas test\n'); // if(match('*sphere*', s@path)) s@shop_materialpath = '/mat/red'; Cheers
  16. Joy of Vex 7 coding issue

    i'm going through the "Joy of Vex" and i've run into an issue at day 7. this code (below) isn't giving me the results of this gif. /////////////// int pt = nearpoint(1,@P); vector pos = point(1,'P',pt); float d = distance(@P, pos); d *= ch('scale'); d += rand(pt); d -= @Time; @P.y = chramp('pulse',d)*ch('amp'); /////////// Joy_of_vex7issue.hipnc
  17. what is intrinsic in VEX?

    some function like below one: setprimintrinsic() carry the intrinsic with themselves, what are they, and how we can use them?
  18. I'm gonna use nearpoint with the position of add+transform. int point = nearpoint(0,v@opinput1_P,1); if(point == @ptnum) { @Cd = {1,0,0}; } but it doesn't work.
  19. iterate over certain points

    I have this code below: i[]@TP = neighbours(0,0); foreach(int i ; @TP) { @P.y = 1; } how can I tell Houdini to just move the points insideTP array? foreach move all the points.
  20. volume of an object affect on your effect

    hey guys , how can I calculate the volume of an object in VEX , I want to write something like this one below: the line of your script * volume of a specific object I used getbbox_size but the result is a scalar. I want everything in the object to have the effect. what should I do? best regards
  21. 1 Minute VEX

    Hello everyone! Every Monday at 12am for the last 3 weeks I have been uploading VEX snippets as mini-tutorials on my website: https://aaronsmith.tv/1-Minute-VEX Here, through '1 Minute VEX', I'll try to walk you through some of the more obscure and advanced functions that exist, and add as much explanation as possible to accompany the images in text based form. These are not for Houdini beginners! I also intend on all of my website's educational content being free - permanently. No donations, no subscriptions, no coupons. Below is 1 Minute VEX III as an example; Let me know if anyone has any suggestions for improvement! - 1 Minute VEX III - Ray-Cast Ambient Occlusion
  22. Just Have Fun Now Flower Effects and much more Its Crystal Case mystiqueTransform.rar
  23. Hi, Is there a way to do @disableexternal on each object individually ? I would like to disable it for one object but not the other. Thanks !
  24. [SOLVED] @P in Flip/POP Vexpression

    Hello everyone, I am currently working on something with FLIP Fluids and need to decrease the POP Windforce depending on the distance to a point. I assumed I could use the Vexpression inside the POP Wind but I can't seem to be able to access the particle Position. I have created a basic HIP file. Inside the AutoDOP Network, you will find the POP Wind in which I'm simply trying to export a test attribute that should be "@P". I've already tried a couple of things like Google, reading the float values separately ("@P.x"), or simply using it like I would use VEX in SOPS ("float length = length(@P);"). I am sure there is an easy way that I haven't found yet or a logical reason why I can't access "@P". Any help would be appreciated! Position_in_Vexpression.hiplc
  25. Javascript to Vex snippet

    Can delete this post
×