Jump to content

fsimerey

Members
  • Content count

    82
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fsimerey

  1. Question with 'vertexindex' functioin

    I think you misunderstand what is a vertex. See the documentation here : https://www.sidefx.com/docs/houdini/model/attributes.html#geometry-components You can display the vertex number in the display option panel.
  2. Creating alias on command line [linux]

    You must source houdini_setup, then launch houdini. houdini_run () { MAJ=17.0 MIN=352 # edit these to suit your environment HOUDINI_ROOT="/opt/hfs${MAJ}.${MIN}" cd ${HOUDINI_ROOT} source houdini_setup # launch houdini houdini $@ }
  3. VEX: get attribute values into an array

    Do you run this wrangle in Detail Mode ? I'm pretty sure not if you can access to the @ptnum variable...
  4. Randomize point selection pattern

    @group_targetPoints = 1; int delta = 2; i@modulo = 10 + int(ceil(delta * fit01(rand(@ptnum + 354656), -1, 1))); if(@ptnum%@modulo) { i@group_targetPoints = 0; } I use delta to add or subtract the module 10. Here 10 +- a random between -2 to +2. I think it's not the good way. This approach seems better: @group_targetPoints = 0; int delta = chi("delta"); i@modulo = int(ceil(delta * fit01(rand(@ptnum + 356156), -1, 1))); if(@ptnum%30 == 0) { setpointgroup(0,"targetPoints", @ptnum + @modulo, 1); } Here for each modulo of 30, i setup in group another point near the point number.
  5. Remove Primitive by Sphere

    https://www.sidefx.com/docs/houdini16.0/vex/functions/removeprim
  6. VEX Modulo Operation giving incorrect results

    I think it's a problem of precision. Transform in integer avoid this precision. It's why round the offset must works too.
  7. VEX Modulo Operation giving incorrect results

    I would round the offset value before modulo operation OR multiply the offset and transform to integer like this: int(offset*10)%4
  8. Blend parameter doesn't work with point attributes?

    You can easily use an Attribute Wrangle:
  9. VEX code won't work as expected

    It's because @numpt is an integer in the division. Use the function float() to convert integer to float. f@ramp = @ptnum / float(@numpt); But if you want a full ramp from 0 to 1 use this expression f@ramp = @ptnum / float(@numpt - 1);
  10. String parsing in Font SOP

  11. String parsing in Font SOP

    Ok, i see. A python sop could be simple to count lines.
  12. String parsing in Font SOP

    Indeed, i misunderstood your question. Strange approach, on my side, i would make an integer parameter on my sop/hda/null, then put it in font sop and duplicate node. How do you access to text field to enter your number ?
  13. String parsing in Font SOP

    `chs("../duplicate1/ncy")` Be careful of back-ticks, needed to evaluate the expression. An easy way is to a right-click on channel you want to copy and paste into the text field of Font SOP.
  14. https://atom.io/packages/language-vex
  15. rotate with vex around axis next to the object

    And you can do more. Rotate along the vector defined by 2 specific points in full 3d: // Points to define vector axis and center vector P0 = point(0, "P", chi("p0_axis")); vector P1 = point(0, "P", chi("p1_axis")); vector axis = normalize(P1 - P0); vector center = P1 - (P1 - P0) / 2; // offset to center vector _P = @P - center; float ang = chf('angle'); vector4 q = quaternion(radians(ang), axis); // rotate P and N @P = qrotate(q, _P); @N = normalize(qrotate(q, @N)); // replace to origin @P += center;
  16. Try this in wrangle Primitive node: i[]@arr = {-1,0,1}; // Create an array with values i@arr[1] = @primnum; // Set primnum in array[1] This create and set value of an integer array.
  17. Hello, i have a bad geometry with some vertex with -nan value in @N. @N is a 32 bits float vector attribute, but -nan is equal or not equal of which value ?
  18. How identify vertex's normal with '-nan' value ?

    It's exactly what i was looking for. Thanks f1480187
  19. How identify vertex's normal with '-nan' value ?

    Ok, i found a solution to solve my problem, but it's not by identify -nan value. The bad primitives have an intrinsic:measuredarea equal to -nan too. So i keep only primitive with an area > 0.0001
  20. http://www.sidefx.com/docs/houdini15.5/hom/hou/Node#type With name() method, you can get the type of your node: hou.node('my_node').type().name() will return 'merge' if this node is a merge sop node.
  21. 3 decimal of a float value in VEX or VOP

    Like your solution but the round result is not accurate. Try it with 3 decimals and 0.9996 Your solution result with 0.999 when the accurate must give 1.000
  22. 3 decimal of a float value in VEX or VOP

    float a = 179.9996; string trunc = itoa(int(trunc(a))); int ifrac = int(rint(frac(a)*1000)); string frac = "000"; if (ifrac == 1000) { trunc = itoa(int(trunc(a)) +1); } else { frac = sprintf("%03d", ifrac); } s@result = trunc + "." + frac; Here the solution for string.
  23. 3 decimal of a float value in VEX or VOP

    f@y = rint(@P.y * 1000) / 1000; If you want 3 decimal for a string, with zero on decimal, you must extract fraction and decimal, then concatenate those in string.
  24. Need help with simple VEX function

    float gravity = pow(@Time, 2); if (@Time > ch("limit")) { float increment = pow(ch("limit"), 2) - pow(ch("limit") - @TimeInc, 2); gravity = pow(ch("limit"), 2) + increment * ((@Frame - ch("limit") / @TimeInc) - 1); } @P.y += -9.8 * gravity; Here an example. The limit is a time value in seconds. Don't forget to click on the white button on the right of the editor area to spare parameter.
  25. Need help with simple VEX function

    Use the good attributes see here http://www.sidefx.com/docs/houdini15.5/vex/snippets#attributes For your case the good expression is this: @P.y = @P.y + 9.8 * pow(@Time, 2); and you can simplify with: @P.y += 9.8 * pow(@Time, 2); But if you want a gravity effect, subtract is the better way
×