Explorar o código

[animgraph] Fix crash when object.defaultTransform was null

Clément Espeute hai 8 meses
pai
achega
34f9448dcb
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      hrt/animgraph/nodes/DefaultPose.hx

+ 6 - 3
hrt/animgraph/nodes/DefaultPose.hx

@@ -31,9 +31,12 @@ class DefaultPose extends AnimNode {
 		var bone = objects[boneId];
 		if (bone.matDecomposed == null) {
 			var m = bone.skin != null ? bone.skin.getSkinData().allJoints[bone.joint].defMat : bone.object.defaultTransform;
-			bone.matDecomposed = new h3d.Matrix();
-
-			Tools.splitMatrix(m, bone.matDecomposed);
+			if (m != null) {
+				bone.matDecomposed = new h3d.Matrix();
+				Tools.splitMatrix(m, bone.matDecomposed);
+			} else {
+				bone.matDecomposed = @:privateAccess h3d.anim.SmoothTransition.MZERO;
+			}
 		}
 		outMatrix.load(bone.matDecomposed);
 	}