HairCardAssetPathFormat
HairCardAssetPathFormat
#Overview
name: HairCardAssetPathFormat
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of HairCardAssetPathFormat is to define the format for the directory path where hair card assets will be saved in the Unreal Engine 5 Hair Card Generator system.
This setting variable is primarily used by the Hair Card Generator plugin, which is an experimental feature in Unreal Engine 5 for generating hair card assets. It is part of the HairCardGeneratorEditor module within this plugin.
The value of this variable is set in the UHairCardGeneratorEditorSettings constructor, where it is initialized with the default value of “{groom_dir}”. This suggests that by default, hair card assets will be saved in the same directory as the groom asset they are associated with.
The HairCardAssetPathFormat variable interacts with other variables in the system, particularly the HairCardAssetNameFormat. While HairCardAssetPathFormat defines the directory structure, HairCardAssetNameFormat defines the naming convention for the individual asset files.
Developers must be aware that this variable uses a format string with placeholders. The “{groom_dir}” placeholder is replaced with the actual directory path of the associated groom asset when generating hair cards. Other placeholders might be available for more complex path formatting.
Best practices when using this variable include:
- Ensuring that the format string results in valid and sensible directory paths.
- Considering the project’s asset organization when modifying this value.
- Being consistent with the path format across different groom assets to maintain a clean project structure.
- Avoiding characters or structures that might cause issues on different operating systems.
- Remembering that this setting affects all hair card generations in the project, so changes should be made thoughtfully.
Developers should also note that this is a config property, meaning it can be adjusted in the project settings, allowing for project-wide customization of hair card asset organization.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Experimental/HairCardGenerator/Config/Editor.ini:3, section: [/Script/HairCardGeneratorEditor.HairCardGeneratorEditorSettings]
- INI Section:
/Script/HairCardGeneratorEditor.HairCardGeneratorEditorSettings
- Raw value:
"{groom_dir}/{groom_name}_LOD{lod}"
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/HairCardGenerator/Source/HairCardGeneratorEditor/Private/HairCardGeneratorEditorSettings.cpp:6
Scope (from outer to inner):
file
function UHairCardGeneratorEditorSettings::UHairCardGeneratorEditorSettings
Source code excerpt:
UHairCardGeneratorEditorSettings::UHairCardGeneratorEditorSettings()
: HairCardAssetNameFormat(TEXT("{groom_name}_LOD{lod}"))
, HairCardAssetPathFormat(TEXT("{groom_dir}"))
{
}
#Loc: <Workspace>/Engine/Plugins/Experimental/HairCardGenerator/Source/HairCardGeneratorEditor/Private/HairCardGeneratorEditorSettings.h:22
Scope (from outer to inner):
file
class class UHairCardGeneratorEditorSettings : public UObject
Source code excerpt:
UPROPERTY(Config)
FString HairCardAssetPathFormat;
};
#Loc: <Workspace>/Engine/Plugins/Experimental/HairCardGenerator/Source/HairCardGeneratorEditor/Private/HairCardGeneratorPluginSettings.cpp:148
Scope (from outer to inner):
file
function FString HairCardSettings_Helpers::GetDefaultPathForHairCards
Source code excerpt:
FormatArgs.Add(TEXT("lod"), LODIndex);
FString DirPath = FText::Format(FText::FromString(ConfigSettings->HairCardAssetPathFormat), FormatArgs).ToString();
FPaths::NormalizeDirectoryName(DirPath);
FPaths::RemoveDuplicateSlashes(DirPath);
return DirPath;
}