Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Everything posted by DASD

  1. Normals Curve Flow

    I think it's in since H16 or so: https://www.sidefx.com/docs/houdini/vex/functions/primduv.html Is it possible to use this to get a direction along the curvature of a polygonal object and if so, can someone give an example (vex) code? Or am I thinking about this wrong?
  2. FBX pivot to unity

    It's not you, it's Unity. By default Unity uses centered pivot for gizmo position rather than the pivot baked into geometry. Long story short, your world-origin of an object will be the world-origin for that mesh in Unity, but you have to “Toggle Handle Position” from “Center” to “Pivot” in the editor, to use it. See https://docs.unity3d.com/Manual/PositioningGameObjects.html [docs.unity3d.com] “Gizmo handle position toggles”
  3. Thank you very much! So I am looking at something like this and trying to make sense of it: #define SUBD_BBOX(TYPE,VEC_SIZE) \ void subd_curve_bbox_general(const float t0; const float t1; const TYPE C0; const TYPE p0; const TYPE diff; const TYPE C1; TYPE boxmin; TYPE boxmax) \ { \ /* Start with endpoints */ \ TYPE v0 = subd_curve_evaluate_general(t0, C0, p0, diff, C1); \ boxmin = min(boxmin,v0); \ boxmax = max(boxmax,v0); \ TYPE v1 = subd_curve_evaluate_general(t1, C0, p0, diff, C1); \ boxmin = min(boxmin,v1); \ boxmax = max(boxmax,v1); \ for (int i = 0; i < VEC_SIZE; ++i) { \ subd_curve_bbox_between(t0, t1, C0[i], p0[i], diff[i], C1[i], boxmin[i], boxmax[i]); \ } \ } \ void subd_curve_bbox(const float t0; const float t1; const TYPE pn1; const TYPE p0; const TYPE p1; const TYPE p2; TYPE boxmin; TYPE boxmax) \ { \ TYPE diff = (p1-p0); /* Vector from p0 to p1 */ \ TYPE C0 = 0.5*(diff + (pn1-p0));/* Average of neighbours of p0, minus p0 */ \ TYPE C1 = 0.5*((p2-p1) - diff); /* Average of neighbours of p1, minus p1 */ \ subd_curve_bbox_general(t0, t1, C0, p0, diff, C1, boxmin, boxmax); \ } \ void subd_curve_bbox_first(const float t0; const float t1; const TYPE p0; const TYPE p1; const TYPE p2; TYPE boxmin; TYPE boxmax) \ { \ TYPE diff = (p1-p0); /* Vector from p0 to p1 */ \ TYPE C1 = 0.5*((p2-p1) - diff); /* Average of neighbours of p1, minus p1 */ \ subd_curve_bbox_general(t0, t1, (TYPE)0, p0, diff, C1, boxmin, boxmax); \ } \ void subd_curve_bbox_last(const float t0; const float t1; const TYPE pn1; const TYPE p0; const TYPE p1; TYPE boxmin; TYPE boxmax) \ { \ subd_curve_bbox_first(1-t1, 1-t0, p1, p0, pn1, boxmin, boxmax); \ } \ /*empty line at end of macro*/ SUBD_BBOX(vector2,2) SUBD_BBOX(vector,3) SUBD_BBOX(vector4,4) #undef SUBD_BBOX #define SUBD_BBOX(TYPE,VEC_SIZE) \ seems to define some kind of block named "SUBD_BBOX" the "\" at the end of each line seem to be part of the definition of that block - but I am not sure about what it does TYPE and VEC_SIZE are arbitrarily named variables/placeholders/whateverYouCallThose, which are substituted with the given permutations: SUBD_BBOX(vector2,2) SUBD_BBOX(vector,3) SUBD_BBOX(vector4,4) The block is then truly concluded with: #undef SUBD_BBOX Do I get this right? Another thing I would like to do is, to create variations where certain parameters are optional, because they have "default values". I guess I can do this with the -D Preprocessor option? Do you know where there might be an example for something like this? Is this even the right command?
  4. Hi, I making a small VEX code library and I was wondering if there are any good techniques to reduce the amount of code duplication. For example I have a function that works with or without inputs and with different variables. For simplified example: vector pointPos(const int pointid){ return point(0,"P",pointid); } vector pointPos(const int input; const int pointid){ return point(input,"P",pointid); } Could this be reduced to something like: vector pointPos(const int input = 0; const int pointid){ return point(input,"P",pointid); } Is there anything like auto type recognition, or decorators, or anything else (aside from structs) that has improved your vex code?
  5. Custom struct as attribute

    Thank you!
  6. Custom struct as attribute

    I have a custom struct in VEX (Houdini 16.5). It's nothing special, just a few simple values combined (no arrays). Is it possible to create an attribute out of a custom Struct in vex? Is it possible to do that for an array of custom structs? I guess it's something like: adddetailattrib(0,"name","myStruct"); adddetailattrib(0,"name","myStruct[]"); setdetailattrib(0,"name",myStructObject,"set"); These kinda seem to succeed in creating an attribute, but I don't seem to be able to add values to those. Also I would like to be able to use the @ syntax for quickly defining attributes for custom structs. (Something like: myStruct@myAttribute;) Is that possible? (Note that I can create variables, with code like: myStruct myVariable = myStruct(1,2,3); and myStruct myArrayVariable[]; But I specifically am interested in creating attributes on the geometry that would persist between wrangle nodes and especially be visible in the geometry spreadsheet.)
  7. - I cannot believe I missed that. Thank you very much!
  8. Hi, can somebody provide a quick example of functional vex wrangle code that uses the expandedgegroup() vex function? I expect something like: i[]@display = expandedgegroup("edgez"); But the issue is that the "edgez" group is a group of edges and there is no edge context in attribwrangle. I am guessing my syntax is wrong, or am I missing a preparation step of some sort?
  9. 1. How do you get UV density and UV distortion as a vertex attributes? 2. How would you get UV overlap as a vertex attribute? 3. How would you get UV direction (flipped UVs) as a vertex attribute? (I can think of ways to build this stuff, but I am looking for solutions that already exist. Packages like Maya give you this kind of information by default. I would imagine Houdini does too. )
  10. f1480187 thank you for the great file! I expanded on this topic in another thread: https://www.sidefx.com/forum/topic/43073/?page=1#post-231651
  11. 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?
  12. Thanks symek ! That syntax seems to be more up to date. Thank you f1480187 ! I also found that out that the preferences of Sublime text can be tweaked with: "hot_exit": false, "remember_open_files": false, so that sublime does not save the tabs from the previous session. Now the only thing left to do is to find a way to bypass the Houdini Editor. Anybody know how to get that fixed?
  13. Houdini Exhelp (Sublime)

    Also relevant to this thread:
  14. Houdini Exhelp (Sublime)

    This is great! - As far as I understand, when VEX gets an update these files will go out of date. Have you considered making the creation process of these files into a tutorial?
  15. What is it that you are trying to achieve? A procedural facade? What workflow do you seek to achieve? You will need to use stamping on the copy sop to put different models on different points. Keep in mind you can create arbitrary attributes with the attribute create SOP/ VOPs and manipulate those with VOPs.
  16. VDB maintain UVs

    Fascinating stuff! Thanks dijki! Personally I am more interested in the "simple" cases where I would use VDB to combine simple meshes and their UVs.
  17. VDB maintain UVs

    Thank you djiki! I am not sure I will be able to dive further into this today, but I think there is a way to do this better. With your method you still have a thin stretch of UVs that are completely distorted. Thy are like that, because what should be discrete UV shells are fused around the outlines. The solution is theoretically simple: 1. Make a decision to which original mesh the polygons on the new mesh are corresponding. For most polygons you would decide by proximity, but around borders you make a discrete decision based on input order of the original meshes. This could be implemented as a step by step loop in which each new transfer of attributes overrides the previous transfer in a discrete fashion. So the attribute transfer has to happen in two steps: First the identifier attribute is transferred interpolated by proximity. The result is a float value stored in a buffer attribute. Then the buffer is compared to the integer identifier value that was already on polygons. Polygons that have not received an identifier, yet, have an identifier of -1 (or something like that). Based on a certain threshold value and some basic logic, a new (integer) identifier value is decided upon for each polygon. (Repeat for all original meshes.) Polygons that have an identifier of -1 at the end of the process, could receive some form of default UVs, like an automatic unwrap later in the process. This might not be perfect, but this would ensure that we get an "integer" identifiers for each polygon. 2. Split the polygons based on their identifier attribute. 3. Transfer the UVs per shell (corresponding polygon shell to corresponding UV shell) 4. Fuse the polygon shells, but do not fuse UV shells. (This step seems trivial, but I am actually not sure how to do this step in Houdini.) The result should be UVs that have seams but acceptable levels of distortion, even at relatively low VDB sampling density. The identifier could then also be used to transfer material types and more.
  18. With distortion I mean how far the UV triangle shapes deviate from their 3D polygon shape. And with density I mean how small or large UV triangles are relative to each other (compensated for the original 3D polygon size). For an optimal unwrap distortion would be low and density variation would be low too.
  19. Bubble bath in Houdini?

    I would do it as you described. You'll probably need an attribinterpolate sop to make the points from the scatter stick to an animated surface. I would play around with using an ocean surface for the basic shape. And to interact with the character you will probably need to create an attribute transfer setup so some kind of bounding object changes bubble behavior in a region.
  20. VDB maintain UVs

    How would you prevent the UV shells from getting fused, so that you get an obvious seam, but no horrible distortion?
  21. I had the same problem and arrived at pretty much the same solution. I am also not satisfied with it. But in the hip file you posted, you have a giant bug. If I see this correctly (and didn't introduce the bug myself), instead of relaxing you merge the points. So you end up doubling your polygon count with each iteration of your procedure. It's the node called "relax2". iterativeShrinkWrap-D1.hiplc
  22. As far as I can tell from this code, it does not calculate anything. It rather extracts parameters that the dopnetwork already has.
  23. Curve on center of a tube

    I suppose you would have to average point positions by radius. Or in other words, use a fuse SOP. Alternatively you could also use a scatter SOP.
  24. plants wind dynamic pipeline

    I would look into how this is done in modern game engines. For one, each plant you scatter needs to have blend-shapes in all four directions. The deformation to those blend-shapes should be driven by parameters representing wind direction and intensity. Then you would create a "wind" in world-space and let it animate those parameters. - Or something like that.
  25. In Houdini 15 you could use the convert line SOP.