packaging fix

This commit is contained in:
Oleg Petruny 2025-04-25 07:41:05 +02:00
parent 78005d450c
commit 6619855580
8 changed files with 38 additions and 21 deletions

Binary file not shown.

View File

@ -7,12 +7,18 @@ public class Lost_Edge : ModuleRules
public Lost_Edge(ReadOnlyTargetRules Target) : base(Target) public Lost_Edge(ReadOnlyTargetRules Target) : base(Target)
{ {
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
//MinCpuArchX64 = MinimumCpuArchitectureX64.AVX2;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" });
PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor", PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor",
"LevelSequence", "MovieScene", "HTTP", "Json", "ApplicationCore", "ProceduralMeshComponent", "Landscape", "MeshDescription", "StaticMeshDescription", "LevelSequence", "MovieScene", "HTTP", "Json", "ApplicationCore", "ProceduralMeshComponent", "Landscape", }); // "Slate", "SlateCore"
"AssetRegistry", "UnrealEd", "LevelEditor" }); // "Slate", "SlateCore"
if (Target.bBuildEditor)
{
PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "LevelEditor",
"MeshDescription", "StaticMeshDescription", "AssetRegistry" });
}
// UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false"))); // UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false")));
// GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1")); // GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1"));

View File

@ -2,19 +2,21 @@
#include "GrassGenerator.h" #include "GrassGenerator.h"
#include "AssetRegistry/AssetRegistryModule.h"
#include "Components/BoxComponent.h" #include "Components/BoxComponent.h"
#include "Editor/EditorEngine.h" #include "ProceduralMeshComponent.h"
#if WITH_EDITOR
#include "AssetRegistry/AssetRegistryModule.h"
#include "Engine/SkyLight.h" #include "Engine/SkyLight.h"
#include "Engine/StaticMeshActor.h" #include "Engine/StaticMeshActor.h"
#include "Landscape.h"
#include "LandscapeComponent.h"
#include "LevelEditorSubsystem.h"
#include "MeshDescription.h" #include "MeshDescription.h"
#include "PhysicalMaterials/PhysicalMaterial.h" #include "PhysicalMaterials/PhysicalMaterial.h"
#include "ProceduralMeshComponent.h"
#include "ProceduralMeshConversion.h" #include "ProceduralMeshConversion.h"
#include "StaticMeshDescription.h" #include "StaticMeshDescription.h"
#include "Editor/EditorEngine.h"
#include "LevelEditorSubsystem.h"
#include "Landscape.h"
#include "LandscapeComponent.h"
#endif
AGrassGenerator::AGrassGenerator() AGrassGenerator::AGrassGenerator()
{ {
@ -32,6 +34,7 @@ void AGrassGenerator::PostLoad()
Update(); Update();
} }
#if WITH_EDITOR
void AGrassGenerator::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) void AGrassGenerator::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{ {
Super::PostEditChangeProperty(PropertyChangedEvent); Super::PostEditChangeProperty(PropertyChangedEvent);
@ -41,9 +44,11 @@ void AGrassGenerator::PostEditChangeProperty(FPropertyChangedEvent& PropertyChan
// || PropertyChangedEvent.GetPropertyName() == TEXT("Tile Size")) // || PropertyChangedEvent.GetPropertyName() == TEXT("Tile Size"))
// Update(); // Update();
} }
#endif
void AGrassGenerator::Generate() void AGrassGenerator::Generate()
{ {
#if WITH_EDITOR
Clear(); Clear();
FVector loc = GetActorLocation(); FVector loc = GetActorLocation();
@ -177,16 +182,20 @@ void AGrassGenerator::Generate()
mesh->CreateMeshSection(sectionsCount++, vertices, triangles, normals, UVs, {}, {}, false); mesh->CreateMeshSection(sectionsCount++, vertices, triangles, normals, UVs, {}, {}, false);
Update(); Update();
#endif
} }
void AGrassGenerator::Clear() void AGrassGenerator::Clear()
{ {
#if WITH_EDITOR
mesh->ClearAllMeshSections(); mesh->ClearAllMeshSections();
sectionsCount = 0; sectionsCount = 0;
#endif
} }
void AGrassGenerator::Export() void AGrassGenerator::Export()
{ {
#if WITH_EDITOR
const FString actorName = GetName(); const FString actorName = GetName();
const FString levelName = GetWorld()->GetMapName().RightChop(2); const FString levelName = GetWorld()->GetMapName().RightChop(2);
const FString levelPath = FPaths::GetPath(GEditor->GetEditorSubsystem<ULevelEditorSubsystem>()->GetCurrentLevel()->GetPathName()); const FString levelPath = FPaths::GetPath(GEditor->GetEditorSubsystem<ULevelEditorSubsystem>()->GetCurrentLevel()->GetPathName());
@ -205,9 +214,7 @@ void AGrassGenerator::Export()
smeshDesc->SetMeshDescription(meshDesc); smeshDesc->SetMeshDescription(meshDesc);
smesh->BuildFromStaticMeshDescriptions({ smeshDesc }, false, true); smesh->BuildFromStaticMeshDescriptions({ smeshDesc }, false, true);
smesh->GetStaticMaterials().Add({ grassMaterial.LoadSynchronous() }); smesh->GetStaticMaterials().Add({ grassMaterial.LoadSynchronous() });
#if WITH_EDITOR
smesh->PostEditChange(); smesh->PostEditChange();
#endif
smesh->MarkPackageDirty(); smesh->MarkPackageDirty();
FAssetRegistryModule::AssetCreated(smesh); FAssetRegistryModule::AssetCreated(smesh);
@ -225,12 +232,15 @@ void AGrassGenerator::Export()
GEditor->SelectNone(false, true); GEditor->SelectNone(false, true);
GEditor->SelectActor(smeshActor, true, true); GEditor->SelectActor(smeshActor, true, true);
GEditor->RedrawAllViewports(); GEditor->RedrawAllViewports();
#endif
} }
void AGrassGenerator::Update() void AGrassGenerator::Update()
{ {
#if WITH_EDITOR
areaBrush->SetBoxExtent({ tileCount.X * tileSize * 0.5, tileCount.Y * tileSize * 0.5, 200 }, false); areaBrush->SetBoxExtent({ tileCount.X * tileSize * 0.5, tileCount.Y * tileSize * 0.5, 200 }, false);
mesh->SetMaterial(0, grassMaterial.LoadSynchronous()); mesh->SetMaterial(0, grassMaterial.LoadSynchronous());
//for(int32 i = 0; i < sectionsCount; ++i) //for(int32 i = 0; i < sectionsCount; ++i)
// mesh->SetMaterSetMaterial(i, grassMaterial.LoadSynchronous()); // mesh->SetMaterSetMaterial(i, grassMaterial.LoadSynchronous());
#endif
} }

View File

@ -6,7 +6,8 @@ public class Lost_EdgeShaders : ModuleRules
{ {
public Lost_EdgeShaders(ReadOnlyTargetRules Target) : base(Target) public Lost_EdgeShaders(ReadOnlyTargetRules Target) : base(Target)
{ {
bUsePrecompiled = true; //bPrecompile = true;
//bUsePrecompiled = true;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { }); PublicDependencyModuleNames.AddRange(new string[] { });
PrivateDependencyModuleNames.AddRange(new string[] { "Core", PrivateDependencyModuleNames.AddRange(new string[] { "Core",