PCapt
From Odwiki
Contents |
Capture Attributes
This document describes the internal workings of the pCapt attributes in Houdini as of Houdini 9.0. The basic setup when capturing skin geometry to bone objects is via two SOPs, the Capture SOP and the Deform SOP. MetaCapture/MetaDeform are outside the scope of this document. These are the capture attributes that the Deform SOP uses: - pCapt - pCaptAlpha - pCaptPath - pCaptFrame - pCaptSkelRoot - tubeCapt
pCapt
This point index-pair attribute is created by the Capture and CaptureProximity SOPs. It stores the point weighting information. The attribute is structured as pairs of (capture region index, weight). The capture region index points into the paths provided by the pCaptPath attribute. Since Houdini only supports attribute sizes of the same length across all points/primitives, there are frequently unused entries at the end of the attribute. These must be filled with (-1, -1) pairs.
pCaptAlpha
This point float[1] attribute is created by the CapturePaintLayer SOP, contains the painted alpha information.
pCaptSkelRoot
This detail index (string) attribute is created by the Capture and CaptureProximiy SOPs. It contains the parent path of all entries in the pCaptPath attribute. This can be an absolute or relative path. If it is a relative path, then it is relative to the SOP currently evaluating it.
pCaptPath
This detail index (string) attribute is created by the Capture and CaptureProximity SOPs. It is a list of entries indicating the regions used in the capture process. Each entry consists of a path to the SOP relative to the value of the pCaptSkelRoot attribute followed by the corresponding primitive number in the SOP. This means that Houdini's capture system is actually a "capture region" system. It supports bone objects which contain more than 1 cregion primitive.
pCaptFrame
This detail float[1] attribute is created by the Capture and CaptureProximiy SOPs. It contains the rest frame at which the data was captured. By default, this attribute is not created since Houdini 7.0 where a new capture pose was created on bones. If it does not exist, then the capture pose parameters on bones are used as the rest pose instead.
pCaptData
This detail float attribute is created by the Capture and CaptureProximity SOPs. It contains the rest transforms of the capture regions at the time of capturing. The number of floats in the pCaptData is exactly <number of pCaptPath entries> multiplied by 20. The layout of the pCaptData for each region is as follows:
| Offset | Description |
| 0-15 | 4x4 row-major matrix to convert points from world space to the canonical rest transform space of the region. Note that point positions are intended to be left-multiplied onto the transform. |
| 16 | Top height of the region |
| 17 | Bottom height of the region |
| 18 | Ratio of (top x radius of tube)/(bottom x radius of tube) adjusted for
orientation |
| 19 | Ratio of (top z radius of tube)/(bottom z radius of tube) adjusted for orientation |
tubeCapt
This 'primitive attribute is created by the CaptureRegion SOP for each cregion primitive. It stores the rest and animation transforms associated with generated cregion primitive. It is used by the Capture and CaptureProximity SOPs to generate the pCaptData attribute.
Deformation
In most common scenarios, you only need the 4x4 matrix of the cregions. To perform a deformation, the process is something like this,
For each point:
pt = (0,0,0)
For each cregion:
xform = cregion_rest_xform (taken from pCaptData) * cregion_xform (taken from bone's cregion sop)
pt += weight * (rest_pt * xform)
Note that the cregion_xform and cregion_rest_xform matrices are in world space. If you're transforming the rest_pt's inside an object NOT at the world origin, then you also need to take that into account.



