mirror of
https://github.com/4sval/FModel.git
synced 2026-09-09 10:06:35 -05:00
Updating MorphTarget
This commit is contained in:
Submodule CUE4Parse updated: 2249deefcb...33ba4d6886
@@ -31,6 +31,7 @@ public class BaseMaterialInstance : BaseIcon
|
||||
case "TextureA":
|
||||
case "TextureB":
|
||||
case "OfferImage":
|
||||
case "CarTexture":
|
||||
Preview = Utils.GetBitmap(texture);
|
||||
break;
|
||||
}
|
||||
@@ -88,4 +89,4 @@ public class BaseMaterialInstance : BaseIcon
|
||||
|
||||
return new[] { ret };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using CUE4Parse.UE4.Assets.Exports.Animation;
|
||||
using CUE4Parse.UE4.Objects.Core.Math;
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
@@ -44,9 +44,9 @@ public class Morph : IDisposable
|
||||
Vertices[baseIndex + count++] = vertices[i + 1] + positionDelta.X * Constants.SCALE_DOWN_RATIO;
|
||||
Vertices[baseIndex + count++] = vertices[i + 2] + positionDelta.Z * Constants.SCALE_DOWN_RATIO;
|
||||
Vertices[baseIndex + count++] = vertices[i + 3] + positionDelta.Y * Constants.SCALE_DOWN_RATIO;
|
||||
Vertices[baseIndex + count++] = vertices[i + 7] + tangentDelta.X * Constants.SCALE_DOWN_RATIO;
|
||||
Vertices[baseIndex + count++] = vertices[i + 8] + tangentDelta.Z * Constants.SCALE_DOWN_RATIO;
|
||||
Vertices[baseIndex + count++] = vertices[i + 9] + tangentDelta.Y * Constants.SCALE_DOWN_RATIO;
|
||||
Vertices[baseIndex + count++] = vertices[i + 7] + tangentDelta.X;
|
||||
Vertices[baseIndex + count++] = vertices[i + 8] + tangentDelta.Z;
|
||||
Vertices[baseIndex + count++] = vertices[i + 9] + tangentDelta.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using CUE4Parse_Conversion.Meshes.PSK;
|
||||
@@ -74,11 +74,15 @@ public class SkeletalModel : UModel
|
||||
}
|
||||
}
|
||||
|
||||
Morphs = new List<Morph>();
|
||||
for (var i = 0; i < export.MorphTargets.Length; i++)
|
||||
Morphs = [];
|
||||
if (export.MorphTargets.Length == 0) return;
|
||||
|
||||
export.PopulateMorphTargetVerticesData();
|
||||
|
||||
foreach (var morph in export.MorphTargets)
|
||||
{
|
||||
if (!export.MorphTargets[i].TryLoad(out UMorphTarget morphTarget) ||
|
||||
morphTarget.MorphLODModels.Length < 1 || morphTarget.MorphLODModels[0].Vertices.Length < 1)
|
||||
if (!morph.TryLoad(out UMorphTarget morphTarget) || morphTarget.MorphLODModels.Length < 1 ||
|
||||
morphTarget.MorphLODModels[0].Vertices.Length < 1)
|
||||
continue;
|
||||
|
||||
Morphs.Add(new Morph(Vertices, VertexSize, morphTarget));
|
||||
@@ -87,10 +91,10 @@ public class SkeletalModel : UModel
|
||||
|
||||
public SkeletalModel(USkeleton export, FBox box) : base(export)
|
||||
{
|
||||
Indices = Array.Empty<uint>();
|
||||
Materials = Array.Empty<Material>();
|
||||
Vertices = Array.Empty<float>();
|
||||
Sections = Array.Empty<Section>();
|
||||
Indices = [];
|
||||
Materials = [];
|
||||
Vertices = [];
|
||||
Sections = [];
|
||||
AddInstance(Transform.Identity);
|
||||
|
||||
Box = box * Constants.SCALE_DOWN_RATIO;
|
||||
|
||||
Reference in New Issue
Block a user