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

  1. Free video tutorial can be watched at any of these websites: Fendra Fx Vimeo SideFx (coming soon, waiting on approval) Project file can be purchased at Gumroad here: https://gumroad.com/davidtorno?sort=newest
  2. I have Subnet node name is "subnet1". In "subnet1" i have ROP node.The same name as subnet is "subnet1". When i change my subnet name change the my ROP name too. How to write in "On Name Change" python ? Thank you.
  3. Dear all, Good Evening, So, i was digging into the VEX functions "string" section. And i didn't found any clue to chop a string into an array. string myString = "1234Abc"; The goal will be to get this below : string arrayFromString[] = {"1","2","3","4","A","b","c"}; As well in python it is "native" : myString = "1234Abc" myString[0] would be "1" etc etc.... But to use it in a wrangle i need VEX ....If anybody has a clue . It will be 100% Welcome, as it could be a very simple way to chop and bytecrush long floating numbers. Might it be a NOOB question and i apologize already for that. Thank you a lot, And all the best to everybody with Houdini !!! alr + + +
  4. Free video tutorial can be watched at any of these websites: Fendra Fx Vimeo Side Fx Project file can be purchased at Gumroad here: https://gumroad.com/davidtorno?sort=newest
  5. Hi peeps, For a project I'm working on a trail system where I want to draw lines from one point object to another. I followed a tutorial from Entegma explaining how to do this and it works well. Only in my project I want the lines not to be drawn on the points from the whole object that are also in this search radius. If you look at the image you can see the red lines. I only want the light blue lines. Also in the image is the VEX code. Can someone help me solve this problem? Thanks in advance!
  6. Vex Pathtracer

    Hey guys, I started making a very simple pathtracer with vex in sopland. I'll add basic reflection and refraction, and keep it very simple as it is made as an "educational tool" to help students understand how pathtracing works under the hood. Once I'll have finish I'll share the file here if some of you are interested. I added an "animation" in which we can see the different paths a ray takes : the primary path (in red/blue in the video), the next event estimation path (in black/yellow), and the diffuse bounces (in magenta). I'll also add the next event estimation for the diffuse bounces, and of course when it will be implemented, reflection and refraction paths. Here's a little video of the animation, and a very non-converged render https://streamable.com/37kxua (I think I have a bug in the global illumination I'll fix it tomorrow). Cheers,
  7. Hi all, Another Noob question here: I'd like create a setup that takes my object A (in this case, a Line SOP) and constrains its pivot position and vector angle to the pos and N of a given point on object B (in this case a mesh object). I'd like to include in the setup, an integer slider that lets me choose the point number. I have to imagine this is a fairly simple thing to do and have been searching for the right tutorial but haven't found it yet. Can anyone out there share a tutorial link, or maybe a VEX snippet? BTW, I'd welcome a VOP solution just as well. Preemptive thanks to any responders! NpF
  8. Does anybody know how to use a group name as attribute class (attribclass) in a function like nuniqueval???? In the docs it says it is possible: attribclass One of "detail" (or "global"), "point", "prim", or "vertex". You can also use "primgroup", "pointgroup" or "vertexgroup" to read from groups. I can't figure it out how to use this thing, it doesn't work. Basically I want to find the number of unique attrib values from a group of points, not from all points in the geometry. For example I did something like this (point groups with the name of the primitive are created earlier) string grp = sprintf("primnum_%g", @primnum); int islands = nuniqueval(0, grp, "island"); i@islands = islands;
  9. Modeler 2021 Released!

    Modeler 2021 for Houdini Released! Release notes: https://www.dropbox.com/.../Modeler-2021-Release-Notes... Product Link: https://gum.co/mdNet Release video and new video tutorials will be available soon
  10. hello , it's my first time i use python in houdini fx i know python from before but i never used it in houdini fx and it seems it's easier than vex to achieve the same task, my problem is i have an fbx file with shop_materialpath and there are different name in shop_materialpath i want to create a string channel for each unique name , that string channel it will be a path for ue4 material for example if i have 2 different name in shop_material the first one is TS_02 and the second is Roof_01 i want to create 2 string channel to expose it later to ue4 using hda first string pathmat1 and the second one is pathmat2 and they will be applied in an attribute name unreal_material or path , i want to automate this process because i want it to work on random asset if i dont know the name of the shop_materialpath the python script should loop in each primitive and see how many name there are in shop_material path and create string channels for them . i already made a script to store the name of the shop_materialpath in a dictionary and then i lost from where should i continue idk how to access primnum in python and idk how to create string channel like in vex using chs() here is my python code # Run a generator Box SOP Verb def grp_n(grp): myDict={} for mat in grp: if mat in myDict: myDict[mat]=1 else: myDict[mat]=1 return myDict node = hou.pwd() geo = node.geometry() dict={} list=[] for pri in geo.prims(): list.append(pri.attribValue("shop_materialpath")) l=grp_n(list) print l and i made a simple code in vex but in this case i already know the shop_material names and im testing using if conditions and applying string to the unreal_material , i want to automate this process to check how many names there are in shop_material path and then creating string channels for each one, sorry i dont know how to explain this in an easy way but my english is not too good string id1=chs("uemat1"); string id2=chs("uemat2"); string id3=chs("uemat3"); // testing conditions comparing the groups name if(s@shop_materialpath=="TS_02"){ s@unreal_material=id1; } else{ s@unreal_material=id2; } if(s@shop_materialpath=="Emissive_01"){ s@unreal_material=id3; }
  11. Hello, I have a for each connected loop, and I created a meta import node. To access the node using the detail function in a wrangle I have to use the back ticks to get the value of the iteration otherwise it just shows 0 without the back ticks. Can some please explain to me why we need to use the detail function in back ticks, for example `detail("../eachP/", "iteration", 1);` in a wrangle node for it to work? Thanks, This is with back ticks This is without back ticks
  12. Analogous Colors

    I would like to color a set of primitives using random analogous color pairs. (or triadic/tetradic etc) The color sop node provides this information but only as a guide to choose from. How would i go about this? i suppose vex is the way to go but i don't have a clue as to which functions or what method should be used. Any tips?
  13. where I can find the list of global attributes in houdini like pscale animated etc etc .
  14. Hello, Can someone please explain to me what a linear vertex is properly? I thought I understood it when I was initially trying with lines but once I applied the function on the grid, everything seems wrong. I understood it as, primvertex points to the point number, so vertex 2 of primitive 1 should return 2 but instead it is returning 6. Not sure why? The same function with lines give me the correct answer.
  15. Hi guys, I would like to get a way to add more deform to a ribbon. Pathdeform is helping but I would like to add some area to rotate my ribbon. I tried "attribute transfer" to rotate @N without succes.. Any help would be appreciate. Thank you.
  16. I want to know if a group exists in my geo stream. Found a solution in this old topic but doesnt seem to work Any ideas? check_for_group.hip
  17. Hi, I've some experience with VEX in SOP land but I'm new to Mantra shading and I want to get better at writing vex shaders. What would be the modern way of doing that? In particular, I'm not entirely sure if I could simply write my code and hit compile (the way I would with OSL in RenderMan) without ever leaving Houdini or restarting the renderer for that matter. For instance, I managed to compile the following from a vfl (a modified sidefx example) into an HDA (.\vcc -l "%HOME%\houdini18.5\vex\hcartoon.hda" "%HOME%\houdini18.5\vex\hcartoon.vfl") and it's available under /SHOP/Digital Assets and it works. #include <shading.h> #pragma opname hcartoon #pragma oplabel "HCartoon" #pragma opicon SHOP_surface #pragma label colora "Color A" #pragma label colorb "Color B" #pragma hint colora color #pragma hint colorb color #pragma hint Cd hidden surface hcartoon( vector colora={0.2, 0.5, 0}; vector colorb={0, 0.2, 0.8}; vector Cd=1; ) { vector Cx; illuminance(P){ Cx = Cl; shadow(Cl); if (Cl == Cx){ Cf = colora; } else{ Cf = colorb; } } } However, isn't there a more straightforward way? Do I always have to compile to HDA and write all those pragmas? I was hoping for something like an attribute wrangler approach. So, there's the Surface Shader Builder (vopsurface) that I have to admit I don't quite get as far as writing code goes. Snippet? Inline? How about inputs and outputs in it? Surely not with pragmas in there, right? I tried with a snippet, got a compile error 'Invalid return type (surface)'. If anyone can help me with it, that'd be awesome! Thanks, Hristo
  18. Hi everyone, I posted some progress in another thread (Sidewalks - PathDeform? - Modeling - od|forum (odforce.net)). My VEX code for detecting intersecting geometry only seems to work on some parts of the model, whereas on others it does not seem to work at all. My idea for the code was to iterate over all points and fire a ray each up and down, to see if there is more than one intersection (it seems it generates always 1 intersection, for the self intersection), and if the point intersects with the geo, its added to a point group, so it can be fused at a later point. What could be the reason, that it only works on some parts of the model? vector RayDDown = {0,-100,0}; vector RayDUp= {0,100,0}; vector hitPos[]; int hitPrims[]; vector hitUVW[]; float tol = 0.00001; float ttol = 0.00001; int expand = 0; int stepping = 2; expand = expand * stepping; i@IntersectDown = intersect_all(0,@P, RayDDown, hitPos, hitPrims, hitUVW, tol, ttol); if (@IntersectDown > 1) { setpointgroup(0,"Intersecting", @ptnum-expand, 1, "set"); setpointgroup(0,"Intersecting", @ptnum, 1, "set"); setpointgroup(0,"Intersecting", @ptnum+expand, 1, "set"); } i@IntersectUp = intersect_all(0,@P, RayDUp, hitPos, hitPrims, hitUVW, tol, ttol); if (@IntersectUp >1) { setpointgroup(0,"Intersecting", @ptnum-expand, 1, "set"); setpointgroup(0,"Intersecting", @ptnum, 1, "set"); setpointgroup(0,"Intersecting", @ptnum+expand, 1, "set"); } I also included a screenshot illustrating the problem. Thanks in advance!
  19. Volumesampleindex returning 0

    Hi, I'm currently trying to implement a smoke volume that wraps around the X-axis. Essentially taking the values of the final voxels on the +X axis and applying them to -X. The VEX below should be doing what I want, but its returning zero every time. Am I missing something? I've tried deriving the voxel coordinate procedurally, as well as manually specifying a good known coordinate, and every time I get an empty result. Its driving me mad! float scratchpad = chf('scratchpad'); int far_voxel = floor(ch('../smokeobject1/sizex') / ch('../smokeobject1/divsize')); vector sample_pos = volumeindextopos(0, "density", set(far_voxel, @iy, @iz)); if(@ix == 0){ //f@density = 1.0; //f@density = volumeindex(0, "density", set(far_voxel, i@iy, i@iz)); //v@vel = volumeindex(0, "vel", set(far_voxel, i@iy, i@iz)); f@density = volumesample(0, "density", sample_pos); v@vel = volumesamplev(0, "vel", sample_pos); } The commented out lines are different methods I've tried with no success. So far I've tried using volumeindex to read the voxel values directly, and volumesample using a position derived from volumeindextopos. No dice Any ideas folks? (the attached image shows the current behavior using the wrangle VEX above. What should be happening is the density and velocity values on +X boundary should be being copied into the -X boundary voxels)
  20. Shift Array Vex

    How can I shift values in an array using a for loop? For example: [0,0,0,1,1,1]->[1,0,0,0,1,1] I would think that this code would work but it does not. Any help would be appreciated. for(int j = 0; j < 6; j++ ){ if(@new_tile_array[@new_prim_id] == 1){ break; } else{ int popped = pop(@new_tile_array); append(@new_tile_array,popped); } }
  21. POP Force Mass Remap

    Hello Everyone I noticed that many parameters have a "Use VEXpressions" checkbox and i try to understand them. In my example i would like to remap the mass of the pieces by VEX. Preferably using a Ramp! And all that inside the local VEX of the POP Force :-) So that there is a better distribution of pieces in Y. I can't make it work... should it?
  22. Hello, I'm trying to automate cogs rotation using vex and a formula I've found online. The basic scenario is the following : one cog 'parent' and one cog 'child'. The cog 'parent' is animated (simple animation on Y axis) and will drive the cog 'child' by the following formula : (cog 'parent') * (-cog 'parent' teeth / cog 'child' teeth) this is quite easy. In the example I provided I 'hardcoded' the teeth count but it is calculated procedurally in a larger setup. All my cogs are packed primitive so I used matrices to modify their rotation. The main problem is when I extract the rotation of the cog 'parent' to modify it, converting the matrix4 into a matrix3 then into a quaternion then into Euler then into degree, it looks like the angle in degree can't go beyond 360°. The rotation in degrees takes weird values. At the frame 87 the extracted rotation Y of the cog 'parent' is 89.5836 degrees but at the frame 88 it's -269.375 which is the same value of angle (90° = 270°) but since the cog 'child' is not symmetrical I can see 'jumping' and If I calculate velocity on top of that the vector between these two frames will be wrong. The value at the frame 88 should be 90.625 not -269.375. I feel like the conversion doesn't allow for value bigger than 360°. I feel like I'm missing on a small thing that can be easily fixed. Is there a solution ? I've tried putting a modulo 360 somewhere but that didn't change anything I've tried dealing only with matrices without converting them but that's out of my knowledge (multiplying the rotation matrices by the ratio driven/driving so (cog 'child' teeth / cog 'parent' teeth) . Thank you for your time, Stay safe. cogs_automation_problem.hiplc
  23. VEX points edge selection issue.

    Hi guys, I have a simple problem that i can't find robust solution for. Using VEX and pcopen, I can select the corner points on a box no problem. int cornerPointCloud = pcopen(0,"P",@P,1.1,100); if(pcnumfound(cornerPointCloud)>4) { setpointgroup(0, "bottomCornerPoints", @ptnum,1, "set"); } What I actually want is to be able to select the entire edge, like this. Any idea guys?
  24. Hello guys! I have a simple C++ code which should be used by VEX in Houdini. I need to access to geometry data in specific node from current frame till frame 1 in backward direction until certain condition is met. The problem is that this access cause a huge impact on runtime when using wetmap function in a point wrangle node! Here is the sample: #include <iostream> #include <VEX/VEX_VexOp.h> #include <OP/OP_Director.h> #include <GU/GU_Detail.h> #include <SOP/SOP_Node.h> #include <GEO/GEO_VolumeSampler.h> #include <GU/GU_PrimVolume.h> #include <GU/GU_SopResolver.h> #include <VM/VM_Math.h> #include <OP/OP_AutoLockInputs.h> template <VEX_Precision PREC> static void wetmap(int argc, void *argv[], void *) { VEXvec3<PREC> *resultCd = static_cast<VEXvec3<PREC>*>(argv[0]); const char *surfaceAddress = static_cast<const char *>(argv[1]); VEXvec3<PREC> *P = static_cast<VEXvec3<PREC>*>(argv[2]); VEXvec3<PREC> *Cd = static_cast<VEXvec3<PREC>*>(argv[3]); *resultCd = VEXvec3<PREC>{0, 1, 0}; SOP_Node *surfaceNode = OPgetDirector()->findSOPNode(surfaceAddress); exint currentFrame = CHgetFrameFromTime(CHgetEvalTime()); OP_Context context; VEXvec3<PREC> color{0, 0, 1}; if(surfaceNode != nullptr) { for (exint i = currentFrame; i > 0; --i) { context.setTime(CHgetTimeFromFrame(i)); GU_DetailHandle gd_handle = surfaceNode->getCookedGeoHandle(context); } } } void newVEXOp(void *) { using UT::Literal::operator""_sh; new VEX_VexOp("wetness@&VSVV"_sh, // Signature wetmap<VEX_32>, // Evaluator 32 wetmap<VEX_64> // Evaluator 64 ); } I also try to lock the referenced node input just like SOP node examples in HDK but it makes no difference! This is an image of use case: After couple of frames pointwrangle1 become slow to cook and I don't know why! Can anyone help me? Thanks in advance!
  25. VEX Array Functions

    Harder, Better, Faster, Stronger please! Looking for some voodoo to optimize these snippets... Find Unique Elements in One Array function int[] unique_elements (int arr[]) { int _arr[] = sort(arr); for (int i=0; i<len(_arr); i++) { while(_arr[i] == _arr[i+1]) pop(_arr,i); } return _arr; } Get Duped Elements in One Array function int[] duped_elements (int arr[]) { int _arr[] = sort(arr); int result[] = {}; int dupe; for (int i=0; i<len(_arr); i++) { while(_arr[i] == _arr[i+1]) { dupe = pop(_arr,i); } append(result, dupe); } return result; } Find Common Elements in Two Arrays function int[] common_elements (int arr1[]; int arr2[]) { int result[]; foreach (int i; unique_elements(arr1)) { foreach (int j; unique_elements(arr2)) { if (i==j) push(result,j); } } return result; } Find Different Elements in Two Arrays function int[] different_elements (int arr1[]; int arr2[]) { int result[]; int _arr1[] = unique_elements(arr1); int _arr2[] = unique_elements(arr2); foreach(int i; _arr1) { if(find(_arr2,i)<0) append(result,i); } foreach(int j; _arr2) { if(find(_arr1,j)<0) append(result,j); } return result; } Swap Arrays function int[] swap (int arr1[]; int arr2[]) { int temp[] = arr1; arr1 = arr2; arr2 = temp; return {1}; } Here's some of what I was using to test it... these are all based on arrays of integers but could be tweaked obviously for other types. i[]@arr1 = {3, 2, 15, 27, 1, 3}; i[]@arr2 = {3, 2, 3, 15, 41, 41, 1, 2, 2}; i[]@arr_comm = common_elements (@arr1, @arr2); i[]@arr_diff = different_elements (@arr1, @arr2); i[]@arr_uniq = unique_elements (@arr1); i[]@arr_dupe = duped_elements (@arr2);