Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Component:SkinnedMeshPositioner

Attaches an object to a specific part of a SkinnedMesh that is affected by multiple bones and/or blendshapes
Component image 
SkinnedMeshPositioner component as seen in the Scene Inspector

The SkinnedMeshPositioner component drives a slot's transform so it stays locked to a specific triangle on a SkinnedMeshRenderer.


Normally you can attach things by parenting them to bones, which works okay. But for parts of the skinned mesh that are weighted to multiple bones and/or are affected by blendshapes, this will cause the object to "drift/slide" relative to the mesh. This component fixes that by computing the transform from the actual skinned mesh transform![1]

Fields

This article or section is a stub. You can help the Resonite wiki by expanding it.
Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
Skin SkinnedMeshRenderer The skinned mesh renderer to attach this object to
TriangleIndex Int The index of the triangle in the mesh to attach this object to
BarycentricCoordinate Float3 How close the attachment point should be to each vertex of the triangle (barycentric coordinate system).
LocalPosition Float3 An offset to apply to the position of the object
LocalRotation FloatQ An offset to apply to the rotation of the object
LocalScale Float3 A multiplier to apply to the scale of the object
PositionDrive field drive of Float3 The position field of the slot to be driven with the position of the triangle in the SkinnedMeshRenderer
RotationDrive field drive of FloatQ The rotation field of the slot to be driven with the rotation of the triangle in the SkinnedMeshRenderer
ScaleDrive field drive of Float3 The scale field of the slot to be driven with the scale of the SkinnedMeshRenderer

Sync Delegates

Triggers
Method Name Method type and Arguments. Is the method hidden? Description
ComputeParameters:ButtonEventHandler ButtonEventHandler Calculates parameters to position the slot at its current position, rotation & scale, relative to the nearest triangle on the specified SkinnedMeshRenderer

Usage

To use this component, you should position a slot so that it is placed where you would like it to be anchored on the SkinnedMeshRenderer, attach this component to that slot, fill in the Skin field with a reference to the SkinnedMeshRenderer and select the Compute Parameters button in the Inspector. Once pressed, Resonite will fill in the TriangleIndex field with the index of the nearest triangle on the SkinnedMeshRenderer to that slot, fill in the BarycentricCoordinate, LocalPosition, LocalRotation & LocalScale fields with the values to keep the slot positioned where it was, relative to the selected triangle, and set the PositionDrive, RotationDrive & ScaleDrive fields to references to the respective slot fields.

Demo

Overview and basic usage by Frooxius

See also