| On this page | |
| Since | 20.0 |
Given a set of example values, this node computes weights for a given target value (in the same space of the examples) via pose-weight interpolation.
This method is similar to rig::RBFInterpolation but gives more controllable results that are less likely to produce overshoots, while using fewer examples. However, this method can be very slow when the size of target is greater than 3 or if there are a large number of examples.
There are two stages for performing pose-weight interpolation:
-
A lattice “mesh” (with given maximum grid spacing) that is constrained to the examples is first smoothed to provide an approximation.
-
The target weights are then computed by looking up the closest cell in the lattice mesh using a local interpolation method from the corners of the cell.
入力 ¶
target:
FloatArray
The input value to compute the weights for, given how it resides among the example values.
examples:
FloatArray
The example target values concatenated into a single float array for performing interpolation. The length of examples must be a multiple of target's length.
maxcellsize:
Float
The maximum cell size of the lattice mesh. Decreasing this value may improve the quality of the solution but increase the time required to solve.
smoothingmode:
Int
The smoothing mode used for the first stage of computing the weights.
smoothingmode |
Meaning |
Description |
|---|---|---|
0 |
Taubin |
An iterative mesh smoothing implementation based on Taubin 95. This method does not support Laplacian constraints and always enforces box constraints. |
1 |
Quadratic Program |
Formulates the mesh energy minimization as a quadratic program. This method supports optional box and Laplacian constraints. |
2 |
Sparse Solve |
Uses optimality conditions to reduce the mesh smoothing to a sparse linear system. This method supports Laplacian but not box constraints. |
passband:
Float
If smoothingmode is set to Taubin, this is the noise cutoff frequency when smoothing the lattice mesh points.
iterations:
Int
If smoothingmode is set to Taubin, this is the number of smoothing iterations to run on the lattice. If smoothingmode is set to Quadratic Program, this is the maximum number of iterations used for solving.
secondordersmooth:
Bool
If set to True, increases the smoothness of the results. This is only recommended for the Taubin smoothingmode.
boxconstraints:
Bool
If set to True, the output weights are constrained between 0 and 1. This is often desirable so that the interpolation results are never outside the range of example values.
laplacianconstraints:
Bool
If set to True, applies constraints that increase the influence of the example points. The amount of influence is set in influencestrength.
influencestrength:
Float
If laplacianconstraints is set to True, this is the local influence of the examples. Higher scale factors increase the effect the examples have on their local neighborhood.
interpmode:
Int
The local interpolation mode used for the second stage of computing the weights.
interpmode |
Meaning |
Description |
|---|---|---|
0 |
Inverse Weight |
Interpolates a point using the surrounding mesh cells with weights inversely proportional to the weight at each vertex. This method is not recommended, as it may introduce wobbles, especially at larger max cell sizes. |
1 |
Multi-Linear |
Weights are linearly interpolated based on the weights at the surrounding cell vertices. |
2 |
Multi-Spline |
Same as above, except Catmull-Rom splines are used, giving the smoothest results at the cost of some overshooting. |
distancepow:
Float
The exponent used for Inverse Weight interpolation within the lattice cell.
reload:
Bool
If set to False, performs internal caching according to the sizes of the target and examples inputs, and does not recompute if only the values within target and examples change. To disable caching, set this to True.
出力 ¶
weights:
FloatArray
The interpolated weights for target among the examples. These weights should be used for a linear combination (or weighted average) of values for performing scattered interpolation. The values could be blendshape positions (eg. for pose space deformation) or any other set of values corresponding to the examples.
| See also |