Houdini 20.5 Nodes Geometry nodes

Metaball geometry node

Creates metaballs and meta-superquadric surfaces.

On this page

This node creates metaballs and metasurfaces. If you click and drag the mouse on the Construction Plane, it generates a metaball whose X radius is specified by your drag. Metasurfaces are generalized metaballs meaning that they aren’t necessarily ellipsoidal.

Introduction

Metaballs provide a method for creating an organic-looking surface. The metaballs are blobs (“fields”) of “density” floating in space. Houdini skins a surface around areas where the density is greater than some threshold.

When two metaballs overlap, Houdini adds their field effects together. Because the density of the force field can be increased by the proximity of other metaball force fields, metaballs have the unique property that they change their shape to adapt and fuse with surrounding metaballs. This makes them very effective for modeling organic surfaces.

You can specify negative Weights to create “pusher” metaballs. This lets you create holes in the surface by effectively subtracting density.

The field is controlled by a kernel function and a weight. The kernel function controls the gradient of the density value of a metaball field from 1 (at the center) to 0 (at its outside edge). The weight scales the density to shift the location of the surface closer or further away from the center. You can currently specify the shape of the field as an ellipsoid or a super-quadric.

Placing Metaballs

To...Do this

Place the metaball anywhere in the scene

  1. Click the Metaball tool on the Create tab.

  2. Move the cursor into the scene view.

    Note

    You can hold Alt to detach the metaball from the construction plane.

  3. Click to place the metaball anywhere in the scene view.

    If you press Enter without clicking, Houdini places the metaball at the origin.

Place the metaball at the origin

Press ⌃ Ctrl + on the Metaball tool on the shelf.

If you are at the geometry level or have an object selected and you create a metaball, it will go into the selected object. If you are at the scene level and create a metaball, the viewer and the network editor will switch to the geometry level of the selected object. This unique feature allows you to merge multiple metaballs together automatically by creating them sequentially and close together.

Note

Metaballs can be moved once they are placed by either dragging them in the scene view or changing the values in the parameter editor.

Metaball Handles

There are special handles available at the geometry level for the Metaball object that allow you to stretch and squash it.

  1. Move to the geometry level by double clicking the metaball node in the network editor or by clicking the Jump to Operator button on the operation controls toolbar.

  2. Drag the handles to squash or stretch the metaball.

To...Do this

Stretch or squash the metaball along the x-axis

Drag the red handle.

Stretch or squash the metaball along the y-axis

Drag the green handle.

Stretch or squash the metaball along the z-axis

Drag the blue handle.

How to

To...Do this

Make metaballs interact with each other

Merge the nodes together with a Merge operator.

Create a large number of metaballs easily

Create a single metaball and copy it onto the points of another piece of geometry with the Copy operator.

Copying metaballs onto the points of a particle system is a good way to achieve various volumetric visual effects.

Speed up the display of metaballs

  1. In the viewport options menu, choose Display ▸ Display Options, or press D to bring up the Display Options window.

  2. Click the Geometry tab and lower the Level Of Detail setting to get faster but rougher representations of geometry in the viewer, including metaballs.

Convert metaballs to other geometry types

Use the Convert tool.

Super-quadratic field shapes

Instead of the regular ellipsoid field shape, you can increase or decrease the XY and Z exponent parameters to create “star-ish” (exponent > 1) or “square-ish” (exponent < 1).

A metaball is known as a super-quadratic if either exponent is not equal to one.

How metaballs work

Each metaball has a “sphere of influence”. When you merge two metaballs and they extend into each other’s sphere of influence, they react in a way similar to drops of water: the surface tension works to form a smooth bridge between them. This is useful for making organic “blobby” shapes which meld into each other.

Metaballs can be thought of as spherical force fields whose surface is an implicit function defined at any point where the density of the force field equals a certain threshold. Because the density of the force field can be increased by the proximity of other metaball force fields, metaballs have the unique property that they change their shape to adapt and fuse with surrounding metaballs. This makes them very effective for modeling organic surfaces. For example, below we have a metaball. The surface of the metaball exists whenever the density of the metaball’s field reaches a certain threshold:

When two or more metaball force fields are combined, as in the illustration below, the resulting density of the force fields is added, and the surface extends to include that area where the force fields intersect and create density values with a value of one. For more information on Metaballs, see the Geometry Types section.

You can see a metaball’s sphere of influence by turning on Display primitive hulls in the Display options toolbar.

This node is ideal for creating organic models, liquid effects and other blobby surfaces.

Tips

Level of detail

You can change the level of detail of the metaball and NURBS display by adjusting the Level of Detail parameter in display options.

Better metaball shading

Accurate metaball normals will be computed if the normal attribute exists when conversion to polygons is done. Thus, to get improved shading on polygonized metaballs, it’s a good idea to add the normal attribute (i.e. use a Facet SOP) before converting the metaballs.

Using metaballs to prune L-system copying

This is typically done by copying metaballs to every point of the deforming a polygonal/mesh input source with a Copy SOP. When doing this, it is a good idea to pass any deforming geometry through a Facet SOP and Consolidate Points to minimize the number of points you need to copy to. If converting from spline surfaces, you may want to refine your surfaces first to get a smooth distribution of metaballs.

If you are using metaballs to create a deforming attractor for the Particle SOP, you may want to use a Group SOP to define a bounding area, and copy the metaballs only to the points included in that group. This makes it much easier to control and animate the attractor area.

Meta Expressions

Metaball expressions are user-specified attributes that determine how metaballs are to be merged. To use Meta Expressions, merge all your metaballs with groups. You can reference metaballs as groups or primitive numbers. Then, use an Attribute Create SOP to build a string detail called metaExpression.

Note

The attribute must be called metaExpression.

Then, in a string field, type your expression to control how the metaballs merge together. These expressions can be built using a combination of quoted group names, unquoted primitive numbers, and the operations min, max, and sum. An example of a valid expression is

where group1, group2, group3 and group4 are the names of groups, and 0 and 1 are the primitive numbers of metaballs. The min, max, and sum operations can take an arbitrary number of arguments and support nested expressions such as sum(max(...), ...). Arguments to min, max, or sum are separated by commas. Providing a quoted group name is equivalent to simply adding each metaball primitive from that group to the current argument list. For example, if group1 contains metaballs with primitive numbers 0, 1 and 2, then the expression

max("group1")

is equivalent to

max(0, 1, 2)

Duplicate argument names are also supported by this expression. For example, if a metaball with primitive number 0 is defined, then specifying the expression sum(0, 0) is equivalent to merging two distinct metaballs at the same location as metaball 0.

Sum

Max

Min

This expression can be set by creating a detail/string attribute with the desired expression on any geometry containing metaballs. This functionality is also partially exposed via the MetaGroups SOP. This SOP allows users to easily generate expressions of the form

max(sum(...), sum(...), ..., sum(...))

by establishing a set of Metaball groupings. Each of these groupings consists of a list of group names, separated by spaces. For example, if two metaball groupings are defined by the SOP, one as 'group1 group2', and the other as 'group3 group4', then the SOP generates a Metaball expression equivalent to

max(sum("group1", "group2"), sum("group3", "group4"))

Tip

You can increase the Level of Detail on the Viewport tab of the Display Options to increase the accuracy at the cost of viewport performance and memory consumption.

Advanced

When generating blobby primitives in RIB, the string parameters were hard-coded to an empty list. SOHO will now search for a detail attribute named RiBlobby_Strings (case sensitive). This value of this string will be parsed using the syntax described in the Python function shlex.split(). The resulting list of strings will be output in the RiBlobby() call.

Parameters

Mode

How to interpret the parameters used to specify the metaball.

Field Radius

Treat Radius as a scale on the density field. The threshold surface is then a function of this Radius, Weight and Kernel Function.

Threshold Radius

Treat Radius as specifying the radius of the 1.0 threshold surface for this isolated metaball, and compute the corresponding scale on the density field given this Radius, Weight and Kernel Function. Changing the Weight in this mode will not change the isolated threshold surface of this metaball.

Radius

X radius of a metaball that is placed if you click on the Construction Plane without dragging. If you click and drag, the size of the metaball is over-ridden by the amount of drag. Entering non-equal values in the xyz fields results in ellipsoidal shapes.

The X radius is defined by the distance dragged from the center, while the Y and Z radii vary proportionally with the X / Y and X / Z ratios in the parameter dialog.

Center

Center of the metaball. This value is updated whenever you click (and drag) to create a metaball. A new metaball will be positioned here if you type Enter.

Rotate

Rotation about the center of the metaball.

Weight

How much “pull” the metaball has on surrounding metaballs, causing them to merge together.

Kernel Function

Blinn

Always puts a sphere at the blob center, even if the weight is less than 1.0. The fastest and most stable of all the models.

Wyvill

The Wyvill and Elendt models are very similar. Only the weight distribution function is different.

Elendt

The fastest method, but the simplest approximation, so it may not be as smooth as other functions in terms of weight distribution.

Links

A piecewise polynomial.

1 - 3*t*t,  t < 1/3                                                          
1.5 * (1 - t)^2, t < 1                                               

RenderMan

Used by Pixar’s RenderMan (and possibly other RIB renderers). Defined as

Density = 1 - 3*R^2 + 3*R^4 - R^6

Hart

A kernel function suggested by mathematician John Hart.

1 - 6*t^5 + 15*t^4 - 10*t^3

XY Exponent

Determines inflation/contraction in the x and y axes.

For metaballs, the exponent determines the inflation towards “squarishness” or contraction towards “starishness” as described below:

> 1 = metaballs that appear more like a star. < 1 = metaballs that appear more squarish. 1 = metaballs that appear spherical.

Z Exponent

Determines inflation/contraction in the z axis.

Examples

BlendMetaballs Example for Metaball geometry node

This is a basic example of how metaballs interact as force fields with a density threshold and falloff. Metaballs can be created in Houdini through the Metaball SOP

The Point SOP is used to provide a visual representation of how metaballs interact when their respective fields blend into one another in an additive fashion.

MetaExpression Example for Metaball geometry node

This example demonstrates how to use a Meta Expression in an Attribute Create SOP to control how metaballs merge together.

See also

Geometry nodes