Init repo

This commit is contained in:
Eragon-Brisingr
2026-06-30 16:30:49 +08:00
parent a861b4680b
commit 64354806bd
4 changed files with 30 additions and 18 deletions

View File

@@ -4,6 +4,7 @@
#include "Engine/Engine.h"
#include "IDirectoryWatcher.h"
#include "Interfaces/IPluginManager.h"
#include "MaterialShared.h"
#include "Materials/Material.h"
#include "Misc/Paths.h"
#include "Modules/ModuleManager.h"
@@ -31,7 +32,15 @@ namespace
}
return;
}
// Recompile for rendering / editor preview (async).
// Recompile the base AND propagate to everything that depends on it. A bare PostEditChange
// recompiles only the base shell; the instances carry their own static-permutation shader maps
// (and the level components render those), so on a hot-reload they must be recompiled and
// re-pushed too. FMaterialUpdateContext does exactly that on scope exit: recompile the listed
// material, then recache every dependent instance and refresh the components/viewports using it.
FMaterialUpdateContext UpdateContext;
UpdateContext.AddMaterial(&Material);
Material.PreEditChange(nullptr);
Material.PostEditChange();
}
}