Jump to content

f1480187

Members
  • Content count

    613
  • Joined

  • Last visited

  • Days Won

    38

f1480187 last won the day on September 14

f1480187 had the most liked content!

Community Reputation

454 Excellent

About f1480187

  • Rank
    Houdini Master

Personal Information

  • Name
    F1

Recent Profile Visitors

2,430 profile views
  1. Debug stuff with visualizers. Attribute Transfer didn't work with vertices, for some reason. Since result must be the same for points, you can use point attribute and promote it to vertices later. offscale must not be zero, otherwise offset won't be scaled. Use very small values like 1e-5. Same thing applies for offset itself: if it is zero, Houdini will "conveniently" refuse to bevel. Hex_to_Tri_Grid_fix.hipnc
  2. I dissect promising scenes, try to solve interesting questions and share results, if any. If it appears working, try to do the same.
  3. Hexagrid can be created by beveling triangle grid. You can use that fact to blend between same topologies. blend_grids.hipnc
  4. Activation expression

    There is parentheses mismatch resulting in syntax error. After fix, it should work as described.
  5. no new menus after fresh install

    I would check if the plugin version is too old for new Houdini. In houdini.env file add: HOUDINI_DSO_ERROR = 1 In case some plugin is too old, you will get startup error like this: --------------------------- Houdini DSO Error --------------------------- (127) Couldn't load some_plugin_name.dll. This is probably because this file was intended for use with a different version of Houdini. --------------------------- OK ---------------------------
  6. Rendering Normal Maps?

    Mantra's TS should be very close to MikkTSpace, with small artifacts on UV seams (if they weren't fixed in the last year). Normal maps baked in Mantra should look correct, with possible channel reversing. Houdini is +X right, +Y up, -Z forward; UE4: +X forward, +Y right, +Z up, also it is depends on baking material. Make sure texture node inside UE4 material has Sampler set to Normal Map. If it wasn't automatically set, there are chances that texture wasn't imported and compressed as a normal map too: check asset settings and compare with normal maps from Starter Content. When everything is correct, NM will look very nice, smooth and seamless. If it looks "moderately good" and shading reveals very distinct seams, probably, the NM still not set correctly or it was baked with very different tangent space.
  7. Help with breaking down an HScript expression

    It's very simple, just a bunch of parameter references, mostly. Something close to "project_path/cache/some_node1/v01/path_42/cluster_666/some_node1_p42_c666_v01.0001.bgeo.sc". You can evaluate string by pressing MMB on the parameter's label. If the result is still too complex to understand, create new string parameter via Edit Parameter Interface, then copy different parts of this expression (e.g `padzero(2, ch("ver"))`), and evaluate them one-by-one until it's clear what it is doing.
  8. Execute string in Python ?

    Don't add extra quotes.
  9. Execute string in Python ?

    Try this: hou.parm('/obj/test3_FBX/materials/Google_Hybrid___7/Google_Hybrid___7_surface/map1').eval() There are many ways to get and set parms in HOM. Here is some of them: >>> hou.evalParm('/mat/principledshader1/basecolor_texture') 'C:/PROGRA~1/SIDEEF~1/HOUDIN~1.705/houdini/pic/texture/rocks001_basecolor.rat' >>> hou.parm('/mat/principledshader1/basecolor_texture').set('C:/some/path/to/file.jpg') >>> hou.evalParm('/mat/principledshader1/basecolor_texture') 'C:/some/path/to/file.jpg' >>> p = hou.parm('/mat/principledshader1/basecolor_texture') >>> p.eval() 'C:/some/path/to/file.jpg' >>> p.set('C:/some/other/path.exr') >>> p.eval() 'C:/some/other/path.exr' >>> node = hou.node('/mat/principledshader1') >>> p = node.parm('basecolor_texture') >>> p.eval() 'C:/some/other/path.exr' >>> p.set('Mandril.pic') >>> p.eval() 'Mandril.pic'
  10. @numpt vs npoints (VEX vs Hscript)

    @r-a-n-d-o-m, I think it's just silently throwing away invalid tokens ("@ptnum" and "=") and reading this group like: "0 `chs("../line3/points")-1`". "0 `npoints(0)-1`" is almost same, but slightly more general, so I would stick to it. Also, chs() will return string, for numbers better use ch().
  11. @numpt vs npoints (VEX vs Hscript)

    From my personal understanding: 1. HScript is a shell-like language, the old scripting core of Houdini, mostly replaced with Python this days. Example: # Node geometryvopglobal1 (Vop/geometryvopglobal) opadd -n geometryvopglobal geometryvopglobal1 oplocate -x 1.90579 -y 1.97631 geometryvopglobal1 opspareds "" geometryvopglobal1 opparm geometryvopglobal1 chlock geometryvopglobal1 -* chautoscope geometryvopglobal1 -* opset -d on -r on -h off -f off -y off -t off -l off -s off -u off -e on -b off -L off -M off -H on geometryvopglobal1 opexprlanguage -s hscript geometryvopglobal1 Scripts typically look like sequences of commands. We still may find such scripts in old shelf tools, menu scripts, etc. Summarizing: npoints(): unavailable. Expression function can be used inside backticks. @numpt: unavailable. Where to use: in scripts and shelf tools, but better use HOM. 2. HScript Expressions is a special part of HScript used inside `backticks` to substitute contents with result of some computation. In parameter fields we use them without backticks (assumed that everything is expression), in string parameter fields we need to use backticks to evaluate contents and substitute with resulting values. # Typical expression. if(npoints(0)==0, $F, $FEND - $F) # Typical string. $HIP/render/explosion_`$F-1`.png # We can use "vex-like" @Frame instead of $F. # There is no "vex-like" equivalent for $FEND. if(npoints(0)==0, @Frame, $FEND - @Frame) When we type "@foo" in parameter field, we don't use VEX. It's like an alternate way to access something stored in "$FOO". It is not guaranteed to work for every variable that can be accessed with dollar sign. Example: before H16 Group SOP stored number of input points in variable $NPT. After @-syntax was introduced in H15, we expected logical "vex-like" equivalent with same meaning to exist: @numpt. There is no such variable, however. The feature still not implemented fully, and pretty much undocumented. New Group SOP node dropped the local var. npoints() is an expression function we can use anywhere in parameters. This is what we can use in new Group SOP to get number of input points. It accepts string path. It specially treats numbers provided as arguments (by automatically calling "opinputpath(".", number)" I guess). There is many expression functions which has no such convenient handling and will fail if we provide just 0 to them. opinputpath(".", 0) can be used instead. Expressions are widely used in Houdini. They have nice and compact syntax convenient to use inside parameters. Python is used too, but for more advanced tasks. Summarizing: npoints(): available as expression function. @numpt: unavailable. Other vex-like implicit variables may work, e.g. @Frame. $NPT: available as local variables defined on some old nodes. Where to use: in numeric parameters, in string parameters inside backticks. 3. VEX is a C-like programming language for shading and geometry processing tasks. Typical VEX program defines some context function operating over inputs and writing (exporting) some results. Sample VEX program defining SOP context function: sop restpos(export vector rest={0,0,0}) { rest = P; } There is no "@numpt"-like syntax in VEX. If we need to access some attribute, we need to use functions like attrib(). We need to compute non-attribute variable like @numpt using corresponding VEX function npoints(). Summarizing: npoints(): available as VEX function. @numpt: unavailable. Where to use: in standalone .vfl and .h files. 4. Wrangles, Snippets, VEXpressions . It is VEX extended with extra features, implemented via Snippet VOP and Attribute VOP SOP. @-style attribute bindings is one of them. Also, as we type the code inside string parameter, we can also incorporate some HScript Expressions using backticks. Typical Wrangle: @rest = @P; This will be wrapped into CVEX context function and expanded into normal VEX program automatically: void wrangle(vector rest; vector P) { rest = P; } cvex f(export vector rest={0,0,0}; export vector P={0,0,0}) { wrangle(rest, P); } @numpt is an implicit variable defined in Attribute VOP SOP and containing number of points of first input. Whenever you use VEXpressions (Snippet VOP, Wrangle SOPs, Attribute Expression SOP, Group Expression SOP, etc.), you can use @numpt. npoints() VEX function is also available, obviously. Summarizing: npoints(): available as VEX function. Also, expression function can be used inside backticks. @numpt: available. Where to use: in VEXpression parameters. 5. Grouping patterns mini-language. Specifically, an ad-hoc groups where @ also used for attribute access. You can pass a string like "@P.x<0.5" to the group parameter in many nodes, or as group argument in VEX functions. It will be processed by Houdini automatically. As we enter the group parameter string, we can use HScript Expressions inside backticks. Summarizing: npoints(): unavailable. Expression function can be used inside backticks. @numpt: unavailable. Where to use: in group parameters, in group string arguments in VEX.
  12. Gradient ramp along Y-axis in shader

    You could make relative height gradient (in 0..1 range) like this.
  13. U coordinate on closed prim

    @galagast, thanks! I updated my own snippet with closure check to work like yours. Here is what I got: // Detail wrangle. float length = primintrinsic(0, "measuredperimeter", 0); // Set to false if value of 1.0 is unwanted for the last point // of closed prims and instead need to be treated as if point with // u=1 is coincident with the first point (like in unrolled prims). int as_open = true; // Compensate for closing auto-edge length. if (as_open && primintrinsic(0, "closed", 0)) { vector auto_edge = point(0, "P", 0) - point(0, "P", @numpt-1); length -= length(auto_edge); } // Compute curve u. float passed = 0; for (int i = 1; i < @numpt; i++) { vector d = point(0, "P", i) - point(0, "P", i-1); passed += length(d); setpointattrib(0, "u", i, passed/length); } Difference between behaviors "as open" and "as unrolled":
  14. Creating VEX libraries

    There is "Force Compile" button on Attribute VOP. If you include the header in wrangle, you could unlock node and promote the button via Edit Parameter Interface / From nodes.
  15. Merge edit sops?

    <?xml version="1.0" encoding="UTF-8"?> <shelfDocument> <tool name="delta_edit" label="Delta Edit" icon="SOP_edit"> <helpText> <![CDATA[ #type: tool #icon: SOP/edit = Delta Edit = """Create Edit SOP from difference between two SOPs.""" ]]> </helpText> <script scriptType="python"> <![CDATA[ def safe_name(network, name): ''' Append a digit to the name making it unique within the network. Depends on existing nodes inside the network. E.g. if the network contains edit1, edit5 and edit6 nodes, 'edit7' will be returned, ignoring vacant numbers between edit1 and edit5, the way Houdini does it. ''' digits = [n.digitsInName() for n in network.glob(name + '*')] return '{}{}'.format(name, max([0] + digits) + 1) def delta_edit(selected_nodes): '''Create Edit SOP from difference between two SOPs.''' nodes = [x.name() for x in selected_nodes if isinstance(x, hou.SopNode)] if len(nodes) != 2: return network = selected_nodes[0].parent() name = safe_name(network, 'delta') script = 'cd {}; sopcreateedit {} {} {}'.format(network.path(), name, *nodes) hou.hscript(script) delta_edit(hou.selectedNodes()) ]]> </script> </tool> </shelfDocument> I made a shelf tool wrapping this command. Usage: Select "from this state" node, shift-select "into this state" node, click the tool. Origin and target nodes should share topology. Installation: Save to $(HIP|JOB|HOUDINI_USER_PREF_DIR)/toolbar/delta_edit.shelf Launch Houdini Right-click on empty place in shelf tab, select "Edit Shelf Tab..." Find "Delta Edit" in the long list of tools, hightlight it Accept
×