Skip to content

Instantly share code, notes, and snippets.

View aquanox's full-sized avatar

Valentin Plyasinov aquanox

View GitHub Profile
@aquanox
aquanox / ReloadSoundEffect.cpp
Created April 20, 2025 12:01
UE Reload Sound Effect
// module startup
FCoreUObjectDelegates::ReloadCompleteDelegate.AddRaw( this, &FMyEditorModule::HandleReloadFinished );
// module shutdown
FCoreUObjectDelegates::ReloadCompleteDelegate.RemoveAll( this );
void FMyEditorModule::HandleReloadFinished( EReloadCompleteReason Reason )
{
@aquanox
aquanox / DefaultEvents.cpp
Last active April 14, 2025 08:34
Smart Default Event Nodes
// Normally it is possible to register each member function to be spawned as default like this
// But it does not work with ForceAsFunction or BlueprintNativeEvents that return value that spawn function graphs
// FKismetEditorUtilities::RegisterAutoGeneratedDefaultEvent(this, UDynamicAssetFilter::StaticClass(), GET_FUNCTION_NAME_CHECKED(UDynamicAssetFilter, K2_FilterAsset));
//
// By utilizig RegisterOnBlueprintCreatedCallback can track new blueprint creation and do any stuff to blueprints
// for example - finding BlueprintDefaultEvent meta and creating default node or graph for Blueprint(Native|Implementable)Event
// With this hook any BNE/BIE with BlueprintDefaultEvent will be generated into default node or overridden by default function
// No more need to manually register each function
void MODULENAME::RegisterBlueprintDefaultEvents()
{