IVSmoke 1.0
Loading...
Searching...
No Matches
IVSmokeVisualMaterialPreset.cpp
1// Copyright (c) 2026, Team SDB. All rights reserved.
2
3#include "IVSmokeVisualMaterialPreset.h"
4#include "IVSmoke.h"
5#include "Materials/MaterialInterface.h"
6#include "Materials/Material.h"
7
8#if WITH_EDITOR
9void UIVSmokeVisualMaterialPreset::PostEditChangeProperty(FPropertyChangedEvent& E)
10{
11 Super::PostEditChangeProperty(E);
12
13 const FName PropName = E.Property ? E.Property->GetFName() : NAME_None;
14
15 if (PropName == GET_MEMBER_NAME_CHECKED(UIVSmokeVisualMaterialPreset, SmokeVisualMaterial))
16 {
18 {
19 if (UMaterial* M = SmokeVisualMaterial->GetMaterial())
20 {
21 if (M->MaterialDomain != MD_PostProcess)
22 {
23 UE_LOG(LogIVSmoke, Warning, TEXT("SmokeVisualMaterial must be PostProcess domain"));
24 SmokeVisualMaterial = nullptr;
25 }
26 else
27 {
28 // Ensure shader compilation is complete before rendering
29 SmokeVisualMaterial->EnsureIsComplete();
30 }
31 }
32 }
33 }
34}
35#endif
TObjectPtr< UMaterialInterface > SmokeVisualMaterial