Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Search the Community: Showing results for tags 'wrangle'.

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

  1. I'll get right to it. I am running a foreach loop on a bunch of prims. For each prim I scatter a number of points. Still within the foreach loop, I run a point wrangle on those points. In the wrangle I run intersect on each of the points and if one hits I want to set an attribute on the prim (foreach loop peice) that the points were scattered on. In the end I don't need the scattered points, I just need the prims output with the attribute @keepage. What I cant figure out is how to set up the forloop so that this works.
  2. Hello! Sory for my English I'm trying create geometry with AttribWrangle node in Detail mode. I use addpoint, addvertex and addprim nodes. When I created some points how could I get access to them into the node? For example, I created point pnt0 = {0,0,0,}. And now I want to create point pnt1 which is close to pnt0: int X = 3; int pnt0 = addpoint(0, set(0,0,0)); int pnt1 = addpoint(0, set()); - and here I want to get position of the first point and add X to each coordinates. Is it possible?
  3. Looking for some help on setting up a Wrangle that would curl a curve by rotating the last point in the curve around a point centered on the previous point, and doing that all the way down the chain so you get nice curls happening. Been trying to work this out but I'm missing some knowledge here when it comes to looping through points per primitive, and also I'm not sure how to rotate a point with the rotation origin starting on another point. Basic idea is that given an @N and an @up vector on the curve, it will rotate each point about the previous point's @P using cross(@N, @up) as a rotation axis, by some user defined degrees/rads number. The code would have to (far as I'm thinking so far) loop through all prims, and then loop through all points in each prim, rotating each one around the previous point.
  4. Hello guys. Could anyone help me with syntax. Im relatively new to VEX. I need to get total number of points of geometry that connected to second input of wrangle. I tried something like int maxp = @opinput2_numpt; but it always returns 0. Would appreciate help.
  5. I am looking into installing VEX syntax and Exhelp for Sublime text and that is easy and nice, but I realized I don't know of a good way to actually connect Sublime text to Houdini. Copy pasteing the code between Sublime text and Houdini everytime I want to test something seems like a pain. It would be so inconvinient that I wonder whether Sublime Text would be worth the effort. So how do you use it? Is there a way to hook Houdini and Sublime Text up to each other for a direct connection?
  6. Hello wizards! I have a question about point wrangle SOP. Is it possible create a matrix, and use that matrix in copy SOP as a transform ? In the file attached, i build all axis that i need for create a matrix, and rotate the copies with "roll_on_path" ramp parameter, but until now, no way. If someone have an idea... a big Thanks
  7. Hey guys. I'm pretty new to the houdini world, and I've been experimenting a lot of things. Is there a way to get the RGB values of scattered points using attrib wrangle? Im not too familiar with the VEX syntax, so Im having a hard time figuring it out. I have random colours signed to a scatter node and some geometry copied on to the points using a copy node. I want to limit scatter the geometry based on the colour of the scattered point. Thanks!
  8. I just installed Houdini 15.5.683 for Ubuntu 16.04 and I gave a quick look to see how different was from windows version. The first issue that I encountered is with attribute-randomize sop, that gives me a strange error (VEX related). I tried the same setup in windows and everything works smooth! maybe is a ubuntu specific bug? there's someway to fix it, because this sop is essential to me. thanks in advance ps. I navigated inside the attribute randomize sop to find the actual line error.
  9. Hi I'm new to this wrangle node programming, I've been busting my head over why this doesn't work for three days, it's so simple therefor i must be missing out on some general vex concepts. If anyone can please point me in the right direction that would be greatly appritiated. I have a bunch of points on a grid and their moving up and down via noise. I am trying to set up a point attribute that has a value of 1 when a point if moving up (positivly in the Y axis) and a value of 0 when a point is moving down (negativly in the Y axis). This attribute is called Direction, I'm computing the logic on temporary VEX variables and then writing them out to the attributes. Here's how it looks like : // 0 is going down, 1 is going up, -1 means the point has no direction // on the first frame they have no direction so the points just take their current heights so they can use them for comparison on the second and every other frame int temporary_Direction; float temporary_Previous_Frame_Height; if(@Frame == 1) { temporary_Direction = -1; temporary_Previous_Frame_Height = @P.y; } else { temporary_Direction = @Direction; // ------------> this is where the problem is (this is here so that the temporary variable get's the value of the currently proccesing point every frame) temporary_Previous_Frame_Height = @P.y; if(temporary_Direction == -1) // If the point has no direction { if(temporary_Previous_Frame_Height < v@P.y) // If it's going up { temporary_Direction = 1; temporary_Previous_Frame_Height = v@P.y; } if(temporary_Previous_Frame_Height > v@P.y) // If it's going down { temporary_Direction = 0; temporary_Previous_Frame_Height = v@P.y; } } } // Out_Values i@Direction = temporary_Direction; f@Previous_Frame_Height = temporary_Previous_Frame_Height; // Out_Values The problem here seems to be when I declare "temporary_Direction = @Direction", for some reason on the second frame when I read @Direction the value wich is given to temporary_Direction is 0 instead of -1 wich was given to every @Direction on the first frame. Temporary_Previous_Frame_Height updates just fine but temporary_Direction doesnt. Also writing "if(temporary_Direction == -1)" doesnt seem to work either. Is my thought process even slightly right here, what am i doing wrong, are temporary variables created in vex something that exist globally and in order to use them per point we need to read each point's values or are temporary variables something that exist for every point. Also why do i have to give values to all attributes every single frame or else they will reset to 0 (hense the Out_Values section). //////////////////////////// Update Thank you everyone for replying. I've tried out the time shift sop and it work's fine now( I dont even need the Previous_Frame_Height attribute anymore). I've updated the main post with the original hip file and the one with the time shift sop. Learning about the time shift sop is great, but i would still like to improve my thought process on writing code. It would be greatly appritiated if someone can take a look at the original hip file and possibly shed some light on the problem. I've added notes inside the original hip file for clarity. Any help would be appritiated Thanks in advance Original.hip Time-Shift SOP.hip
  10. Hi, Is there an possibility to have @ working to create write attributes in a vex function? Something similar to the following function void test() { i@test_attrib = 10; } The reason I want to avoid setattrib is that it is much slower as implementation. Are there any other idea's? does the *.vcc compiler optimize the setting of attributes? Cheers
  11. Hello, Trying to read a vector array from another point at a certain index. From my understanding of Houdini something like this should work. vector tempArray[] = point(0,"vectorArrayAttrib",pointToReadFrom); vector v = tempArray[index]; Unfortunately this method is returning an empty array from the point() function. If this is not the right way to go about doing this please let me know. Any help welcomed. Thanks.
  12. Hello,I'm attempting to create the slitscan/timeshift effect. I'm creating a vector array in a for loop, each loop has an attrib from map and a wrangle that appends Cd to a vector array. It works when the attrib from map is always reading from the same file. When I change the attrib from map file read expression to anything that has to do with $F or the meta nodes iteration Houdini crashes. I have a test scene that has documentation and even nodes setup to create test frames to work with.If it is a matter of the way that multiple files cannot be read at once please let me know. If someone knows of a better way to read from multiple files at once and/or achieve this effect please let me know. I'm aware that after effects has this effect and uses gradients to determine which frame to look up color from. While that method is great, I'd like to be able to write the gradients/lookups in vex to achieve results. Any help greatly appreciated. -T concept_025_slitScan_v001.hiplc
  13. Hello guys, I know how for loop works in c++ but i am not able to write in vex .Can anyone explain me how to write for loop with simple point and color example . Thank you
  14. Hi, is it possible to access the points I create in a wrangle with the addpoint function in the same wrangle? I have an attribute wrangle that only runs once. Within that wrangle I made a for loop where I create points. Then I want search for neigbouring points within the points I created so far in the same loop. I could store the positions in array and loop through the array of the positions I stored so far within the loop, but that can get pretty slow. I hope I explained this well anough. I there any way to do this or should I have another approach for this?
  15. Hi guys, here are the files I used for the last Vancouver Houdini User Group in case anyone wants to take a look. My presentation was about writing the Group SOP in VEX and trying to optimize it. I wrote everything in a wrangle, and it works great as a preset in a point/prim wrangle. I also made a Digital Asset, although it's not a VEX operator because I couldn't figure out how to make it work purely in VEX because I need to use the group bindings from the Wrangle and I'm not sure how to implement that in VEX. Anyways, the OTL is just the wrangle with the parameters promoted. In the presentation file you can take a look at the speed tests of the Group VEX vs the Group SOP. The difference in performance is pretty similar if you have a few points/prims, but once you go above 1 million the performance difference really starts to kick in. The Group VEX becomes exponentially faster than the Group SOP the more points you have. The difference can really be seen when you group by object and when you group by volume. I also made those 2 modes work with primitives. Here are the files in case anyone wants to take a look at the code. Feedback is greatly appreciated! group_vex_jeronimo_maggi.hipnc vhug_presentation_jeronimo_maggi.hipnc group_vex_jm.hdanc custom_group_sop.vfl
  16. Hi Pretty much the title In VOP I can use the "Import Primitive Attribute" node to do it, but I'm not sure what's the recommended way to do the same in a wrangle. I noticed that the IPA node is actually just a snippet, which obviously answers my question, but I was wondering if there was a more straightforward (a.k.a shorter) way to do the same Thanks EDIT Someone answered my question and apparently just using @primnum works in wrangles. However, now I'm more confused. I created a sphere and put a f@test = @primnum; in a point wrangle, the results are some numbers, but what do these numbers refere to?
  17. Hi I am trying to rotate a volume so it aligns with the original geometry. (align along x axis - convert to volume - revert back to original place) I tried setting the primintrinsic, but the pivot point is shifted relative to the original geometry, there is a way to specify the desired pivot for the matrix? Any ideas? Thanks) volume_rotate_v01.hip
  18. Hi there!! I have been using odforce for a while now, but this is my first post! I have just been playing with cloth tearing using the SOP Solver to calculate stress by analysing the distance between points and removing them based on a threshold. Just did it for fun! Any thoughts, comments or opinions would be great! Or maybe it will help someone... HIP file is attached. cheers G stressTest_GraemePhillips.hipnc
  19. Hi, I am fairly new to houdini. I have attached a scene here, I have animated a box to move through the Ocean Wave in X direction and I want it to follow the Y transformation of the point from the ocean wave so that it looks like it is interacting with the wave below. I want a VEX method please. My file picks up the transformation of a single point but it does not updates the points while the box moves so the Y transform remains intact with the first point that it picks up at the beginning. So please look at the attached file and please let me know how to overcome it. And please if anyone can suggest me a good source to learn VEX language for houdini from the beginning. And I know python language so will I have to learn Hscript or Python is a perfect substitute? box_move.hip
  20. How can i import attribute to geoself() geometry from second input of wrangle node if i don't know type of this attribute. I write function: parameters: native_input = 0 (first input of wrangle node) sample_input = 1 (second input of wrangle node) attribs = string like "attrib1 attrib2 attrib3" native_ptnum = number of point in current geometry where i want create attributes like in second input sampled_ptnum = number of point from second input where i want sample attribute. but cannon import any array attributes like "Cd" and etc... This function correctly worked only if attribute is not array (type = 0 or 1 or 2) :((( void sampleattribs(int native_input; int sample_input; string attribs; int native_ptnum; int sampled_ptnum ) { foreach(string aname; split(strip(attribs), " ")) { aname = strip(aname); if ( haspointattrib(sample_input, aname) ) { int atype = attribtype(sample_input, "point", aname); if (atype==0) { addpointattrib(native_input, aname, int(0)); int value = point(sample_input, aname, sampled_ptnum); setpointattrib(native_input, aname, native_ptnum, value); }; if (atype==1) { addpointattrib(native_input, aname, float(0)); float value = point(sample_input, aname, sampled_ptnum); setpointattrib(native_input, aname, native_ptnum, value); }; if (atype==2) { addpointattrib(native_input, aname, ""); string value = point(sample_input, aname, sampled_ptnum); setpointattrib(native_input, aname, native_ptnum, value); }; if (atype==3) { int def_value[]; addpointattrib(native_input, aname, def_value); int value[] = point(sample_input, aname, sampled_ptnum); setpointattrib(native_input, aname, native_ptnum, value); }; if (atype==4) { int size = pointattribsize(sample_input, aname); string typeinfo = attribtypeinfo(sample_input, "point", aname); float def_value[] = {}; for(int i=0; i<size; i++) append(def_value, 0.); addpointattrib(native_input, aname, def_value); setattribtypeinfo(native_input, "point", aname, typeinfo); float value[]; resize(value, size); int success = -1; //value = point(sample_input, aname, sampled_ptnum); //printf("%d\n", sampled_ptnum); //foreach(float v; value) { printf("%f", v); }; setpointattrib(native_input, aname, native_ptnum, value); }; if (atype==5) { string def_value[]={}; addpointattrib(native_input, aname, def_value); string value[] = point(sample_input, aname, sampled_ptnum); setpointattrib(native_input, aname, native_ptnum, value); }; }; }; };
  21. The most powerful wrangle operator due to the sheer fire power of the HDK. Performance increase can vary from a few times to thousands of times depending on the scenario.
  22. Today I was investigating how really works wrangle nodes type( more in general vex ) trying some printf debug statment. as written in the reference : "This node runs the snippet on the detail or every point/primitive/vertex (depending on the Class parameter) in the input geometry. The snippet can edit the input geometry by changing attributes. It can access information from other geometry using attributes and VEX functions." so chosing point class parameter and having for example an array/set of points( I don't know how point are actually internally handled by houdini), the code is "applied" to every i-th elements of the array, like a big external "invisible" forEach loop. Correct me if I'm wrong. now, my snippet is very simple: for (int i=0; i <5;i++) { printf("Point processed is %d \n", @ptnum); printf("Number of iteration: %d\n", i); }
  23. Hi all! I'm pretty noob with houdini so maybe this will be a silly question :-) As the title says, I can't find a "direct" way to access to global variables in point/attribute wrangle nodes( maybe it's not possible?). In my case I would access to $NFRAMES global variable to pass as parameter in fit() function to normalize frames count, but obvioulsy as reference guide say: Now I found a workaround: I create an attribute(with attributeCreate node) with $NFRAMES as value and then I can access in the wrangle code snippet. It works but I don't like this method because: for now I have just a bunch of points and the memory footprint is relatively low but what if I crank up the value for thousands of points? if I'm not wrong, integer values are handled as C small int so 4bytes*100.000 points will increase the memory footprint( I know that are just of bunch of KB but I'm "obsessed" with time/space performance). There are some "clean" way of get global variables? Thanks in advance
  24. I have a subnet which I intend to transform to a .hda asset. Inside the subnet there are wrangle nodes and some of them include a couple of .h header files from houdini/vex/include folder. Now my question is how can I attatch/embed these header files in the asset so I don't need to copy files separately? 1- Can an asset embed header files and then copy them to a certain folder when a user is installing them? 2- Or maybe I can somehow embed the header files in the asset and then include them in the wrangle nodes with a relative path? Thanks in advance for any suggestions
  25. Hi all, I'm currently working on a project where I need to look at the points in a mesh, and then make a certain percentage of them pair off with one another, pairing with the closest if possible. Now...I sort of did it, but I'm debugging my it at the moment as some pairings are not working properly (they are being paired with already paired points). Here's a stripped down version of my code (as a side note, the points are dynamic, so I have to use stored point id in an attribute called 'id'); if(i@paired_pt!=-1) return; // Does this work correctly? int close_pt=-1; int handle = pcopen(0, "P", @P, range, pt_count), pt; while(pciterate(handle)){ if(pcimport(handle, "point.number", pt)){ if(pt==@ptnum) continue; // The first one is always the current point if(point(0, "paired_pt", pt)==-1){ // Is this point already paired? closept=pt; break; } } } pcclose(handle); if(closept==-1) return; // No match so just exit i@paired_pt=point(0,"id",closept); // Find the actual id of this paired point // Is this actually updated, so the comparison at line 0 will work properly when it is evaluated? setattrib(0, "point", "paired_pt", closept, 0, @id, "set"); So...does the setattrib function actually set the "paired_pt" attribute so that the comparison at line 0 will work properly? tldr; In a wrangle SOP can attributes that are set be read in the same loop?