mirror of
https://github.com/Eragon-Brisingr/UShaderLab.git
synced 2026-09-15 23:04:37 +00:00
Support UMaterial all property settings, enhance VSCode code-snippets
This commit is contained in:
@@ -5,10 +5,12 @@
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "MaterialShared.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "Misc/CoreDelegates.h"
|
||||
#include "Misc/Paths.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "ShaderCore.h"
|
||||
#include "ShaderLabGraphBuilder.h"
|
||||
#include "ShaderLabIDEPrepare.h"
|
||||
#include "ShaderLabMaterialInstanceConstant.h"
|
||||
#include "ShaderLabMaterialRegistry.h"
|
||||
#include "ShaderLabModel.h"
|
||||
@@ -148,6 +150,12 @@ public:
|
||||
// module loaded for all uncooked runs) is the fix for invisible materials under `-game`.
|
||||
BuildHandle = FShaderLabMaterialRegistry::Get().OnBuildMaterial().AddStatic(&BuildAndCompile);
|
||||
|
||||
// First-launch convenience: auto-generate the .usl IDE authoring assets if the project is missing them
|
||||
// (a fresh clone lacks .vscode — it is git-ignored). Deferred to post-engine-init so shader-source
|
||||
// mappings (added above) and UMaterial reflection are ready; the callback self-gates to an interactive
|
||||
// editor session (no cook / -game / commandlet / unattended).
|
||||
PostEngineInitHandle = FCoreDelegates::GetOnPostEngineInit().AddStatic(&ShaderLabIDE_EnsureGeneratedIfMissing);
|
||||
|
||||
UE_LOG(LogShaderLabBuilder, Log, TEXT("ShaderLabBuilder module started."));
|
||||
}
|
||||
|
||||
@@ -158,10 +166,16 @@ public:
|
||||
FShaderLabMaterialRegistry::Get().OnBuildMaterial().Remove(BuildHandle);
|
||||
BuildHandle.Reset();
|
||||
}
|
||||
if (PostEngineInitHandle.IsValid())
|
||||
{
|
||||
FCoreDelegates::GetOnPostEngineInit().Remove(PostEngineInitHandle);
|
||||
PostEngineInitHandle.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
FDelegateHandle BuildHandle;
|
||||
FDelegateHandle PostEngineInitHandle;
|
||||
};
|
||||
|
||||
IMPLEMENT_MODULE(FShaderLabBuilderModule, UShaderLabBuilder)
|
||||
|
||||
Reference in New Issue
Block a user