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

  1. Pointers and struct children in vex

    Hi there, I am trying to define the shape of lightning using vex in a wrangle sop A lightning path has forks that split from any given path, creating other paths with almost identical properties to the main path. To that end I created a path struct but I can't figure out how to get it to store its 'forks'. The same issue would arise if I instead stored the parents instead of the children. I am defining a path of lightning as so: struct lPath { lPoint source; lPoint sink; float energy; lPath forks[]; void setSource(lPoint newSource) { source=newSource; } void setSink(lPoint newSink) { sink=newSink; } void setEnergy(float newEnergy) { energy=newEnergy; } void create() { addprim(0,"polyline",source.num,sink.num); } } my issue is that I can't include a reference to itself due to infinite recursion, which is why in c++ I would use a reference lPath * forks[]; Is there any way to solve this using vex? Kind Regards George
  2. Sierpiński triangle with VEX

    Hi guys. How you would go about creating Sierpiński triangle with VEX? I've tried to do it myself, but failed. I've only started learning VEX, before i was only doing basic stuff with it.
  3. Hey! Does anyone know how I might be able to access the GDP of the wrangle from which my VEX command is running? I'm trying to make a VEX command kinda like nearpoint(int geomInput, vector2 P), which takes in an input index and can access the GDP of that input. I see GU_VexGeoInputs(), and VEX_GeoCommand, and a few others ... they're all i think close to the answer, but I haven't been able to crack this one yet. Anyone has any pointers to share? Thanks, Dhruva
  4. Handling array in Vex

    Hi, In Python, we can create a "quick array" with conditions in a single line: a1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] a2 = [0, 2, 4, 6, 8] a3 = [i for i in a1 if i not in a2] >>>> a3 == [1, 3, 5, 7, 9] In vex, I know how to do it the long way: int a1[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; int a2[] = [0, 2, 4, 6, 8]; int a3; foreach( int i; a1 ){ if( find(a2, i) >= 0 ){ append(a3, i); } } >>>> a3 == [1, 3, 5, 7, 9] Is there a faster way to do this kind of things, maybe like in Python? Thanks!
  5. SlimeFX

  6. Hi guys, Im a little stumped on a vex issue im having whilst trying to utilize the nearpoints function when building an array. The idea is that i have multiple curves, each with different colour values, which i group the end points of and then run a function which gathers all the nearest points to each of these endpoints and assigns them to an array. (this is currently working as can be seen in my spreadsheet.) However, i then wish to take this array that has been created for each of the endpoints and run an if statement through it that says if the points in the array have a different colour value to the end point they belong to then add them to a group. Im then hoping to perform a nearpoint function using this group as a filter to get the nearest point that belongs to any curve other than itself. Im unfortunately having an issue with this if statement as it seems to only output points 0-9 regardless of the previous rules set in the code. Help is really appreciated as im truly stumped on this one. Thanks in advance guys! Nearest_Points_Array_Problem.hip
  7. Hello! Recently I need to clip each polygon in different direction, because the compile + foreach is a bit slow, and it will be more slower in a repeat loop block, so I tried to use VEX to clip polygons. And fortunately I found a VEX code to clip polygon : Clip in VEX But it can only clip the convex polygons, but not work on the concave polygons. See the follow image: I have no ability to solve it, could someone help me? Thanks.
  8. Genetic Algorithms in Houdini

    I am not sure if this is the appropriate forum. I recently wondered how hard it would be to implement genetic algorithms in SOPs. The particular example I was curious about was if I could turn a box into a sphere by optimizing for a target function that maintains volume but minimizes surface area. Overall, this was easier than I thought and did not involve all that much code. I ended up recording a video that explains this: The underlying motivation was to get this working in PDG but I figured I had to start with SOPs first. Let me know what you think.
  9. contrail deformation by spline

    Hey guys, I'm trying to deform a volume "contrail" by a spline with direct projection without the use of converting to points and back. I've tested this method on points and it seems to work, but am unable to get it working on volumes without major stepping. It relatively follows my curve, but I can't seem to figure out where the stepping is coming from - it works perfectly with points and conserves it's thickness, so I'm pretty stumped. I attached the project file and few screen grabs. Let me know if anyone has any ideas volumedeform_v03.hipnc
  10. Add prims VEX

    i'm trying to connect each point with the next one and then the centroid what am i doing wrong? seems simple enough (maybe there is a node for that) ideally i want to make also edge loops after like concetric circles connect_to_center.hip
  11. in a primitive wrangle i have a bunch of line segments as input and i want to use the xyzdist function to find the nearest point on the closest geo. So starting with one line segment each time i want to test against all of the rest segments, so not including its self. The problem is xyzdist(0,@P) means 0 and @P could be the same line. how can i make a condition to avoid that? xyzdist.hip
  12. Hello everyone. I have a long sequence where changes happen in the geometry, I have an attribute that changes to 1 whenever the geometry change happens. I would like to store which frames the attribute jumps to 1 in something like an array, does anyone know whether this is possible in VEX? and if so how? I hope I am clear enough in what I want.
  13. link two points with a curve in vex

    I have a grid or any geo and I need to join two points with a rounded curve is there a way to do this in vex ? Thanks hdni_vex_curve.hipnc
  14. Hello Everyone, I have just create tutorial of making nuclear cooling tower destruction using new features of constraint in Houdini 17.5 Check in here: https://www.cgcircuit.com/course/nuclear-cooling-tower-destruction Best Regards, NhanVo
  15. Hi For some reason, it is hard for me to understand multithreadness of VEX I mean, in most cases, the fact that my code works in parallel on each of the components messes my plans. So I usually make my code to be able to work on 'detail' and manually set all the processing loops. Everything was fine until yesterday when my wrangle was cooked for a solid eight hours.) So my questions are: Is there a way to make a point(primitive) wrangle to process elements in a specific order, or do I have to use detail_wrangle if the order is crucial? Can I somehow speed up a detail wrangle, like divide all the components in several batches or partitions to compute them in parallel? Can you suggest something to read about how to adjust both my mind and code to be parallel processing friendlier)
  16. Hi guys, I'm trying to learn a bit more about geometry creation and manipulation in vex. I've been attempting to create a simple grid with lines moving along in one direction. Once the line reach the end of the grid, it moves back to the other end. Like a treadmill. I've been able to create some stuff with addvertex and addprim in a for loop, but nothing nice and procedural. Anyone have an elegant solution to this? Thanks
  17. Enforce Prototypes @ptnum

    Hello, So doing some clean up on my vex code in a wrangle and I turned on Enforce Prototypes to remove a bunch of the hacks to get the code setup. The one thing I can not find out a cleanup for is to replace @ptnum with a non @ function. Is the only way to declare it prior to the wrangle as another attribute? That just seems messy. Even declaring before hands means you need @ptnum to source that attribute. Thanks, -Ben
  18. how get attributes name?

    Hi odforce, i have a small problem,its confused me a few days.how can i get the attributes name use vex or python(vex is better,because im not familiar with python)? for example,i have a geometry with some point attirbutes like "v" "Cd" "mass" "aaa",and prim attributes like "prima" "primb".if i want create a new string attribute and store all the attributes,how do i achieve that?
  19. Hello everyone!! I have seen these organic creations and I have fallen in love <3 How we can do somenthing like this? We need too much VEX code to achieve it? I'm sure that between all of us we can achieve it! Cheers!!!!
  20. I'm using about 1000 points in a point wrangle SOP as seeds to generate lines, totalling about 20,000,000 points... performance seems almost single threaded, which I assume is due to the creation of new geo. Is there any way I can speed it up? Here's the code in question if anything obviously jumps out: // trace lines through nested velocity volumes void stepRK4(vector pos; const int prim; const float dt; const vector V0; float dir) { vector V1 = volumesamplev(1, prim, pos + (0.5 * dt) * V0) * dir; vector V2 = volumesamplev(1, prim, pos + (0.5 * dt) * V1) * dir; vector V3 = volumesamplev(1, prim, pos + dt * V2) * dir; pos += (dt / 6) * (V0 + 2 * (V1 + V2) + V3); } void step_forward(vector pos; float dir) { float dist = length(pos); // There are volumes at 5 levels of detail, starting from the origin. This distance metric chooses which to sample from int prim = int(max(log(dist / 8. * 2) / log(4) + 1, 0)); // advection step based on the voxel size float vd = volumevoxeldiameter(1, prim); float dt = vd * 2; vector vel = volumesamplev(1, prim, pos) * dir; stepRK4(pos, prim, dt, vel, dir); } int steps = 10000; int pr1 = addprim(geoself(), "polyline", @ptnum); int pr2 = addprim(geoself(), "polyline", @ptnum); vector pos1 = @P; vector pos2 = @P; for (int i=0; i<steps; i++) { step_forward(pos1, 1); if (length(pos1) >= 1 && length(pos1) < 1000) { int newpt1 = addpoint(0, pos1); addvertex(geoself(), pr1, newpt1); } step_forward(pos2, -1); if (length(pos2) >= 1 && length(pos2) < 1000) { int newpt2 = addpoint(0, pos2); addvertex(geoself(), pr2, newpt2); } }
  21. I want to split a string after a specific number of characters. ie. split after the 5th character (position 5) string s = "0123456789"; into "012345" and "6789" I don't have any consistent separator. I have a consistent amount of characters after which I want to split. Split function won't work because by default it will set space as the separator if none is specified. My approach would be. Split the string into a characters array, and then recreate the separated strings using a for loop string s_char[] => (0, 1, 2, 3 , 4, 5, 6 , 7, 8, 9) int coord = 5; //coord to split at string s_1, s_2; for(int i; i <= coord; i++){ s_1 += s_char[i]; } for(int i; i>coord && i<max; i++){ s_2 += s_char[i]; } Any ideas on how to achieve this?
  22. Seeking Solver Writing Advice

    Hello there I am just getting into solver writing. I am self taught and as such I have a fair few holes in my knowledge I aim to build a material point method solver for use in a mud flow effect such as this: https://www.youtube.com/watch?time_continue=42&v=jjeCDYvGJS8 To get to grips with a basic solvers I have built a mass, spring cloth solver: https://vimeo.com/343112353. However there are a few things I've come across that I can't find solutions to. Every timestep I am accumulating a force vector on each point and then I find the acceleration using a=f/m. I find the velocity v=v0+a*@TimeInc. And I find the displacement using r=r0+v*@TimeInc. This works quite nicely however I can't shake the feeling that the equations are completely wrong. Everywhere I look they mention using integration in order to find the displacement but it seems like a linear equation to me. Is this wrong and if so what should I be doing? I would also like to know what the gas integrator node does internally as I find it a bit of a black box. Many thanks George Coleclough
  23. Distance fall off

    Hi I am doing the entagma tutorial where he is blending from low poly to high poly object. In their example they are using a single point from a sphere to create the blend as in the image below . I would like to use a piece of animated logo to reveal between the two. Using bit of vex I found on this site I think I am getting the distance from sphere to each point on the grid but when I visualise it as Cd. It only seems to be taking a few points into account. What I expect is black circle around the sphere. Thanks finddistanceB.hipnc
  24. "https://www.youtube.com/watch?v=t9yoUkFzInA" This is tutorial link and I made this node with that. and I heard about quaternion that it has only 4 vectors so We can use it more efficient way to rotate object. But this tutorial's node convert quaternion to matrix at last. so If I want to use this node properly and I expected, using quaternion. Which part that I should change ?? Sorry for my poor English and Help me wizards !
  25. CG Forge - Vex Foundations I

    I recently finished building my new website - cgforge.com It's a website focused on quality - offering only the best 3D tutorials in one place. Check out early access to my next course: Vex - Foundations I Thanks for watching!
×