Skip to content

Commit

Permalink
fix indentation in mtl file
Browse files Browse the repository at this point in the history
  • Loading branch information
charly-perspectives committed Oct 5, 2023
1 parent c33b822 commit 9388606
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Obj2Tiles.Library/Materials/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public static Material[] ReadMtl(string path, out string[] dependencies)
{
if (line.StartsWith("#") || string.IsNullOrWhiteSpace(line))
continue;

var parts = line.Split(' ');

var lineTrimmed = line.Trim();
var parts = lineTrimmed.Split(' ');
switch (parts[0])
{
case "newmtl":
Expand Down
22 changes: 11 additions & 11 deletions Obj2Tiles/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,73 +35,73 @@ private static IEnumerable<string> GetMtlDependencies(string mtlPath)

var dependencies = new List<string>();


foreach (var line in mtlFile)
{
if (line.StartsWith("map_Kd"))
if (line.Trim().StartsWith("map_Kd"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.StartsWith("map_Ka"))
if (line.Trim().StartsWith("map_Ka"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.StartsWith("norm"))
if (line.Trim().StartsWith("norm"))
{
dependencies.Add(line[5..].Trim());

continue;
}

if (line.StartsWith("map_Ks"))
if (line.Trim().StartsWith("map_Ks"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.StartsWith("map_Bump"))
if (line.Trim().StartsWith("map_Bump"))
{
dependencies.Add(line[8..].Trim());

continue;
}

if (line.StartsWith("map_d"))
if (line.Trim().StartsWith("map_d"))
{
dependencies.Add(line[6..].Trim());

continue;
}

if (line.StartsWith("map_Ns"))
if (line.Trim().StartsWith("map_Ns"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.StartsWith("bump"))
if (line.Trim().StartsWith("bump"))
{
dependencies.Add(line[5..].Trim());

continue;
}

if (line.StartsWith("disp"))
if (line.Trim().StartsWith("disp"))
{
dependencies.Add(line[5..].Trim());

continue;
}

if (line.StartsWith("decal"))
if (line.Trim().StartsWith("decal"))
{
dependencies.Add(line[6..].Trim());

Expand Down

0 comments on commit 9388606

Please sign in to comment.