Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

8 Neutral

About DASD

  • Rank

Personal Information

  • Name

Recent Profile Visitors

2,394 profile views
  1. 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?
  2. 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?
  3. Custom struct as attribute

    Thank you!
  4. 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.)
  5. - I cannot believe I missed that. Thank you very much!
  6. 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?
  7. 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
  8. 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?
  9. Houdini Exhelp (Sublime)

    Also relevant to this thread:
  10. 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?
  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. 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.
  13. 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.
  14. 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.
  15. 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.