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

  1. I have an attribute wrangle SOP running over points, in which I need to read the value of a detail attribute for every point. This seems fairly straightforward using the supplied attribute functions, but I can't get the behavior I need. Below is a simplified version of my VEX code, with calls to printf for testing. The geometry it's running over has an integer detail attribute called "last_clean." printf( "last_clean=%d\n", int(detail( 0, "last_clean"))); printf( "ptnum=%d\n", @ptnum ); if( detail( 0, "last_clean" ) == @ptnum ){ printf( "test\n"); //do stuff in this loop } and here's the output: last_clean=0 ptnum=1 ptnum=2 ptnum=3 ptnum=4 ptnum=5 ptnum=6 ptnum=7 ptnum=8 ptnum=9 ptnum=10 Note the lack of "ptnum=0" or "test." The only rationale I can imagine for this is that the call to detail() turns the wrangle into a detail one for that iteration, thus making all references to @ptnnum basically meaningless (which still doesn't exactly explain why it only reads the detail attribute once). But I can't find anything in the documentation about this behavior of those functions or wrangles (what else is new...). Can this behavior be changed? Is there a stupid error I'm missing? The wrangle is in an orange for loop block if that's relevant. Thanks for your help!
  2. Manipulating points with noise (vex)

    Hey y'all, very new to Houdini here and I feel like i'm missing something obvious. So i'm trying to create a line of points to be later turned into a polyline. I'm not having to much trouble making a straight line, but i'm trying to manipulate the points with noise but it seems to only be changing the position of the points in a linear way. ie, they're only growing farther up, not really 'wandering' in other directions. Any help would be appreciated, thanks! VEX vector pos; //vector rand; vector growthpos = normalize(chv("growthposition")); int numsteps= chi("numsteps"); vector wander = (noise(pos+1)); float wandermag = chf("wandermag"); for(int i; i < numsteps; i++){ pos = growthpos * i; pos = pos * (wander * wandermag) ; addpoint(geoself(), pos); }
  3. Hey guys the original example from VEX_Sort is not working at least in my windows machine I change the code #include <UT/UT_DSOVersion.h> #include <UT/UT_Array.h> #include <UT/UT_Vector3.h> #include <UT/UT_Vector4.h> #include <UT/UT_Matrix3.h> #include <UT/UT_Matrix4.h> #include <UT/UT_Assert.h> #include <VEX/VEX_VexOp.h> using namespace UT::Literal; namespace HDK_Sample { template <typename T> int compareValues(const T *a, const T *b) { if (*a < *b) return -1; if (*a > *b) return 1; return 0; //Direct access to pointer value is not working in compare operator //return *a > *b; } template <> int compareValues<const char *>(const char * const *a, const char * const *b) { return strcmp(*a, *b); } template <> int compareValues<UT_Vector3>(const UT_Vector3 *a, const UT_Vector3 *b) { if (a->length2() < b->length2()) return -1; if (a->length2() > b->length2()) return 1; return 0; //Direct access to pointer value is not working in compare operator //return a->length2() > b->length2(); } template <> int compareValues<UT_Vector4>(const UT_Vector4 *a, const UT_Vector4 *b) { if (a->length2() < b->length2()) return -1; if (a->length2() > b->length2()) return 1; return 0; //Direct access to pointer value is not working in compare operator //return a->length2() > b->length2(); } template <> int compareValues<UT_Matrix3>(const UT_Matrix3 *a, const UT_Matrix3 *b) { if (a->determinant() < b->determinant()) return -1; if (a->determinant() > b->determinant()) return 1; return 0; //Direct access to pointer value is not working in compare operator //return a->determinant() > b->determinant(); } template <> int compareValues<UT_Matrix4>(const UT_Matrix4 *a, const UT_Matrix4 *b) { if (a->determinant() < b->determinant()) return -1; if (a->determinant() > b->determinant()) return 1; return 0; //Direct access to pointer value is not working in compare operator //return a->determinant() > b->determinant(); } template <typename T> static void sort(int argc, void *argv[], void *) { UT_Array<T> *arr = (UT_Array<T> *)argv[0]; // This will work with all types (including strings). Since no strings // are created or destroyed by this method, it's not necessary to call // VEX_VexOp::stringAlloc() or VEX_VexOp::stringFree() to free them - // the pointers are just reordered in the array. arr->sort(compareValues<T>); } static void decimate(int argc, void *argv[], void *) { const UT_Array<const char *> &src = *(UT_Array<const char *> *)argv[1]; UT_Array<const char *> &dst = *(UT_Array<const char *> *)argv[0]; UT_ASSERT(dst.entries() == 0); for (int i = 0; i < src.entries() / 2; i++) { // Acquire a new reference to the string for storage in the // destination array. const char *str = VEX_VexOp::stringAlloc(src(i * 2)); dst.append(str); } } } // // Installation function // using namespace HDK_Sample; void newVEXOp(void *) { // Sort the array by value for scalars, length for vectors, or // determinant for matrices. new VEX_VexOp("hdksort@*[I"_sh, // Signature sort<VEXint>); // Evaluator new VEX_VexOp("hdksort@*[F"_sh, // Signature sort<VEXfloat>); // Evaluator new VEX_VexOp("hdksort@*[S"_sh, // Signature sort<const char *>); // Evaluator new VEX_VexOp("hdksort@*[V"_sh, // Signature sort<VEXvec3>); // Evaluator new VEX_VexOp("hdksort@*[P"_sh, // Signature sort<VEXvec4>); // Evaluator new VEX_VexOp("hdksort@*[3"_sh, // Signature sort<VEXmat3>); // Evaluator new VEX_VexOp("hdksort@*[4"_sh, // Signature sort<VEXmat4>); // Evaluator // Remove every second string in the source array and store the result // in the destination. new VEX_VexOp("hdkdecimate@&[S[S"_sh, // Signature decimate); // Evaluator }
  4. Houdini face separate folding

    Hi, I am looking to achieve this kind of effect by Elisha Hung: I would be super grateful for anyone who can help me achieve it.
  5. Vex create group

    I wrote these lines to create a group frm my selection BBut the selection is ok but no group is created ?? I add a group sop and the group "truc" is not listed ? Can you help me please ? Thx untitled.hipnc
  6. sinus loop/cycle

    Hey everybody, I am trying to make a simple sinus animation loop in a seamless way. If I am not mistake it should somehow work with combining sin($F), $FPS and $FEND is that correct? Unfortunately I was not able to figure it out so far and it seams like it is not as easy as I thought!? Thank you!
  7. Hey everybody, I'm trying to make a simple setup that starts out with one point from an add node. Then in a solver, a point wrangle gets the position of the last point on the incoming geometry and creates a new point with the position of the last point, plus an offset. The problem is that points are always being created at the position of the first point plus the offset. Here is the code in the point wrangle (running over Detail). The "num" attrib will always has a value of zero, so it looks like the primpoints function is giving me an empty list, but I don't know why. int pts[] = primpoints(0, (@primnum)); vector endpos = point(0, "P", pts[-1]); vector off = {0,1,0}; int npt = addpoint(0, endpos+off); setpointattrib(0, "num", npt, len(pts)); Thanks for taking a look! pointCreate_01.hipnc
  8. Hello I just followed tutorial about Bendint Metal using hard constraint. (www.youtube.com/watch?v=38RhntxXcMI) and had some problems with setup hard constraint and need your help TT In my scene, I setup my hard constraint like left screenshot(red lines). and just like the tutorial, write vex codes for make hard constraint where middle of each constraints. This is guide geometry of constraints in dopnet. Left side is the tutorirals constraint one and right is mine. Modeling is different(I create my modeling my own), but I don't think It makes those difference in constraint. I set up Rest length option same with tutorial but what are those additional constraint points ?? I think those points causes difference with the tutorial so I need some helps to get rid of them. How can I get rid off them ? Sorry for my English TT
  9. Hi, I just want to do it for experimentation. What's the best way to break up the edges of a pyro sim post sim with or without rest fields, and avoid swimming noise? If I have dual rest fields, do you combine them using a Mix node where the connections are rest, rest2 fields and rest2_ratio as the bias? Because there is also rest_ratio attribute. After this, do you displace the density volume using velocity field, gradient of the density or gradient of the SDF converted from density? Also negate the direction? I read here some people advising to use gradient or velocity to the position of the noise for example. Lastly which noise is more suitable for this task? Thanks a lot
  10. instancepoint() is undefined - ?

    Hey all, Just starting my journey into Houdini after years doing Processing, Cinder, oF, trying to learn the basics and figure out certain things I was doing via code, but in Houdini. First thing I thought I'd try is instancing and I'm already off to a bit of a bad start ha. I have instances of my geometry all set up with and instance node and I'm trying to pass per-instance attributes to each instance. However, whenever I call `instancepoint` in an attribute wrangle, Houdini errors out and tells me `instancepoint` is undefined. Can someone point me in the right direction? As far as I can tell the function hasn't been deprecated or anything like that. Thanks!
  11. Hi I'm just stuyding Houdini and have some problems with VEX function named 'vertexindex'. as I understood, It makes 'a linear vertex' from primitive and its vertex. and so arguments need @prinnum and vertex number. But Look at this screenshot. Pink number on shot is primitive number and the number behind of it is return of vertex number 0. I wrote the VEX code as 'i@hi = vertexindex(0, @primnum, 0);' I put 0 in third argument and I expected the result as 1 in primitive 1. because It's No.0 vertex is 1. isn't it ? but the result was 4. I'm so confused with it T_T Help me wizards !!
  12. Lambda SOP

    This operator allows you to call a collection of nodes on any data or simply no data (generators). It gives you full control over how the lambda function should be run.
  13. i am creating a point in between 2 points and i want to transfer all the attributes to this new point, is there a way to find all the attributes that are in a point? like a list/array ["Cd", "P", "N"...] thanks =)
  14. I have a point {0,0,0} and another one in {1,0,0} how can I add one or more points (equidistant) between this 2 points? I know I can use addpoint({.5, 0,0}) but how can I get the new position? should I delete the first P with the second? or there is an function for that? thanks =)
  15. Hello all, I have a question regarding to how I can use Sublime Text as an external scripting editor for VEX / Python on macOS. I have tried editing houdini.env as follows but Sublime didn't open when I clicked the button "External Editor" on scripting window. EDITOR = "/Applications/Sublime\ Text.app/Contents/MacOS/Sublime\ Text" I suspected it's because of the space in directory's name but if I change the name of the application then it screws up the Sublime Text app itself so I cannot do that. I've also tried following but nothing worked. EDITOR = "/Applications/Sublime Text.app/Contents/MacOS/Sublime Text" The reason why I think it is due to the spacing on directory's name is because when I tried to set the external editor to Atom which has no space on any directory to it's bin file, it launched ok when I pressed External Editor button on scripting window in Houdini. EDITOR = "/Applications/Atom.app/Contents/MacOS/Atom" But I would really like to use Sublime Text for editing the script instead of Atom, so my question is... how can I escape the space for the file path on houdini.env on macOS? I'm using Houdini Indie 17.0.352 macOS Mojave 10.14.1 Thank you
  16. vex - arrays

    Hi Guys, I am wondering if there is any way in vex to compare between two arrays to get the difference. Please let me know is there any way to do this, below is what I am trying to do s[]@attribsA = detailintrinsic(0, "pointattributes"); s[]@attribsB = detailintrinsic(1, "pointattributes"); s[]@AB = @attribsA - @attribsB; //need mismatched attributes in a s[]@BA = @attribsB - @attribsA; //need mismatched attributes in b Thanks a lot in advance!
  17. Hi, I have several meshes and a point and I would like to find primitives/points, the normals of which are directed to that point. To make it so I want to get vectors (and store them as an attribute) from that point to each of the points of these meshes and then compare them to its normals. But the first part doesn't work as I expected, what am I doing wrong? Or should it be done in a different way? facing_to_q.hipnc
  18. Hi, At this point I need a new pair of eyes on this one and maybe a new brain. I have a simple test scene with a rbd ball smashing a wall, the wall is holding together with ConeTwist constraint. I then use the good old sop solver to 'removeprim' the constraints when the angle is larger than X. I can see the Angle attribute in the spreadsheet and all, but for whatever reason (I know it's a very simple one), the constraint bend but don't break! If someone as a few minutes to spare and take a look it would be much appreciated. Sorry if I sound sarcastic but I'm getting frustrated by my own stupidity! coneTwist_test.hipnc
  19. Orient / Lookat for Bullet Objects?

    Hi, I'm hoping someone can help me as I've spent too long on trying to work this out by myself now. I'm doing a simulation with balloons and want to have them start in randomised orientation and then slowly resolve their orientation to have the wider bit at the top. This seems to be possible with POP spin for particles, but I can't work out how to do it with bullet. So far, I've tried altering the orientation manually in a wrangle in dops and trying to find a way of getting a vector into dops, such as with normals, to then be able to compare to an up vector and add in angular velocity until they match. Altering the orient attribute in DOPs seemed to do nothing if you target it directly, so perhaps it needs to be worked on the intrinsics?? Nothing I tried seemed to work, so I'd love to know if there's a way of achieving this, so would be grateful for any help. Many thanks! Toby
  20. Hi, Could somebody please explain, on http://www.tokeru.com/cgwiki/index.php?title=HoudiniVex I can't understand the reason behind "It's worth pointing out that if you're defining the groups yourself, you're better off using an attribute to identify the pieces, and use that to do your random whatevers." I mean, I don't understand are there any advantages in deleting(for example) some points/primitives by using additional attribute over deleting them by @ptnum/@primnum. Thanks in advance.
  21. Hi, Can I use the name of the current wrangle(node) inside the very same(or any other) wrangle? I have more than one instance of the same wrangle in my network and I would like them to make different groups based on their names (or any other node's name). Is it possible?
  22. Hey guys, I'm trying to learn VEX a bit more and for an experiment I wanted to do I want to get the bounding box size of the first input in my wrangle node. But I just get an error and don't understand what I've done wrong - any and all help in appreciated! vector getpointbbox_size(0, @ptnum); Thanks, Jack
  23. Hi everyone ! I'm learning VEX (from CGwiki and Entagma) and I don't understand why the result of the following code is 0 whereas it should be 3... what did I misunderstand ? int myarray[] = {2, 3, 4, 5}; int foo = myarray[1]; printf("%i \n",i@foo); Thanks ! Alexandre
  24. Hi all So I have a question about the new versions of the For-Each node, particularly the Numbers one, I have been following a tutorial from Anastasia Opera, and during the tutorial she uses a For-Each subnetwork node now I understand what this node is doing collecting the data from the box_id, Anastasia also gave the node a stamp name which will be used a bit later on for a blast node to specifically target some points following the local path hence why the stamp name was given to the For-Each Subnetwork node in order to lead a path towards a node that contains specific points with a number that is less than 3 which I understand is the point number and can also see it infant of me.... but now here is where I get confused in the new version of Houdini 17 the Subnetwork node has been disabled and be re-enabled but instead I would like to understand what on earth is up with the new For-Each Numbers node, it has some weird dodgy layout that just throughs me right off!! I would not mind trying to re-create the tutorial using this new node but its proving to be a challenge as I have no idea where to place the nodes that help in set things up for procedural modelling which I have tried to place things in myself but ended up with nothing but more errors. if someone could please help that would really awesome and I would really appreciate it. Kindly Ahmet .B
  25. Stark Houdini Palm Tree FX

    Link to Course In this 3 hour course I show you how to setup a system for dynamic and unique palm trees. No two are alike. I start from the very first leaf and go all the way through to rendering with Redshift in the most efficient way possible. At the end you will understand how to make your own trees and take these concepts and apply them to other setups that will bring your skills to the next level! Includes 13 Chapters and the final Houdini file. Also the assets to follow along. Full HD
×