Automatic calculation of shape point influences
Would it be possible to have an automatic calculation of shape point influences on the bones? Based on bones length and proximity, it would be so convenient when you have lot of points.
Something like this :
// === RIVE BONE INFLUENCE SYSTEM ===
// This code implements automatic bone weighting based on proximity
// Calculate distance between mesh vertex and bone point
const distance = Math.sqrt(
Math.pow(vertex.x - BonesPoint.x, 2) +
Math.pow(vertex.y - BonesPoint.y, 2)
);
// Apply inverse distance weighting (IDW)
// Closer bones = higher influence, distant bones = lower influence
// Normalized by total inverse distance to ensure weights sum to 1.0
const weight = (1 / distance) / totalInverseDistance;
// This weight can then be used to:
// - Blend bone transformations
// - Calculate vertex deformation
// - Create smooth skinning effects
Thank you