Open nvjob-dev opened 7 months ago
I managed to solve the problem. I'm not sure if this is correct. But it works well. This is an example of solving the problem for - scale (8,8,8). For VRM1.
In file - UpdateFastSpringBoneJob
var nextTail = currentTail
+ (currentTail - prevTail) * (1.0f - joint.dragForce) // 前フレームの移動を継続する(減衰もあるよ)
+ parentRotation * logic.localRotation * logic.boneAxis *
joint.stiffnessForce * DeltaTime // 親の回転による子ボーンの移動目標
+ external; // 外力による移動量
Replaced by
var nextTail = currentTail + (currentTail - prevTail) * ((1.0f/8.0f) - joint.dragForce) + parentRotation * logic.localRotation * logic.boneAxis * joint.stiffnessForce * DeltaTime * 8.0f + external;
The idea is to use the size of the model (8 in this example) as a factor.
For VRM0. This is an example of solving the problem for - scale (8,8,8).
VRMSpringBone.cs
var stiffness = m_stiffnessForce * deltaTime ;
Replaced by
var stiffness = m_stiffnessForce * deltaTime * 8;
var nextTail = currentTail
+ (currentTail - prevTail) * (1.0f - dragForce) // 前フレームの移動を継続する(減衰もあるよ)
+ ParentRotation * LocalRotation * m_boneAxis * stiffnessForce // 親の回転による子ボーンの移動目標
+ external; // 外力による移動量
Replaced by
var nextTail = currentTail
+ (currentTail - prevTail) * ((1.0f/ 8) - dragForce) // 前フレームの移動を継続する(減衰もあるよ)
+ ParentRotation * LocalRotation * m_boneAxis * stiffnessForce // 親の回転による子ボーンの移動目標
+ external; // 外力による移動量
For myself, I did this, added a new scale_model variable, outputting it to the editor in the VRMSpringBoneEditor.cs script.
Please make the changes correctly in the next version of the asset. Thank you.
Current status https://vrm.dev/en/api/spring/spring_and_scaling/
lossyScale is required https://github.com/vrm-c/UniVRM/blob/master/Assets/VRM/Runtime/SpringBone/VRMSpringBone.cs#L218
0.81.0
Unity-2022.3
and otherWindows 10
SpringBone does not work correctly if you change the model size, for example scale (8,8,8). The parameters depend on the size of the model, and there is no way to adjust this. The bones themselves also behave incorrectly at the start, as if they were abruptly transferred from one position to another position (similar to a sharp fall). Video with the problem: https://www.youtube.com/watch?v=tWcA9wZiPzo https://www.youtube.com/watch?v=BeJZDk62_UY