Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from Amsterdam/bugfix/remove-substring-from-index
Browse files Browse the repository at this point in the history
Bugfix/remove substring from index
  • Loading branch information
sambaas authored Sep 12, 2023
2 parents 19d55ac + dddbaec commit 18383c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion TileBakeLibrary/CityJSONToTileConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public void SetLOD(float targetLOD)
/// <param name="remove">Remove this substring from the ID before storing it</param>
public void SetID(string id, string remove)
{
Console.WriteLine($"Identifier used as ID: {id}.{((remove.Length>0) ? $" The '{remove}' part will be removed from the ID." : "")}");
identifier = id;
removeFromID = remove;
}
Expand Down Expand Up @@ -527,6 +528,10 @@ private SubObject ToSubObjectMeshData(CityObject cityObject)
subObject.uvs = new List<Vector2>();
subObject.triangleIndices = new List<int>();
subObject.id = cityObject.keyName;
if (removeFromID.Length > 0)
{
subObject.id = cityObject.keyName.Replace(removeFromID, "");
}

int submeshindex = -1;

Expand Down Expand Up @@ -574,7 +579,7 @@ private SubObject ToSubObjectMeshData(CityObject cityObject)
if (semantic.name == identifier)
{
subObject.id = semantic.value;
if (removeFromID!="")
if (removeFromID.Length > 0)
{
subObject.id = subObject.id.Replace(removeFromID, "");
}
Expand Down

0 comments on commit 18383c5

Please sign in to comment.