Skip to content

Commit 8b3a36e

Browse files
author
Roberto De Ioris
authored
Update SnippetsForStaticAndSkeletalMeshes.md
1 parent 663f18d commit 8b3a36e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tutorials/SnippetsForStaticAndSkeletalMeshes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ class ColladaLoader:
911911
transform.translation = FVector(v0.z, v0.x, v0.y) * self.base_quaternion
912912
transform.quaternion = FQuat(q0[2], q0[0] * -1, q0[1] * -1, q0[3])
913913

914+
# each bone in collada is in world position (while unreal wants relative positions), we 'subtract' here the parent position
914915
relative_transform = transform * parent_transform.inverse()
915916

916917
parent_id = self.skeleton.skeleton_add_bone(node.id, parent_id, relative_transform)
@@ -1017,6 +1018,8 @@ If all goes well you wll end with your model correctly loaded (the screenshot sh
10171018

10181019
![Collada](https://github.com/20tab/UnrealEnginePython/blob/master/tutorials/SnippetsForStaticAndSkeletalMeshes_Assets/collada.PNG)
10191020

1021+
As you could have already noted in the comments, joints/bones matrices in collada files are world-relative, while UE4 expects each bone to be relative to the parent. For this reason we multiply each matrix for the inverse of its parent.
1022+
10201023
## SkeletalMesh: Morph Targets
10211024

10221025
Morph Targets (or Blend Shapes), are a simple form of animation where a specific vertex (and eventually its normal) is translated to a new position. By interpolating the transition from the default position to the new one defined by the morph target, you can generate an animation. Morph Targets are common in facial animations or, more generally, whenever an object must be heavily deformed.

0 commit comments

Comments
 (0)