From 259db28adc020f541f9475d1e53836c2a3b53030 Mon Sep 17 00:00:00 2001 From: Harven Date: Fri, 20 May 2016 00:53:49 +0200 Subject: [PATCH] Fix: DX11 renderer is unable to load LOD models from mods directories. The change forces LOD model files to be loaded from the same path as main model file. The bug was reported here: http://forums.keenswh.com/threads/1-105-directx-11-renderer-is-unable-to-load-level-of-detail-models.7371600/ --- Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs index d8d9730bae..e6e99f3f5e 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs @@ -2112,6 +2112,7 @@ static void LoadMesh(MeshId id) StoreLodMeshSections(id, 0, ref sections); int modelLods = 1; + var mainMeshDir = Path.IsPathRooted(assetName) ? Path.GetDirectoryName(assetName) : Path.GetDirectoryName(Path.Combine(MyFileSystem.ContentPath, assetName)); if (lodDescriptors != null) for (int i = 0; i < lodDescriptors.Length; i++) @@ -2124,7 +2125,7 @@ static void LoadMesh(MeshId id) MyLodMeshInfo lodMesh = new MyLodMeshInfo { - FileName = meshFile, + FileName = Path.Combine(mainMeshDir, Path.GetFileName(meshFile)), LodDistance = lodDescriptors[i].Distance, NullLodMesh = meshFile == null, };