That_Guy
(That Guy)
January 31, 2020, 4:11pm
1
How do I either give the PostProcess a Collision Radius, or disable the collision entirely (Through Code).
The post process is being created in editor, then I am trying to build the level.
The collision does not matter to me as I am making the Volume Unbound.
PostProcessVolume =
GWorld->SpawnActor(APostProcessVolume::StaticClass(),
FVector::ZeroVector,
FRotator::ZeroRotator);
MaselinoM
(Maselino)
December 4, 2023, 12:49pm
2
I have run into the same error by trying to create a blueprint of a custom class inheriting AVolume, which PostProcessVolume also inherits from.
The post here c++ - How to create a blueprint that extends the volume(like physic volume) in UE5? - Stack Overflow suggests that you cannot just create a new volume, but it needs to be instantiated by its specific factory (UFactory | Unreal Engine 5.2 Documentation ).
In the FPlacementModeModule.cpp of Unreal you can find:
UActorFactory* PPFactory = GEditor
->FindActorFactoryByClassForActorClass(UActorFactoryBoxVolume::StaticClass(), APostProcessVolume::StaticClass());
After that you might be able to instantiate your PostProcessVolume with that factory, I haven’t tried this myself though.
3dRaven
(3dRaven)
December 4, 2023, 2:21pm
3
Can confirm it works without crashing the editor
void ACustomVolume::BeginPlay() {
Super::BeginPlay();
FActorSpawnParameters p;
UActorFactory* PPFactory = GEditor->FindActorFactoryByClassForActorClass(UActorFactoryBoxVolume::StaticClass(), APostProcessVolume::StaticClass());
PostProcessVolume = (APostProcessVolume*) PPFactory->CreateActor(APostProcessVolume::StaticClass(), GetLevel(), FTransform::Identity, p);
PostProcessVolume->SetActorHiddenInGame(false);
}
Spawns a post process volume into the editor on play.
It has a name and transform but the brush component for some reason is not visible in the viewport. Will have to feed it a post process material to see if it changes the scene visually.
Though I did find another post regarding the same subject and the staff replied that stuff like post processing volumes should be made in the editor with the normal tools.
Because volumes are defined using a BSP BrushComponent, which is very hard to build from code, this isn’t really something we support. You might be better off applying your postprocess changes to the cameracomponent instead.
1 Like