We decided not to spend the time making a user friendly toolset for creating custom node shapes with H16. We knew there would be a lot of excitement about doing this, but for a variety of reasons we are not claiming to “officially” support custom node shapes (in other words if you read the rest of this thread, try it, and have trouble, don't contact support… it will have to be a “community effort” on this forum). So with those caveats, here's a description of the node shape file format I posted to the Houdini 16 alpha forum…
I'm sure you'll all figure it out eventually anyway, so I might as well save you some time. Here is the unofficial annotated guide to the Houdini node shape file format. The contents are the “squared.json” file from $HFS/houdini/config/NodeShapes. Any .json file you put in config/NodeShapes in your HOUDINI_PATH will be loaded as a shape. You may want to keep the “center” of your shape around (0.5, 0.15). It might be okay if you don't, but no promises. Similarly, you're on your own if you make really big or really small shapes.
{
# The "name" is the value that you must set in the "NodeShape" user data
# on a node to make it use this shape. Generally we match this "name" to
# the JSON file name, but this is not required. If a duplicate name is found,
# the one found last in the HOUDINI_PATH will "win".
"name": "squared",
# The outline of the actual node body.
# Note that there is nothing that requires the flags to line up in any
# way with the node body.
# Anywhere you see "outline", there should be an array of two-value
# arrays representing point positions.
"outline": [
[
0,
0.3
],
[
1,
0.3
],
[
1,
0
],
[
0,
0
]
],
# Simply polygon definitions for the flag indicators. The assignment of
# specific flags (display, render, etc) to the generic "0", "1", "2" flag
# slots is done by the files in $HH/config/NodeShapeFlags. This separation
# allows the same node shape to be used in any node context.
"flags": {
"0": {
# Note that there is nothing requiring these flag outlines to line up
# with the node body outline (though in our default set of shapes we
# have chosen to make them line up).
"outline": [
[
0.1108,
0
],
[
0,
0
],
[
0,
0.3
],
[
0.1492,
0.3
]
]
},
"1": {
"outline": [
[
0.2519,
0
],
[
0.1108,
0
],
[
0.1492,
0.3
],
[
0.2894,
0.3
]
]
},
"2": {
"outline": [
[
0.8508,
0
],
[
0.7108,
0
],
[
0.7492,
0.3
],
[
0.8892,
0.3
]
]
},
"3": {
"outline": [
[
1,
0
],
[
0.8508,
0
],
[
0.8892,
0.3
],
[
1,
0.3
]
]
}
},
# The "inputs" and "outputs" arrays define paths. The connectors in and
# out of the node are spaced even along this path (or the path itself is
# drawn in the case of nodes like Merge).
# Each entry in the path has three values. The first two values are the
# position, the third value indicates the tangent direction for wires
# (expressed as degrees counter-clockwise from 3 o'clock).
# Points on this path shouldn't be placed too close together. There is
# code to guard against this when loading the shape, but our default
# shapes are all "well behaved" in this regard so the code to guard
# against tightly packed points may not work perfectly. YMMV.
"inputs": [
[
0.095,
0.385,
90
],
[
0.365,
0.385,
90
],
[
0.635,
0.385,
90
],
[
0.9051,
0.385,
90
]
],
"outputs": [
[
0.095,
-0.085,
270
],
[
0.365,
-0.085,
270
],
[
0.635,
-0.085,
270
],
[
0.9051,
-0.085,
270
]
],
# Two points for the lower left and upper right corners of where the node
# icon should appear.
"icon": [
[
0.38,
0.03
],
[
0.62,
0.27
]
]
}