Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by f1480187

  1. VEXpression Presets

    I meant it's easy to copy "acos (dot(normalize(a), normalize(b)))" from the docs. My last best result in counting was "potato" before I run away. Here is what I typically use to get 0-360 degrees:
  2. VEXpression Presets

    @Noobini, you mean expression function vangle? No such function in VEX, afaik. You can see it is quite trivial to implement.
  3. smooth shaded through python

    @newbee you need Houdini >= 16.0 to use it. You can use hou.hscript() function from Python: '''Set geometry display mode for Houdini before version 16.0.''' import hou import toolutils mode = 'shade' display_set = 'display' # For display geometry inside SOP context. viewport = '%s.%s.world' % (hou.ui.curDesktop().name(), toolutils.sceneViewer().name()) command = 'viewdispset -s %s %s %s' % (mode, display_set, viewport) hou.hscript(command)
  4. Multiple edits in one edit node

    From docs:
  5. What primhedge function does ?

    You can use it to write neighbours() function analog for primitives: // Primitive wrangle. i[]@neighbours; int prim_edge = primhedge(0, @primnum); for (int i = 0; i < primvertexcount(0, @primnum); i++) { for (int j = 0; j < hedge_equivcount(0, prim_edge); j++) { int edge = hedge_nextequiv(0, prim_edge); int prim = hedge_prim(0, edge); if (prim != @primnum) { append(i[]@neighbours, prim); } prim_edge = edge; } prim_edge = hedge_next(0, prim_edge); } The code based on the example from @petz. We don't use half edge functions much, because all kinds of higher-level geometry functions like that are implemented in VEX already. Otherwise they would be everywhere. I prefer to think of them like a building blocks for functions like neighbour, primpoints, pointvertices, etc. Almost never used any of them, and searching through $HH/vex/ shows a little use too.
  6. How to extract goal of a spotlight in vex

    Your code does basic point lighting with lambert. You need to add cone functionality. Check example $HH/vex/Light/asad_light.vfl for different light parameters. Basic spot light support: // Point wrangle. string lobj = "/obj/hlight1"; vector l = ptransform(lobj, "space:current", {0, 0, 0}) - @P; vector lz = vtransform(lobj, "space:current", {0, 0, 1}); float coneangle = ch(lobj + "/coneangle"); float conedelta = ch(lobj + "/conedelta"); float rolloff = ch(lobj + "/coneroll"); float angle = cos(radians(coneangle/2)); float delta = cos(radians(coneangle/2 + conedelta)); float cone = smooth(min(angle, delta), max(angle, delta), dot(lz, normalize(l)), rolloff); float lambert = clamp(dot(@N, normalize(l)), 0, 1); @Cd = cone * lambert; Use integer casting to output hard mask: @Cd = length(@Cd) > 0; sop_spotlight.hipnc
  7. (SOLVED) Mirror in vops?

    The noise output also need to be mirrored, therefore additional mirroring step is required. To compute everything in different object space (for /obj/cam1, for example), wrap the code (vops) into couple of ptransforms. mirror_noise_camera_space.hipnc
  8. (SOLVED) Mirror in vops?

    Something like this: mirror_noise.hipnc
  9. Create new shelf tool and assign a shortcut to it. "Guides / Templated geometry" display option still not in HOM in Houdini 16.5 (it can be part of hou.GeometryViewportDisplaySet, I suppose). Use viewdisplay command. I didn't find a way to determine the option's state. Session can be is used to store it, but if templated geo were disabled initially, it will do nothing first time tool is used. Use this as the tool's Python script: import hou import toolutils # Toggle mechanism using session module. tgd = hou.session.__dict__.get('templated_geo_display', 'on') tgd = 'off' if tgd == 'on' else 'on' hou.session.templated_geo_display = tgd viewport = '%s.%s.world' % (hou.ui.curDesktop().name(), toolutils.sceneViewer().name()) command = 'viewdisplay -T %s %s' % (tgd, viewport) hou.hscript(command)
  10. [SOLVED]Can't Make VDB From Triangle Based Mesh?

    It's an open surface with no volume. You need watertight object. harness.hipnc
  11. Does anyone have a clue of origin of this popular design with grid, mountains and sunset? Different variants can be found on image search. Did it exist in 80's? Perhaps the mix of old and new? The Mattel Electronics toy catalog features the purple grid and some sort of sunrise, while Far Cry 3 Blood Dragon introduces wireframe landscape. I didn't find the stripped sun, though.
  12. edit parameter interface question

    Try: node = hou.node('/obj/sphere') # Copy parameter from object merge. path_parm = node.parm('object_merge1/objpath1') ptg = node.parmTemplateGroup() ptg.append(path_parm.parmTemplate()) node.setParmTemplateGroup(ptg) # Copy value to promoted parameter. promoted_parm = node.parm('objpath1') promoted_parm.set(path_parm.eval()) # Set parameter reference. path_parm.set(promoted_parm)
  13. @numpt vs npoints (VEX vs Hscript)

    You can use @opinput1_numpt for second input's @numpt.
  14. Distortion VEX Question...?

    You need to set Displacement Bounds enough to encompass shape change: Maximum Displacement doesn't seem to affect anything for me. Probably it limits maximum distance. I left it at default 1.0. It is linked to Displacement Bounds for user convenience, so, when you set it to zero, bounds will be set to zero too, producing clipping artifacts. You can remove expression from bounds parameter (using Ctrl+Shift+LMB or parameter menu). I drive displacement height using Multiply Constant node in the example. As I said, some bug prevents displacement to update on my build. So, if you change constant value, shape stays still. If I "touch" Displacement Bounds parameter: change it from 0.2 to 0.25 (both are more than enough for this case), it will recompute geometry.
  15. Distortion VEX Question...?

    If you want to use Vector Displacement, switch Signature parameter to output 3D vector noise. It should be used with vector displacement. vdisp.hipnc If you convert float to vector, it will be copied to all three vector components resulting in weird diagonal displacement. If you don't really need vector displacement, use float disp input instead of vector vdisp. This will displace along normal using input as height. Displacement feels broken on 16.5.268. It does not updates inputs correctly, even on Mantra restart. Oddly enough, changing displacement bounds to slightly different values force Mantra to update inputs. Probably, I should try update to daily build.
  16. Fit range confusion

    This will reverse output. In this case, where range 0..1 will output 0, range 1..0 will output 1: src [-5, 0]: -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 dest [0, 1]: 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 src [-5, 0]: -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 dest [1, 0]: 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 Not necessary to swap destination min and max if the source min is negative, the instructor probably had some reason to invert the range (better logic, later convenience, etc.). Try visualize the value.
  17. How to get live op data from channel expression

    This should work, maybe something different is broken in your scene, otherwise it may be a bug. There is also VEX function equivalent with same name exist: chs()
  18. Promote Ramp parameter via python

    Open Operator Type Properties window, then select Export Parameter to Type Properties in ramp's parameter context menu. Is it what you are looking for?
  19. Happy 10th Birthday Od[force]

    Wow, congratulations (still not quite late)! Oddly enough, the community is fresh. Always plenty of new users learning and working on state of the art proceduralism. Keep going!
  20. Quadruped Edge Seams For Best UV Unwrap?

    Something like this. I would probably cut limbs and head by edge loops out of the main body, so, limbs can fill space, and the head can be scaled up to use more detailed texel, if needed.
  21. H16.5 Smooth UVs in boundary edges

    Didn't know it was changed. Works fine for point uvs. Vertex Split by uv with promote > Subdivide > Promote back to vertex > copy in Vertex Wrangle. subdivide_uvs.hipnc
  22. Space Suit

    I see the work of tasteful design with timeless CGI look there.
  23. reset to origin.

    It is very easy to select points manually here, and hard enough to do it procedurally, due to different topology and shape. Still possible, though. Tried @satoru's hack from this thread: pieces_to_origin_hack.hipnc
  24. reset to origin.

    Same. I can't use packed alembic primitive (saved in bgeo or locked, no difference here on my Houdini 16.5.268) if I have no file on disk at the same time. Well, it makes a bit of sense, though proper embedding is really expected by everyone, IMO. You can upload file or drop Convert node and lock usual Houdini polygons.