HairCardAssetNameFormat
HairCardAssetNameFormat
#Overview
name: HairCardAssetNameFormat
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 HairCardAssetNameFormat is to define a template for naming hair card assets generated by the Hair Card Generator plugin in Unreal Engine 5. This setting variable is used to create consistent and informative names for hair card assets, which are typically used in the rendering of hair and fur in games and other real-time applications.
This setting variable is primarily used by the Hair Card Generator plugin, which is part of the experimental features in Unreal Engine 5. It is specifically utilized within the HairCardGeneratorEditor module.
The value of this variable is set in the constructor of the UHairCardGeneratorEditorSettings class, with a default value of “{groom_name}_LOD{lod}”. This format string allows for dynamic naming of hair card assets based on the groom asset name and the level of detail (LOD) index.
HairCardAssetNameFormat interacts with another variable called HairCardAssetPathFormat, which is used to determine the directory path for the generated hair card assets.
Developers should be aware that this variable uses a format string with placeholders. The {groom_name} placeholder is replaced with the name of the groom asset, and {lod} is replaced with the LOD index. This allows for flexible and descriptive naming of hair card assets.
Best practices when using this variable include:
- Ensuring the format string includes enough information to uniquely identify each hair card asset.
- Considering including additional placeholders if more specific naming is required (e.g., {variant} for different hair styles).
- Keeping the format consistent across projects to maintain organization and ease of asset management.
- Avoiding characters in the format string that might cause issues with file systems or asset management tools.
- Documenting any changes to the default format to ensure team-wide understanding of the naming convention.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Experimental/HairCardGenerator/Config/Editor.ini:2, section: [/Script/HairCardGeneratorEditor.HairCardGeneratorEditorSettings]
- INI Section:
/Script/HairCardGeneratorEditor.HairCardGeneratorEditorSettings
- Raw value:
"{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:5
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:19
Scope (from outer to inner):
file
class class UHairCardGeneratorEditorSettings : public UObject
Source code excerpt:
UPROPERTY(Config)
FString HairCardAssetNameFormat;
UPROPERTY(Config)
FString HairCardAssetPathFormat;
};
#Loc: <Workspace>/Engine/Plugins/Experimental/HairCardGenerator/Source/HairCardGeneratorEditor/Private/HairCardGeneratorPluginSettings.cpp:120
Scope (from outer to inner):
file
function FString HairCardSettings_Helpers::GetDefaultBaseNameForHairCards
Source code excerpt:
FormatArgs.Add(TEXT("lod"), LODIndex);
return FText::Format(FText::FromString(ConfigSettings->HairCardAssetNameFormat), FormatArgs).ToString();
}
/// Get default output content path for card generation from current groom asset
/// @param GroomAsset The groom asset cards will be generated for
/// @param LODIndex The LOD index for card generation (TODO: This should be removed when multi-lod supported)