Class: ClothSkirtPlugin
@geenee/bodyrenderers-babylon.ClothSkirtPlugin
Cloth plugin for armatures with auxiliary skirt bones
ClothSkirtPlugin is an extension of ClothAlignPlugin that controls auxiliary skirt bones of armature if presented. Skirt bones are driven by legs but has additional kinematic constrains to mimic deformation of a fabric more naturally. This technic provides for higher fidelity virtual try-on of apparels that have a loose bottom skirt by controlling this part independently and not making it stick to legs so tightly. Auxiliary skirt bones must be clones of up leg and leg bones and skirt part should be skinned against them instead of legs.
Hierarchy
-
↳
ClothSkirtPlugin
Constructors
constructor
• new ClothSkirtPlugin(node?
, tune?
)
Constructor
Parameters
Name | Type | Description |
---|---|---|
node? | TransformNode | Scene node to attach |
tune | PoseTuneParams | Fine-tuning parameters |
Inherited from
Properties
alignScore
• Readonly
alignScore: 0.9
Pose score threshold
Inherited from
alignVisibility
• Readonly
alignVisibility: 0.9
Keypoint visibility threshold
Inherited from
ClothAlignPlugin.alignVisibility
cameraAngle
• Protected
cameraAngle: number
Camera vertical angle in radians
Inherited from
cameraRatio
• Protected
cameraRatio: number
Camera aspect ratio
Inherited from
loaded
• loaded: boolean
Loaded state
Inherited from
node
• Protected
Optional
node: TransformNode
Scene node to attach
Inherited from
nodeOrigin
• Protected
nodeOrigin: BoneTransform
Origin of node relative to the root bone
Inherited from
ordinal
• ordinal: number
Ordinal number
Inherited from
renderer
• Protected
Optional
renderer: Renderer
<PoseResult
>
Renderer loaded the plugin
Inherited from
scene
• Protected
Optional
scene: Scene
Reference to a scene instance
Inherited from
skeleton
• Protected
Optional
skeleton: Skeleton
Reference to model's skeleton
Inherited from
skeletonNodes
• Protected
Optional
skeletonNodes: SkeletonNodes
Bones of the model's rig
Inherited from
ClothAlignPlugin.skeletonNodes
skeletonSizes
• Protected
Optional
skeletonSizes: SkeletonSizes
Reference sizes of skeleton
Inherited from
ClothAlignPlugin.skeletonSizes
skirtSkeletonNodes
• Protected
Optional
skirtSkeletonNodes: SkirtSkeletonNodes
Auxiliary bones of skirt rig
spineCurve
• Protected
Optional
spineCurve: SpineCurve
Shape of spine
Inherited from
tune
• Protected
tune: PoseTuneParams
Fine-tuning parameters
Inherited from
Methods
dispose
▸ dispose(): void
Dispose video plugin
Returns
void
Inherited from
estimateBones
▸ Protected
estimateBones(pose
, spineCurve
, skeletonSizes
): Object
Estimate bone positions and orientations
Using detected keypoints approximates bone transformations. Position of bone if defined by 3D point itself, bone length is the distance between keypoints connected by bone. Bone's rotation is defined by its axes that are evaluated using kinematic rules and relative positions of adjacent keypoints. Method returns bone position and orientation in global world frame, final relative transformations are found traversing skeleton hierarchy and accumulating transforms of parents.
Parameters
Name | Type | Description |
---|---|---|
pose | PosePoints | Pose keypoints |
spineCurve | SpineCurve | Reference shape of spine |
skeletonSizes | SkeletonSizes | Reference sizes of skeleton |
Returns
Object
Bone transformations
Name | Type |
---|---|
armL | BoneTransform |
armMidL | BoneTransform |
armMidR | BoneTransform |
armR | BoneTransform |
footL | BoneTransform |
footR | BoneTransform |
forearmL | BoneTransform |
forearmMidL | BoneTransform |
forearmMidR | BoneTransform |
forearmR | BoneTransform |
handL | BoneTransform |
handR | BoneTransform |
head | BoneTransform |
legL | BoneTransform |
legR | BoneTransform |
neck | BoneTransform |
neck1 | BoneTransform |
pelvis | BoneTransform |
root | BoneTransform |
shoulderL | BoneTransform |
shoulderR | BoneTransform |
spine | BoneTransform |
spine1 | BoneTransform |
spine2 | BoneTransform |
spine3 | BoneTransform |
uplegL | BoneTransform |
uplegMidL | BoneTransform |
uplegMidR | BoneTransform |
uplegR | BoneTransform |
Inherited from
ClothAlignPlugin.estimateBones
load
▸ load(renderer
): Promise
<void
>
Initialize plugin
Parses and caches the rig/armature of the attached scene node (one provided to plugin's constructor). Precalculates geometrical parameters of skeleton.
Parameters
Name | Type | Description |
---|---|---|
renderer | Renderer <PoseResult > | Renderer this plugin is attached to |
Returns
Promise
<void
>
Promise resolving when initialization is finished
Inherited from
setNode
▸ setNode(node?
): void
Set/attach a scene node
Extended to parses and caches auxiliary skirt bones. Backward compatible with base skeleton rig, if skirt bones are not parsed controls only the base skeleton.
Parameters
Name | Type | Description |
---|---|---|
node? | TransformNode | Scene node to attach |
Returns
void
Overrides
setupCamera
▸ setupCamera(ratio
, angle
): void
Set camera parameters
Parameters
Name | Type | Description |
---|---|---|
ratio | number | Aspect ration of input video |
angle | number | Vertical field of view in radians |
Returns
void
Inherited from
setupVideo
▸ setupVideo(size
): void
Set video size
Could be overridden to adjust plugin's pipeline.
Parameters
Name | Type | Description |
---|---|---|
size | Size | Resolution of input video |
Returns
void
Inherited from
unload
▸ unload(): void
Reset plugin
Removes the attached node.
Returns
void
Inherited from
update
▸ update(result
, stream
): Promise
<void
>
Update skeleton of the scene node
Extends alignment of the base armature with guided control of skirt bones. Skirt bones are driven by leg bones but has additional kinematic constrains to mimic deformation of a fabric more naturally.
Parameters
Name | Type | Description |
---|---|---|
result | PoseResult | Pose estimation results |
stream | HTMLCanvasElement | Captured video frame |
Returns
Promise
<void
>
Promise resolving when update is finished