p.EnableDynamicPerBodyFilterHacks CVar

Hi, can anyone help me to set p.EnableDynamicPerBodyFilterHacks=1 as a permanent value including final build? Maybe somebody knows why this is set via console? Is there some variable I can set from C++ to enable this feature? I want to dynamically modify collision per skeletal body.

inside BodyInstance.cpp
change

// @HACK Guard to better encapsulate game related hacks introduced into UpdatePhysicsFilterData()
TAutoConsoleVariable<int32> CVarEnableDynamicPerBodyFilterHacks(
	TEXT("p.EnableDynamicPerBodyFilterHacks"), 
	0, 
	TEXT("Enables/Disables the use of a set of game focused hacks - allowing users to modify skel body collision dynamically (changes the behavior of per-body collision filtering)."),
	ECVF_ReadOnly
);

to

// @HACK Guard to better encapsulate game related hacks introduced into UpdatePhysicsFilterData()
TAutoConsoleVariable<int32> CVarEnableDynamicPerBodyFilterHacks(
	TEXT("p.EnableDynamicPerBodyFilterHacks"), 
	1, 
	TEXT("Enables/Disables the use of a set of game focused hacks - allowing users to modify skel body collision dynamically (changes the behavior of per-body collision filtering)."),
	ECVF_ReadOnly
);

Also, if you want to allow changing of this variable from the console, change ECVF_ReadOnly to ECVF_SetByConsole

Optionally, you can also do this in BodyInstance.h:

/** 
	 * @HACK:
	 * These are ONLY used when the 'p.EnableDynamicPerBodyFilterHacks' CVar is set (disabled by default).
	 * Some games need to dynamically modify collision per skeletal body. These provide game code a way to 
	 * do that, until we're able to refactor how skeletal bodies work.
	 */	
	uint8 bHACK_DisableCollisionResponse : 1;
	/* By default, an owning skel mesh component will override the body's collision filter. This will disable that behavior. */	
	uint8 bHACK_DisableSkelComponentFilterOverriding : 1;

to:

/** 
	 * @HACK:
	 * These are ONLY used when the 'p.EnableDynamicPerBodyFilterHacks' CVar is set (disabled by default).
	 * Some games need to dynamically modify collision per skeletal body. These provide game code a way to 
	 * do that, until we're able to refactor how skeletal bodies work.
	 */
	UPROPERTY(EditAnywhere, Category = Physics)
	uint8 bHACK_DisableCollisionResponse : 1;
	/* By default, an owning skel mesh component will override the body's collision filter. This will disable that behavior. */
	UPROPERTY(EditAnywhere, Category = Physics)
	uint8 bHACK_DisableSkelComponentFilterOverriding : 1;

This will allow you to disable the collision response per physics body from blueprint in the physics body settings, and disable the skeletal mesh physics collision settings override for all the physics bodies.