From afc7217a372e6f50dfa7eb85f819c5faf0818138 Mon Sep 17 00:00:00 2001 From: Blyron Date: Tue, 13 May 2025 15:52:52 +0200 Subject: [PATCH 1/5] Fixes for digital twins standalone --- Source/StreetMapImporting/StreetMapImporting.Build.cs | 4 ++-- Source/StreetMapRuntime/Private/StreetMapComponent.cpp | 5 +++-- Source/StreetMapRuntime/StreetMapRuntime.Build.cs | 8 +++++--- StreetMap.uplugin | 5 ----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Source/StreetMapImporting/StreetMapImporting.Build.cs b/Source/StreetMapImporting/StreetMapImporting.Build.cs index 2d52cce..a4e052f 100644 --- a/Source/StreetMapImporting/StreetMapImporting.Build.cs +++ b/Source/StreetMapImporting/StreetMapImporting.Build.cs @@ -8,7 +8,7 @@ public StreetMapImporting(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - + PublicDependencyModuleNames.AddRange(new string[] { "CarlaMeshGeneration" }); PrivateDependencyModuleNames.AddRange( new string[] { "Core", @@ -34,7 +34,7 @@ public StreetMapImporting(ReadOnlyTargetRules Target) } ); - PrivateIncludePaths.AddRange(new string[]{"StreetMapImporting/Private"}); + PrivateIncludePaths.AddRange(new string[]{"StreetMapImporting/Private" }); } } } diff --git a/Source/StreetMapRuntime/Private/StreetMapComponent.cpp b/Source/StreetMapRuntime/Private/StreetMapComponent.cpp index e8a7cd1..2db4da5 100644 --- a/Source/StreetMapRuntime/Private/StreetMapComponent.cpp +++ b/Source/StreetMapRuntime/Private/StreetMapComponent.cpp @@ -11,8 +11,9 @@ #include "PhysicsEngine/BodySetup.h" #include "ProceduralMeshComponent.h" -#include "Carla/OpenDrive/OpenDriveGenerator.h" -#include "Carla/BlueprintLibary/MapGenFunctionLibrary.h" + +#include "Generation/MapGenFunctionLibrary.h" + #if WITH_EDITOR #include "Modules/ModuleManager.h" diff --git a/Source/StreetMapRuntime/StreetMapRuntime.Build.cs b/Source/StreetMapRuntime/StreetMapRuntime.Build.cs index 3623449..b027c70 100644 --- a/Source/StreetMapRuntime/StreetMapRuntime.Build.cs +++ b/Source/StreetMapRuntime/StreetMapRuntime.Build.cs @@ -1,4 +1,5 @@ // Copyright 2017 Mike Fricker. All Rights Reserved. +using System.IO; namespace UnrealBuildTool.Rules { @@ -8,7 +9,7 @@ public StreetMapRuntime(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - + PublicDependencyModuleNames.AddRange(new string[] { "CarlaMeshGeneration" }); PrivateDependencyModuleNames.AddRange( new string[] { "Core", @@ -19,11 +20,12 @@ public StreetMapRuntime(ReadOnlyTargetRules Target) "PropertyEditor", "GeometricObjects", "ProceduralMeshComponent", - "Carla" } ); - PrivateIncludePaths.AddRange(new string[]{"StreetMapRuntime/Private"}); + + + PrivateIncludePaths.AddRange(new string[]{"StreetMapRuntime/Private"}); } } } diff --git a/StreetMap.uplugin b/StreetMap.uplugin index 4a097ab..643e68b 100644 --- a/StreetMap.uplugin +++ b/StreetMap.uplugin @@ -29,11 +29,6 @@ }, ], "Plugins": [ - { - "Name" : "Carla", - "Enabled" : true - }, - { "Name" : "GeometryProcessing", "Enabled" : true From b4e165f9d116dfb1239e0d5366dbaf85c7a10531 Mon Sep 17 00:00:00 2001 From: Marcel Pi <169088301+MarcelPiNacy-CVC@users.noreply.github.com> Date: Tue, 20 May 2025 13:24:28 +0200 Subject: [PATCH 2/5] Fix build issues under UE5. --- .../Private/StreetMapActorFactory.cpp | 14 +++++ .../Private/StreetMapAssetTypeActions.cpp | 8 +++ .../Private/StreetMapComponentDetails.cpp | 53 +++++++++++++++---- .../Private/StreetMapFactory.cpp | 4 ++ .../StreetMapImportBlueprintLibrary.cpp | 7 ++- .../Public/StreetMapActorFactory.h | 6 ++- .../StreetMapRuntime/Private/PolygonTools.cpp | 14 +++-- .../Private/StreetMapComponent.cpp | 12 ++++- .../Private/StreetMapSceneProxy.cpp | 37 +++++++++++-- .../Public/StreetMapComponent.h | 1 + .../StreetMapRuntime.Build.cs | 8 +-- 11 files changed, 140 insertions(+), 24 deletions(-) diff --git a/Source/StreetMapImporting/Private/StreetMapActorFactory.cpp b/Source/StreetMapImporting/Private/StreetMapActorFactory.cpp index 4482591..ee02219 100644 --- a/Source/StreetMapImporting/Private/StreetMapActorFactory.cpp +++ b/Source/StreetMapImporting/Private/StreetMapActorFactory.cpp @@ -4,7 +4,14 @@ #include "StreetMapActorFactory.h" #include "StreetMapImporting.h" + +#ifndef __has_include +#include "AssetData.h" +#else +#if __has_include("AssetData.h") #include "AssetData.h" +#endif +#endif #include "StreetMapActor.h" #include "StreetMapComponent.h" @@ -33,6 +40,12 @@ void UStreetMapActorFactory::PostSpawnActor(UObject* Asset, AActor* NewActor) } } +#if ENGINE_MAJOR_VERSION > 4 && ENGINE_MINOR_VERSION > 3 +void UStreetMapActorFactory::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) +{ + unimplemented(); +} +#else void UStreetMapActorFactory::PostCreateBlueprint(UObject* Asset, AActor* CDO) { if (Asset != nullptr && CDO != nullptr) @@ -43,6 +56,7 @@ void UStreetMapActorFactory::PostCreateBlueprint(UObject* Asset, AActor* CDO) StreetMapComponent->SetStreetMap(StreetMapAsset, true, false); } } +#endif bool UStreetMapActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg) { diff --git a/Source/StreetMapImporting/Private/StreetMapAssetTypeActions.cpp b/Source/StreetMapImporting/Private/StreetMapAssetTypeActions.cpp index 51e88ce..3f945ee 100644 --- a/Source/StreetMapImporting/Private/StreetMapAssetTypeActions.cpp +++ b/Source/StreetMapImporting/Private/StreetMapAssetTypeActions.cpp @@ -4,7 +4,15 @@ #include "StreetMapImporting.h" #include "StreetMap.h" + +#ifndef __has_include +#include "AssetData.h" +#else +#if __has_include("AssetData.h") #include "AssetData.h" +#endif +#endif + #define LOCTEXT_NAMESPACE "StreetMapImporting" diff --git a/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp b/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp index f515bfe..efd09ea 100644 --- a/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp +++ b/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp @@ -3,8 +3,6 @@ #include "StreetMapComponentDetails.h" #include "StreetMapImporting.h" - - #include "SlateBasics.h" #include "RawMesh.h" #include "PropertyEditorModule.h" @@ -14,16 +12,29 @@ #include "PropertyCustomizationHelpers.h" #include "IDetailsView.h" #include "IDetailCustomization.h" -#include "AssetRegistryModule.h" #include "Dialogs/DlgPickAssetPath.h" #include "IDetailCustomization.h" #include "Widgets/Notifications/SNotificationList.h" #include "Framework/Notifications/NotificationManager.h" #include "Misc/AssertionMacros.h" +#if ENGINE_MAJOR_VERSION < 5 +#include "AssetRegistryModule.h" +#else +#include "AssetRegistry/AssetRegistryModule.h" +#endif + #include "StreetMapComponent.h" +#if ENGINE_MAJOR_VERSION > 4 +using V2 = FVector2f; +using V3 = FVector3f; +#else +using V2 = FVector2D; +using V3 = FVector3D; +#endif + #define LOCTEXT_NAMESPACE "StreetMapComponentDetails" @@ -242,7 +253,7 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() // Copy verts for (int32 VertIndex = 0; VertIndex < RawMeshVertices.Num();VertIndex++) { - RawMesh.VertexPositions.Add(RawMeshVertices[VertIndex].Position); + RawMesh.VertexPositions.Add(V3(RawMeshVertices[VertIndex].Position)); } // Copy 'wedge' info @@ -255,15 +266,15 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() const FStreetMapVertex& StreetMapVertex = RawMeshVertices[VertexIndex]; - FVector TangentX = StreetMapVertex.TangentX; - FVector TangentZ = StreetMapVertex.TangentZ; - FVector TangentY = (TangentX ^ TangentZ).GetSafeNormal(); + auto TangentX = V3(StreetMapVertex.TangentX); + auto TangentZ = V3(StreetMapVertex.TangentZ); + auto TangentY = V3((TangentX ^ TangentZ).GetSafeNormal()); RawMesh.WedgeTangentX.Add(TangentX); RawMesh.WedgeTangentY.Add(TangentY); RawMesh.WedgeTangentZ.Add(TangentZ); - RawMesh.WedgeTexCoords[0].Add(StreetMapVertex.TextureCoordinate); + RawMesh.WedgeTexCoords[0].Add(V2(StreetMapVertex.TextureCoordinate)); RawMesh.WedgeColors.Add(StreetMapVertex.Color); } @@ -279,17 +290,29 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() if (RawMesh.VertexPositions.Num() > 3 && RawMesh.WedgeIndices.Num() > 3) { // Then find/create it. +#if ENGINE_MAJOR_VERSION < 5 UPackage* Package = CreatePackage(NULL, *UserPackageName); +#else + UPackage* Package = CreatePackage(*UserPackageName); +#endif check(Package); // Create StaticMesh object UStaticMesh* StaticMesh = NewObject(Package, MeshName, RF_Public | RF_Standalone); StaticMesh->InitResources(); +#if ENGINE_MAJOR_VERSION < 5 StaticMesh->LightingGuid = FGuid::NewGuid(); +#else + StaticMesh->SetLightingGuid(FGuid::NewGuid()); +#endif // Add source to new StaticMesh +#if ENGINE_MAJOR_VERSION < 5 FStaticMeshSourceModel* SrcModel = new (StaticMesh->SourceModels) FStaticMeshSourceModel(); +#else + FStaticMeshSourceModel* SrcModel = &StaticMesh->AddSourceModel(); +#endif SrcModel->BuildSettings.bRecomputeNormals = false; SrcModel->BuildSettings.bRecomputeTangents = false; SrcModel->BuildSettings.bRemoveDegenerates = false; @@ -303,7 +326,11 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() // Copy materials to new mesh for (UMaterialInterface* Material : MeshMaterials) { +#if ENGINE_MAJOR_VERSION < 5 StaticMesh->StaticMaterials.Add(FStaticMaterial(Material)); +#else + StaticMesh->GetStaticMaterials().Add(FStaticMaterial(Material)); +#endif } //Set the Imported version before calling the build @@ -325,7 +352,15 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() FNotificationInfo Info(FText::Format(LOCTEXT("StreetMapMeshConverted", "Successfully Converted Mesh"), FText::FromString(StaticMesh->GetName()))); Info.ExpireDuration = 8.0f; Info.bUseLargeFont = false; - Info.Hyperlink = FSimpleDelegate::CreateLambda([=]() { FAssetEditorManager::Get().OpenEditorForAssets(TArray({ StaticMesh })); }); + Info.Hyperlink = FSimpleDelegate::CreateLambda([=]() + { +#if ENGINE_MAJOR_VERSION < 5 + FAssetEditorManager::Get().OpenEditorForAssets(TArray({ StaticMesh })); +#else + GEditor->GetEditorSubsystem()->OpenEditorForAssets( + TArray({ StaticMesh })); +#endif + }); Info.HyperlinkText = FText::Format(LOCTEXT("OpenNewAnimationHyperlink", "Open {0}"), FText::FromString(StaticMesh->GetName())); TSharedPtr Notification = FSlateNotificationManager::Get().AddNotification(Info); if (Notification.IsValid()) diff --git a/Source/StreetMapImporting/Private/StreetMapFactory.cpp b/Source/StreetMapImporting/Private/StreetMapFactory.cpp index aeecde0..03ddb7e 100644 --- a/Source/StreetMapImporting/Private/StreetMapFactory.cpp +++ b/Source/StreetMapImporting/Private/StreetMapFactory.cpp @@ -43,7 +43,11 @@ UObject* UStreetMapFactory::FactoryCreateText( UClass* Class, UObject* Parent, F if( !bLoadedOkay ) { +#if ENGINE_MAJOR_VERSION < 5 StreetMap->MarkPendingKill(); +#else + StreetMap->MarkAsGarbage(); +#endif StreetMap = nullptr; } diff --git a/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp b/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp index f88d367..0aab917 100644 --- a/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp +++ b/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp @@ -8,7 +8,12 @@ #include "StreetMapFactory.h" #include "StreetMap.h" #include "Engine/AssetManager.h" + +#if ENGINE_MAJOR_VERSION > 4 +#include "AssetRegistry/IAssetRegistry.h" +#else #include "AssetData.h" +#endif UStreetMap* UStreetMapImportBlueprintLibrary::ImportStreetMap(FString Path, FString DestinationAssetPath, FVector2D OriginLatLon) { @@ -23,7 +28,7 @@ UStreetMap* UStreetMapImportBlueprintLibrary::ImportStreetMap(FString Path, FStr FString FileName = FPaths::GetCleanFilename(Path); FileName.RemoveFromEnd(".osm"); - if( AssetRegistry.GetAssetsByClass(TEXT("StreetMap"), AssetData, false) ) { + if( AssetRegistry.GetAssetsByClass(FTopLevelAssetPath(TEXT("StreetMap")), AssetData, false) ) { for( auto Asset : AssetData ){ UE_LOG(LogStreetMapImporting, Log, TEXT("FileName %s, AssetName %s ."), *FileName,*(Asset.AssetName.ToString() ) ); if( FileName.Equals( Asset.AssetName.ToString() ) ){ diff --git a/Source/StreetMapImporting/Public/StreetMapActorFactory.h b/Source/StreetMapImporting/Public/StreetMapActorFactory.h index 929e677..779c096 100644 --- a/Source/StreetMapImporting/Public/StreetMapActorFactory.h +++ b/Source/StreetMapImporting/Public/StreetMapActorFactory.h @@ -11,7 +11,11 @@ class UStreetMapActorFactory : public UActorFactory //~ Begin UActorFactory Interface virtual void PostSpawnActor(UObject* Asset, AActor* NewActor) override; - virtual void PostCreateBlueprint(UObject* Asset, AActor* CDO) override; +#if ENGINE_MAJOR_VERSION > 4 && ENGINE_MINOR_VERSION > 3 + virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; +#else + virtual void PostCreateBlueprint(UObject* Asset, AActor* CDO) override; +#endif virtual bool CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg) override; //~ End UActorFactory Interface }; diff --git a/Source/StreetMapRuntime/Private/PolygonTools.cpp b/Source/StreetMapRuntime/Private/PolygonTools.cpp index 5b2ddc6..527af1e 100644 --- a/Source/StreetMapRuntime/Private/PolygonTools.cpp +++ b/Source/StreetMapRuntime/Private/PolygonTools.cpp @@ -3,7 +3,13 @@ #include "PolygonTools.h" #include "StreetMapRuntime.h" #include "CompGeom/PolygonTriangulation.h" - +#if ENGINE_MAJOR_VERSION > 4 +#include "IndexTypes.h" +using UE::Geometry::FIndex3i; +using V2 = FVector2f; +#else +using V2 = FVector2D; +#endif // Based off "Efficient Polygon Triangulation" algorithm by John W. Ratcliff (http://flipcode.net/archives/Efficient_Polygon_Triangulation.shtml) bool FPolygonTools::TriangulatePolygon( const TArray& Polygon, TArray& TempIndices, TArray& TriangulatedIndices, bool& OutWindsClockwise ) @@ -38,12 +44,12 @@ bool FPolygonTools::TriangulatePolygon( const TArray& Polygon, TArray VertexIndices[ PointIndex ] = ( NumVertices - 1 ) - PointIndex; } } - TArray> InputVertices; + TArray InputVertices; TArray OutTriangles; if(OutWindsClockwise){ for( int32 PointIndex = 0; PointIndex < NumVertices; PointIndex++ ) { - InputVertices.Add(FVector2(Polygon[PointIndex].X, Polygon[PointIndex].Y)); + InputVertices.Add(V2(Polygon[PointIndex].X, Polygon[PointIndex].Y)); } } else @@ -51,7 +57,7 @@ bool FPolygonTools::TriangulatePolygon( const TArray& Polygon, TArray for( int32 PointIndex = 0; PointIndex < NumVertices; PointIndex++ ) { int RealIndex = ( NumVertices - 1 ) - PointIndex; - InputVertices.Add(FVector2(Polygon[RealIndex].X, Polygon[RealIndex].Y)); + InputVertices.Add(V2(Polygon[RealIndex].X, Polygon[RealIndex].Y)); } } diff --git a/Source/StreetMapRuntime/Private/StreetMapComponent.cpp b/Source/StreetMapRuntime/Private/StreetMapComponent.cpp index 2db4da5..6a8124a 100644 --- a/Source/StreetMapRuntime/Private/StreetMapComponent.cpp +++ b/Source/StreetMapRuntime/Private/StreetMapComponent.cpp @@ -20,6 +20,16 @@ #include "PropertyEditorModule.h" #endif //WITH_EDITOR +#if ENGINE_MAJOR_VERSION > 4 +#include "IndexTypes.h" +using UE::Geometry::FIndex3i; +using V3 = FVector3f; +using V2 = FVector2f; +#else +using V3 = FVector; +using V2 = FVector2D; +#endif + DEFINE_LOG_CATEGORY(LogNoriega); UStreetMapComponent::UStreetMapComponent(const FObjectInitializer& ObjectInitializer) @@ -108,7 +118,7 @@ bool UStreetMapComponent::GetPhysicsTriMeshData(struct FTriMeshCollisionData* Co for (int32 VertexIndex = 0; VertexIndex < NumVertices; VertexIndex++) { - CollisionData->Vertices[VertexIndex] = Vertices[VertexIndex].Position; + CollisionData->Vertices[VertexIndex] = V3(Vertices[VertexIndex].Position); } // Copy indices data diff --git a/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp b/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp index 43c5555..5657f21 100644 --- a/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp +++ b/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp @@ -8,6 +8,14 @@ #include "Runtime/Renderer/Public/MeshPassProcessor.h" #include "Runtime/Renderer/Public/PrimitiveSceneInfo.h" +#if ENGINE_MAJOR_VERSION < 5 +using V2 = FVector2D; +using V3 = FVector; +#else +#include "Materials\MaterialRenderProxy.h" +using V2 = FVector2f; +using V3 = FVector3f; +#endif FStreetMapSceneProxy::FStreetMapSceneProxy(const UStreetMapComponent* InComponent) : FPrimitiveSceneProxy(InComponent), @@ -35,11 +43,11 @@ void FStreetMapSceneProxy::Init(const UStreetMapComponent* InComponent, const TA { const FStreetMapVertex& StreetMapVert = Vertices[VertIdx]; FDynamicMeshVertex& Vert = DynamicVertices[VertIdx]; - Vert.Position = StreetMapVert.Position; + Vert.Position = V3(StreetMapVert.Position); Vert.Color = StreetMapVert.Color; - Vert.TextureCoordinate[0] = StreetMapVert.TextureCoordinate; - Vert.TangentX = StreetMapVert.TangentX; - Vert.TangentZ = StreetMapVert.TangentZ; + Vert.TextureCoordinate[0] = V2(StreetMapVert.TextureCoordinate); + Vert.TangentX = V3(StreetMapVert.TangentX); + Vert.TangentZ = V3(StreetMapVert.TangentZ); } VertexBuffer.InitFromDynamicVertex(&VertexFactory, DynamicVertices); @@ -152,7 +160,26 @@ void FStreetMapSceneProxy::MakeMeshBatch( FMeshBatch& Mesh, class FMeshElementCo // BatchElement.PrimitiveUniformBuffer = CreatePrimitiveUniformBufferImmediate(GetLocalToWorld(), GetBounds(), GetLocalBounds(), true, UseEditorDepthTest()); FDynamicPrimitiveUniformBuffer& DynamicPrimitiveUniformBuffer = Collector.AllocateOneFrameResource(); - DynamicPrimitiveUniformBuffer.Set(GetLocalToWorld(), GetLocalToWorld(), GetBounds(), GetLocalBounds(), true, false, DrawsVelocity(), false); +#if ENGINE_MAJOR_VERSION < 5 + DynamicPrimitiveUniformBuffer.Set( + GetLocalToWorld(), + GetLocalToWorld(), + GetBounds(), + GetLocalBounds(), + true, + false, + DrawsVelocity(), + false); +#else + DynamicPrimitiveUniformBuffer.Set( + GetLocalToWorld(), + GetLocalToWorld(), + GetBounds(), + GetLocalBounds(), + true, + false, + DrawsVelocity()); +#endif BatchElement.PrimitiveUniformBufferResource = &DynamicPrimitiveUniformBuffer.UniformBuffer; BatchElement.FirstIndex = 0; diff --git a/Source/StreetMapRuntime/Public/StreetMapComponent.h b/Source/StreetMapRuntime/Public/StreetMapComponent.h index 188bdb9..f97fa05 100644 --- a/Source/StreetMapRuntime/Public/StreetMapComponent.h +++ b/Source/StreetMapRuntime/Public/StreetMapComponent.h @@ -4,6 +4,7 @@ #include "StreetMap.h" #include "Components/MeshComponent.h" #include "Interfaces/Interface_CollisionDataProvider.h" +#include "MaterialDomain.h" #include "StreetMapSceneProxy.h" #include "StreetMapComponent.generated.h" diff --git a/Source/StreetMapRuntime/StreetMapRuntime.Build.cs b/Source/StreetMapRuntime/StreetMapRuntime.Build.cs index b027c70..1ee2911 100644 --- a/Source/StreetMapRuntime/StreetMapRuntime.Build.cs +++ b/Source/StreetMapRuntime/StreetMapRuntime.Build.cs @@ -18,14 +18,16 @@ public StreetMapRuntime(ReadOnlyTargetRules Target) "RHI", "RenderCore", "PropertyEditor", - "GeometricObjects", "ProceduralMeshComponent", } ); + if (Target.Version.MajorVersion < 5) + PrivateDependencyModuleNames.Add("GeometricObjects"); + else + PrivateDependencyModuleNames.Add("GeometryCore"); - - PrivateIncludePaths.AddRange(new string[]{"StreetMapRuntime/Private"}); + PrivateIncludePaths.AddRange(new string[] { "StreetMapRuntime/Private" }); } } } From 24df3a3d45ab8d2ae455a6f44118ccd588eedcc2 Mon Sep 17 00:00:00 2001 From: MarcelPiNacy-CVC Date: Wed, 21 May 2025 12:25:58 +0200 Subject: [PATCH 3/5] Fix invalid separator. --- Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp b/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp index 5657f21..ed59578 100644 --- a/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp +++ b/Source/StreetMapRuntime/Private/StreetMapSceneProxy.cpp @@ -12,7 +12,7 @@ using V2 = FVector2D; using V3 = FVector; #else -#include "Materials\MaterialRenderProxy.h" +#include "Materials/MaterialRenderProxy.h" using V2 = FVector2f; using V3 = FVector3f; #endif From 9aaa84e9a63f5b78255cee72f370455e58652a98 Mon Sep 17 00:00:00 2001 From: Blyron Date: Tue, 10 Jun 2025 15:51:36 +0200 Subject: [PATCH 4/5] UE5 fixes --- .../Private/StreetMapComponentDetails.cpp | 1 + .../Private/StreetMapImportBlueprintLibrary.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp b/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp index efd09ea..1647fbb 100644 --- a/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp +++ b/Source/StreetMapImporting/Private/StreetMapComponentDetails.cpp @@ -17,6 +17,7 @@ #include "Widgets/Notifications/SNotificationList.h" #include "Framework/Notifications/NotificationManager.h" #include "Misc/AssertionMacros.h" +#include "AssetToolsModule.h" #if ENGINE_MAJOR_VERSION < 5 #include "AssetRegistryModule.h" diff --git a/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp b/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp index 0aab917..879425e 100644 --- a/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp +++ b/Source/StreetMapImporting/Private/StreetMapImportBlueprintLibrary.cpp @@ -7,7 +7,10 @@ #include "StreetMapImportBlueprintLibrary.h" #include "StreetMapFactory.h" #include "StreetMap.h" +#include "StreetMapImporting.h" #include "Engine/AssetManager.h" +#include "AssetToolsModule.h" +#include "IAssetTools.h" #if ENGINE_MAJOR_VERSION > 4 #include "AssetRegistry/IAssetRegistry.h" @@ -28,7 +31,8 @@ UStreetMap* UStreetMapImportBlueprintLibrary::ImportStreetMap(FString Path, FStr FString FileName = FPaths::GetCleanFilename(Path); FileName.RemoveFromEnd(".osm"); - if( AssetRegistry.GetAssetsByClass(FTopLevelAssetPath(TEXT("StreetMap")), AssetData, false) ) { + FTopLevelAssetPath AssetClassPath = FTopLevelAssetPath(FName("/Script/StreetMapRuntime"), FName("StreetMap")); + if(AssetRegistry.GetAssetsByClass(AssetClassPath, AssetData, false)) { for( auto Asset : AssetData ){ UE_LOG(LogStreetMapImporting, Log, TEXT("FileName %s, AssetName %s ."), *FileName,*(Asset.AssetName.ToString() ) ); if( FileName.Equals( Asset.AssetName.ToString() ) ){ From b1e947da31b65f3ed9597582827bfa89ba237b4c Mon Sep 17 00:00:00 2001 From: Blyron Date: Tue, 10 Jun 2025 17:01:34 +0200 Subject: [PATCH 5/5] Update the roofs generations --- Source/StreetMapRuntime/Private/StreetMapComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/StreetMapRuntime/Private/StreetMapComponent.cpp b/Source/StreetMapRuntime/Private/StreetMapComponent.cpp index 6a8124a..9c1f1ae 100644 --- a/Source/StreetMapRuntime/Private/StreetMapComponent.cpp +++ b/Source/StreetMapRuntime/Private/StreetMapComponent.cpp @@ -715,7 +715,7 @@ AActor* UStreetMapComponent::GenerateTopOfBuilding(int Index, FString MapName, U TempPoints[ PointIndex ] = FVector( Building.BuildingPoints[ ( Building.BuildingPoints.Num() - PointIndex ) - 1 ], BuildingFillZ ); } - if(WindsClockwise){ + if(!WindsClockwise){ for( int32 PointIndex = 0; PointIndex < Building.BuildingPoints.Num(); PointIndex++ ) { BPositions.Add( FVector(Building.BuildingPoints[PointIndex], BuildingFillZ) );