mirror of
https://github.com/4sval/FModel.git
synced 2026-09-21 07:54:39 -05:00
fixes
This commit is contained in:
Submodule CUE4Parse updated: 86d95053f0...e6ac7e9802
@@ -74,7 +74,7 @@ public partial class DictionaryEditor
|
||||
DialogResult = true;
|
||||
Close();
|
||||
break;
|
||||
case "MapStructTypes":
|
||||
case "Versioning Configuration (MapStructTypes)":
|
||||
MapStructTypes = JsonConvert.DeserializeObject<Dictionary<string, KeyValuePair<string, string>>>(MyAvalonEditor.Document.Text);
|
||||
// DialogResult = !Options.SequenceEqual(_defaultOptions);
|
||||
DialogResult = true;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class StaticModel : UModel
|
||||
|
||||
AddInstance(Transform.Identity);
|
||||
|
||||
Box = staticMesh.BoundingBox * Constants.SCALE_DOWN_RATIO;
|
||||
Box = staticMesh.BoundingBox * 1.5f * Constants.SCALE_DOWN_RATIO;
|
||||
}
|
||||
|
||||
public StaticModel(UStaticMesh export, CStaticMesh staticMesh, Transform transform = null)
|
||||
|
||||
@@ -454,6 +454,7 @@ public class Renderer : IDisposable
|
||||
Scale = staticMeshComp.GetOrDefault("RelativeScale3D", FVector.OneVector)
|
||||
};
|
||||
|
||||
OverrideVertexColors(staticMeshComp, m);
|
||||
if (Options.TryGetModel(guid, out var model))
|
||||
{
|
||||
model.AddInstance(t);
|
||||
@@ -527,6 +528,20 @@ public class Renderer : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private void OverrideVertexColors(UStaticMeshComponent staticMeshComp, UStaticMesh staticMesh)
|
||||
{
|
||||
if (staticMeshComp.LODData is not { Length: > 0 } || staticMesh.RenderData is not { LODs.Length: > 0 })
|
||||
return;
|
||||
|
||||
for (var lod = 0; lod < staticMeshComp.LODData.Length; lod++)
|
||||
{
|
||||
var vertexColors = staticMeshComp.LODData[lod].OverrideVertexColors;
|
||||
if (vertexColors == null) continue;
|
||||
|
||||
staticMesh.RenderData.LODs[lod].ColorVertexBuffer = vertexColors;
|
||||
}
|
||||
}
|
||||
|
||||
private void WorldTextureData(Material material, UObject textureData, string name, string key)
|
||||
{
|
||||
if (textureData.TryGetValue(out FPackageIndex package, name) && package.Load() is UTexture2D texture)
|
||||
|
||||
Reference in New Issue
Block a user