From 567b76fe6ad2a80c3c6b2fde546d53dbcc6491ab Mon Sep 17 00:00:00 2001 From: Konstantin Koch Date: Wed, 4 Nov 2015 23:40:29 +0100 Subject: [PATCH] Textures that are referenced in a model loaded by Assimp get now compiled to. --- .../Importer/AssimpImporter.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs b/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs index 256e5279..7ab817a9 100644 --- a/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs +++ b/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs @@ -298,7 +298,11 @@ namespace ANX.Framework.Content.Pipeline if (string.IsNullOrEmpty(texture.FilePath)) continue; - material.Textures.Add(System.IO.Path.GetFileNameWithoutExtension(texture.FilePath) + " " + texture.TextureIndex, new ExternalReference(texture.FilePath)); + var sourcePath = new Uri(texture.FilePath, UriKind.RelativeOrAbsolute); + if (!sourcePath.IsAbsoluteUri) + sourcePath = new Uri(new Uri(this.identity.SourceFilename, UriKind.Absolute), sourcePath); + + material.Textures.Add(Path.GetFileNameWithoutExtension(texture.FilePath) + " " + texture.TextureIndex, new ExternalReference(sourcePath.LocalPath)); } if (assimpMaterial.HasBlendMode)