EditProfiles
EditProfiles
#Overview
name: EditProfiles
The value of this variable can be defined or overridden in .ini config files. 4
.ini config files referencing this setting variable.
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of EditProfiles is to provide game-specific overrides for engine collision profiles in Unreal Engine 5. It allows developers to customize collision settings for their specific game project without modifying the engine’s default profiles.
This setting variable is primarily used by the Collision Profile system, which is part of the Engine module in Unreal Engine 5. It is specifically utilized in the CollisionProfile class and the CollisionProfileDetails customization in the Editor.
The value of EditProfiles is set in the project’s configuration files, as indicated by the UPROPERTY(globalconfig) decorator in the UCollisionProfile class definition.
EditProfiles interacts with other collision-related variables such as Profiles, DefaultChannelResponses, and ProfileRedirects. It is used to override or extend the default collision profiles defined in the engine.
Developers must be aware that EditProfiles allows for project-specific customization of collision profiles. This means that changes made using EditProfiles will only affect the current game project and not the engine’s default profiles.
Best practices when using this variable include:
- Use EditProfiles to create game-specific collision profiles rather than modifying engine defaults.
- Ensure that any custom profiles added through EditProfiles are properly documented and maintained.
- Be cautious when modifying existing profiles, as it may affect game behavior in unexpected ways.
- Regularly review and update custom profiles as the game’s requirements evolve.
- Use the Collision Profile editor in the Unreal Engine editor to manage these custom profiles, rather than modifying configuration files directly.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:210, section: [/Script/Engine.CollisionProfile]
- INI Section:
/Script/Engine.CollisionProfile
- Raw value:
(Name="BlockAll",CustomResponses=((Channel="Lyra_TraceChannel_Interaction"),(Channel="Lyra_TraceChannel_Weapon"),(Channel="Lyra_TraceChannel_Weapon_Capsule"),(Channel="Lyra_TraceChannel_Weapon_Multi")))
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:211, section: [/Script/Engine.CollisionProfile]
- INI Section:
/Script/Engine.CollisionProfile
- Raw value:
(Name="BlockAllDynamic",CustomResponses=((Channel="Lyra_TraceChannel_Interaction"),(Channel="Lyra_TraceChannel_Weapon"),(Channel="Lyra_TraceChannel_Weapon_Capsule"),(Channel="Lyra_TraceChannel_Weapon_Multi")))
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:212, section: [/Script/Engine.CollisionProfile]
- INI Section:
/Script/Engine.CollisionProfile
- Raw value:
(Name="InvisibleWall",CustomResponses=((Channel="Lyra_TraceChannel_Interaction"),(Channel="Lyra_TraceChannel_Weapon"),(Channel="Lyra_TraceChannel_Weapon_Capsule"),(Channel="Lyra_TraceChannel_Weapon_Multi")))
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:213, section: [/Script/Engine.CollisionProfile]
- INI Section:
/Script/Engine.CollisionProfile
- Raw value:
(Name="InvisibleWallDynamic",CustomResponses=((Channel="Lyra_TraceChannel_Interaction"),(Channel="Lyra_TraceChannel_Weapon"),(Channel="Lyra_TraceChannel_Weapon_Capsule"),(Channel="Lyra_TraceChannel_Weapon_Multi")))
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/CollisionProfileDetails.cpp:1736
Scope (from outer to inner):
file
function void FCollisionProfileDetails::CommitProfileChange
Source code excerpt:
SourceProfile.HelpMessage = NewProfile.HelpMessage;
// now update EditProfiles
// look at the saved profile, and collect different responses first
FCollisionResponseTemplate & SavedProfile = SavedData.Profiles[ProfileIndex];
TArray<FResponseChannel> NewCustomResponses;
struct FFindByName
{
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/CollisionProfileDetails.cpp:1771
Scope (from outer to inner):
file
function void FCollisionProfileDetails::CommitProfileChange
Source code excerpt:
if ( NewCustomResponses.Num() > 0 )
{
FCustomProfile * CurrentProfile = CollisionProfile->EditProfiles.FindByPredicate(FFindByName(NewProfile.Name));
if ( !CurrentProfile )
{
// need to add new one, and just copy NewCustomResponses
FCustomProfile NewCustomProfile;
NewCustomProfile.Name = NewProfile.Name;
NewCustomProfile.CustomResponses = NewCustomResponses;
CollisionProfile->EditProfiles.Add(NewCustomProfile);
}
else
{
// need to merge previous list and new list
for (auto & Iter : NewCustomResponses)
{
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/CollisionProfileDetails.cpp:2241
Scope (from outer to inner):
file
function void FCollisionProfileDetails::FCollisionProfileData::Save
Source code excerpt:
Profiles = Profile->Profiles;
DefaultChannelResponses = Profile->DefaultChannelResponses;
EditProfiles = Profile->EditProfiles;
}
//=====================================================================================
#undef LOCTEXT_NAMESPACE
#undef RowWidth_Customization
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/CollisionProfileDetails.h:187
Scope (from outer to inner):
file
class class FCollisionProfileDetails : public IDetailCustomization
Source code excerpt:
void OnProfileListItemDoubleClicked(TSharedPtr< FProfileListItem >);
// this is the data that saves before starting, and creates the EditProfiles based on that.
// this is needed if we do EditProfiles
struct FCollisionProfileData
{
TArray<FCollisionResponseTemplate> Profiles;
TArray<FCustomChannelSetup> DefaultChannelResponses;
TArray<FCustomProfile> EditProfiles;
void Save(UCollisionProfile * Profile);
};
FCollisionProfileData SavedData;
};
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/CollisionProfile.h:173
Scope (from outer to inner):
file
class class UCollisionProfile : public UDeveloperSettings
Source code excerpt:
/** Game-specific overrides to engine profiles */
UPROPERTY(globalconfig)
TArray<FCustomProfile> EditProfiles;
/** Used to handle renaming profiles */
UPROPERTY(globalconfig)
TArray<FRedirector> ProfileRedirects;
/** Used to handle renaming collision channels */
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Collision/CollisionProfile.cpp:549
Scope (from outer to inner):
file
function void UCollisionProfile::LoadProfileConfig
Source code excerpt:
// this does a lot of iteration, but this only happens once loaded, so it's better to be convenient than efficient
// fill up Profiles data
FillProfileData(Profiles, Enum, EditProfiles);
// 3. It loads redirect data - now time to load profile redirect
ProfileRedirectsMap.Empty();
// handle profile redirect here
for(auto Iter = ProfileRedirects.CreateConstIterator(); Iter; ++Iter)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Collision/CollisionProfile.cpp:665
Scope (from outer to inner):
file
function void UCollisionProfile::FillProfileData
Source code excerpt:
LoadCustomResponses(Template, CollisionChannelEnum, Template.CustomResponses);
//---------------------------------------------------------------------------------------
// now load EditProfiles for extra edition of profiles for each game project
// this one, only search the profile and see if it can change values
//---------------------------------------------------------------------------------------
for (auto CustomIter = EditProfileList.CreateIterator(); CustomIter; ++CustomIter)
{
if ( (*CustomIter).Name == Template.Name )
{