Fix proxy pivot derivation to use global rest (local rest was misplacing the Quaternius joints)
This commit is contained in:
1 parent
271f10ac4d
commit
0cd12af994
1 file changed
+3
-3
@@ -495,14 +495,14 @@ func _bind_bones() -> void:
|
|||||||
for index in _skeleton.get_bone_count():
|
for index in _skeleton.get_bone_count():
|
||||||
_bone_indices[_skeleton.get_bone_name(index)] = index
|
_bone_indices[_skeleton.get_bone_name(index)] = index
|
||||||
|
|
||||||
## First-found rest origin for a list of candidate bone names. Lets the proxy
|
## First-found rest origin for a list of candidate bone names, in the skeleton's
|
||||||
## pivots track the actual skeleton (old 13-core or Quaternius 62-joint).
|
## space (global rest), so proxy pivots sit on the actual joints.
|
||||||
func _rest_origin(names: Array) -> Vector3:
|
func _rest_origin(names: Array) -> Vector3:
|
||||||
if _skeleton == null:
|
if _skeleton == null:
|
||||||
return Vector3.ZERO
|
return Vector3.ZERO
|
||||||
for bone_name in names:
|
for bone_name in names:
|
||||||
if _bone_indices.has(bone_name):
|
if _bone_indices.has(bone_name):
|
||||||
return _skeleton.get_bone_rest(_bone_indices[bone_name]).origin
|
return _skeleton.get_bone_global_rest(_bone_indices[bone_name]).origin
|
||||||
return Vector3.ZERO
|
return Vector3.ZERO
|
||||||
|
|
||||||
## Copy the proxy pivot rotations onto armature bones. Limb bones point down, so
|
## Copy the proxy pivot rotations onto armature bones. Limb bones point down, so
|
||||||
|
|||||||
Reference in new issue
Block a user