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)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
//MinCpuArchX64 = MinimumCpuArchitectureX64.AVX2;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" });
PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor",
"LevelSequence", "MovieScene", "HTTP", "Json", "ApplicationCore", "ProceduralMeshComponent", "Landscape", "MeshDescription", "StaticMeshDescription",
"AssetRegistry", "UnrealEd", "LevelEditor" }); // "Slate", "SlateCore"
"LevelSequence", "MovieScene", "HTTP", "Json", "ApplicationCore", "ProceduralMeshComponent", "Landscape", }); // "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")));
// GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1"));

View File

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

View File

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