DefaultProfile

DefaultProfile

#Overview

name: DefaultProfile

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 19 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DefaultProfile is to designate a specific skin weight profile as the default for a skeletal mesh in Unreal Engine 5. This variable is primarily used in the animation system, specifically for managing skin weight profiles in skeletal meshes.

DefaultProfile is used in several Unreal Engine subsystems and modules, including:

  1. Animation system (IKRig plugin)
  2. Customizable Object system (Mutable plugin)
  3. Persona editor
  4. Skeletal mesh rendering and import

The value of this variable is typically set in the editor, either through the Persona editor interface or during the import process of skeletal meshes. It can also be modified programmatically.

DefaultProfile often interacts with other variables, such as:

  1. DefaultProfileFromLODIndex: Determines from which LOD index the default profile should be applied.
  2. AssetViewerProfileIndex: Used in conjunction with DefaultProfile for environment map loading in preview scenes.

Developers should be aware of the following when using this variable:

  1. Only one profile should be marked as the default for a skeletal mesh.
  2. The default profile affects which skin weights are used for rendering and physics calculations.
  3. It can impact performance and memory usage, especially when working with multiple LODs.

Best practices when using DefaultProfile include:

  1. Carefully consider which profile should be the default, as it affects the base appearance of the skeletal mesh.
  2. Use in conjunction with DefaultProfileFromLODIndex to optimize performance for different LOD levels.
  3. Ensure that the default profile is compatible with all LODs of the skeletal mesh.
  4. When importing new skin weight profiles, consider whether they should replace the current default profile.
  5. In editor tools and customizations, implement checks to prevent multiple profiles from being set as default simultaneously.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:194, section: [BlueprintEditor.Favorites]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Animation/IKRig/Source/IKRigEditor/Private/RetargetEditor/SRetargetAnimAssetsWindow.cpp:586

Scope (from outer to inner):

file
function     FRetargetPoseViewportClient::FRetargetPoseViewportClient

Source code excerpt:

	// add a skylight so that models are visible from all angles
	// TODO, why isn't this working?
	FPreviewSceneProfile& DefaultProfile = UAssetViewerSettings::Get()->Profiles[GetMutableDefault<UEditorPerProjectUserSettings>()->AssetViewerProfileIndex];
	DefaultProfile.LoadEnvironmentMap();
	UTextureCube* CubeMap = DefaultProfile.EnvironmentCubeMap.Get();
	PreviewScene->SkyLight->SetVisibility(true, false);
	PreviewScene->SetSkyCubemap(CubeMap);
	PreviewScene->SetSkyBrightness(1.f); // tried up to 250... nothing

	// setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Internal/MuCO/CustomizableObjectPrivate.h:464

Scope (from outer to inner):

file
function     FMutableSkinWeightProfileInfo

Source code excerpt:


	FMutableSkinWeightProfileInfo(FName InName, bool InDefaultProfile, int8 InDefaultProfileFromLODIndex) : Name(InName),
	DefaultProfile(InDefaultProfile), DefaultProfileFromLODIndex(InDefaultProfileFromLODIndex) {};

	UPROPERTY()
	FName Name;

	UPROPERTY()
	bool DefaultProfile = false;

	UPROPERTY(meta = (ClampMin = 0))
	int8 DefaultProfileFromLODIndex = 0;

	bool operator==(const FMutableSkinWeightProfileInfo& Other) const;

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableObject.cpp:2486

Scope (from outer to inner):

file
function     FArchive& operator<<

Source code excerpt:

{
	Ar << Info.Name;
	Ar << Info.DefaultProfile;
	Ar << Info.DefaultProfileFromLODIndex;

	return Ar;
}

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObject/Private/MuCO/CustomizableObjectInstance.cpp:4754

Scope (from outer to inner):

file
function     bool UCustomizableInstancePrivate::BuildOrCopyRenderData

Source code excerpt:

					if (!ExistingProfile)
					{
						SkeletalMesh->AddSkinWeightProfile({ Profile.Name, Profile.DefaultProfile, Profile.DefaultProfileFromLODIndex });
					}

					UnrealConversionUtils::CopyMutableSkinWeightProfilesBuffers(
						LODResource,
						Profile.Name,
						MutableMeshVertexBuffers,

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObjectEditor/Private/MuCOE/GenerateMutableSource/GenerateMutableSourceMesh.cpp:1489

Scope (from outer to inner):

file
function     mu::MeshPtr ConvertSkeletalMeshToMutable

Source code excerpt:

			const FName PlatformName = *GenerationContext.Options.TargetPlatform->PlatformName();
			FMutableSkinWeightProfileInfo& MutSkinWeightProfileInfo = GenerationContext.SkinWeightProfilesInfo[ProfileIndex];
			MutSkinWeightProfileInfo.DefaultProfile = MutSkinWeightProfileInfo.DefaultProfile || Profile.DefaultProfile.GetValueForPlatform(PlatformName);
			MutSkinWeightProfileInfo.DefaultProfileFromLODIndex = FMath::Min(MutSkinWeightProfileInfo.DefaultProfileFromLODIndex, Profile.DefaultProfileFromLODIndex.GetValueForPlatform(PlatformName));

			// Set up SkinWeightPRofile BufferData
			const int32 ElementSize = sizeof(int32) + sizeof(FBoneIndexType) + BoneWeightTypeSizeBytes;
			const int32 ChannelCount = 3;
			const MESH_BUFFER_SEMANTIC Semantics[ChannelCount] = { MBS_OTHER, MBS_BONEINDICES, MBS_BONEWEIGHTS };

#Loc: <Workspace>/Engine/Source/Editor/Persona/Private/SkinWeightProfileCustomization.cpp:162

Scope (from outer to inner):

file
function     void FSkinWeightProfileCustomization::CustomizeChildren

Source code excerpt:

				];
			}
			// Customize the DefaultProfile property to make sure only one profile is marked as the default loaded one
			else if (ChildProperty->GetProperty()->GetFName() == GET_MEMBER_NAME_CHECKED(FSkinWeightProfileInfo, DefaultProfile))
			{
				IDetailPropertyRow& Row = ChildBuilder.AddProperty(ChildProperty.ToSharedRef());

				TAttribute<bool> Attribute;
				Attribute.BindRaw(this, &FSkinWeightProfileCustomization::CheckAnyOtherProfileMarkedAsDefault);
				Row.IsEnabled(Attribute);

#Loc: <Workspace>/Engine/Source/Editor/Persona/Private/SkinWeightProfileCustomization.cpp:479

Scope (from outer to inner):

file
function     bool FSkinWeightProfileCustomization::CheckAnyOtherProfileMarkedAsDefault

Source code excerpt:

		{
			// Check if a profile other than the current one is marked to be loaded by default
			if ((LastKnownProfileName != ProfileInfo.Name) && ProfileInfo.DefaultProfile.Default)
			{
				return false;
			}
		}
	}

#Loc: <Workspace>/Engine/Source/Editor/Persona/Private/SkinWeightProfileCustomization.cpp:499

Scope (from outer to inner):

file
function     bool FSkinWeightProfileCustomization::IsProfileMarkedAsDefault

Source code excerpt:

		});

		if (ProfilePtr && ProfilePtr->DefaultProfile.Default)
		{
			return true;
		}
	}

	return false;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SkinWeightsUtilities.cpp:315

Scope (from outer to inner):

file
function     bool FSkinWeightsUtilities::ImportAlternateSkinWeight

Source code excerpt:

				{
					FSkinWeightProfileInfo SkeletalMeshProfile;
					SkeletalMeshProfile.DefaultProfile = (SkeletalMesh->GetNumSkinWeightProfiles() == 0);
					SkeletalMeshProfile.DefaultProfileFromLODIndex = TargetLODIndex;
					SkeletalMeshProfile.Name = ProfileName;
					SkeletalMeshProfile.PerLODSourceFiles.Add(TargetLODIndex, UAssetImportData::SanitizeImportFilename(AbsoluteFilePath, SkeletalMesh->GetOutermost()));
					SkeletalMesh->AddSkinWeightProfile(SkeletalMeshProfile);

					Profile = &SkeletalMeshProfile;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/PhysicsConstraintTemplate.h:77

Scope (from outer to inner):

file
class        class UPhysicsConstraintTemplate : public UObject
function     void ApplyConstraintProfile

Source code excerpt:

		if (ProfileName == NAME_None)
		{
			CI.CopyProfilePropertiesFrom(DefaultProfile);
			bFound = true;
		}
		else
		{
			for(const FPhysicsConstraintProfileHandle& Handle : ProfileHandles)
			{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/PhysicsConstraintTemplate.h:95

Scope (from outer to inner):

file
class        class UPhysicsConstraintTemplate : public UObject
function     void ApplyConstraintProfile

Source code excerpt:

		if(!bFound && bDefaultIfNotFound)
		{
			CI.CopyProfilePropertiesFrom(DefaultProfile);
		}
	}

	/** 
	 * Returns the properties associated with the named constraint profile. If the profile isn't found 
	 * it returns the default profile properties.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/PhysicsConstraintTemplate.h:115

Scope (from outer to inner):

file
class        class UPhysicsConstraintTemplate : public UObject
function     const FConstraintProfileProperties& GetConstraintProfilePropertiesOrDefault

Source code excerpt:

			}
		}
		return DefaultProfile;
	}

#if WITH_EDITOR
	/** Copy constraint instance into default profile.*/
	void SetDefaultProfile(FConstraintInstance& CI)
	{
		DefaultProfile = CI.ProfileInstance;
	}


	virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) override;
	virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/PhysicsConstraintTemplate.h:145

Scope (from outer to inner):

file
class        class UPhysicsConstraintTemplate : public UObject

Source code excerpt:

	/** When no profile is selected, use these settings. Only needed in editor as we serialize it into DefaultInstance on save*/
	UPROPERTY(transient)
	FConstraintProfileProperties DefaultProfile;


public:	//DEPRECATED
#if WITH_EDITORONLY_DATA
	UPROPERTY()
	FName JointName_DEPRECATED;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/SkinWeightProfile.cpp:276

Scope (from outer to inner):

file
function     void FSkinWeightProfilesData::OverrideBaseBufferSkinWeightData
lambda-function

Source code excerpt:

				if (GSkinWeightProfilesDefaultLODOverride >= 0)
				{
					return (ProfileInfo.DefaultProfile.Default && LODIndex >= GSkinWeightProfilesDefaultLODOverride);
				}

				// Otherwise check if this profile is set as default and the current LOD index is applicable
				return (ProfileInfo.DefaultProfile.Default && LODIndex >= ProfileInfo.DefaultProfileFromLODIndex.Default);
			});
		}

		bool bProfileSet = false;
		// If we found a profile try and find the override skin weights and apply if found
		if (DefaultProfileIndex != INDEX_NONE)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/SkinWeightProfile.cpp:325

Scope (from outer to inner):

file
function     void FSkinWeightProfilesData::SetDynamicDefaultSkinWeightProfile
lambda-function

Source code excerpt:

			if (GSkinWeightProfilesDefaultLODOverride >= 0)
			{
				return (ProfileInfo.DefaultProfile.Default && LODIndex >= GSkinWeightProfilesDefaultLODOverride);
			}

			// Otherwise check if this profile is set as default and the current LOD index is applicable
			return (ProfileInfo.DefaultProfile.Default && LODIndex >= ProfileInfo.DefaultProfileFromLODIndex.Default);
		});

		bool bProfileSet = false;
		// If we found a profile try and find the override skin weights and apply if found
		if (DefaultProfileIndex != INDEX_NONE)
		{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicsConstraintTemplate.cpp:35

Scope (from outer to inner):

file
function     void UPhysicsConstraintTemplate::Serialize

Source code excerpt:

	if(Ar.IsSaving() && !Ar.IsTransacting())
	{
		DefaultInstance.ProfileInstance = DefaultProfile;
	}
#endif

	Super::Serialize(Ar);

	// If old content, copy properties out of setup into instance

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicsConstraintTemplate.cpp:52

Scope (from outer to inner):

file
function     void UPhysicsConstraintTemplate::Serialize

Source code excerpt:

		if (Ar.IsLoading())
		{
			DefaultProfile = DefaultInstance.ProfileInstance;
		}
#if WITH_EDITOR
		else if(Ar.IsSaving())
		{
			DefaultInstance.ProfileInstance = CurrentProfile;	//recover their settings before we saved
		}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicsConstraintTemplate.cpp:81

Scope (from outer to inner):

file
function     void UPhysicsConstraintTemplate::UpdateProfileInstance

Source code excerpt:

	if(CurrentProfileName == NAME_None)
	{
		DefaultProfile = DefaultInstance.ProfileInstance;
	}
	else
	{
		for (FPhysicsConstraintProfileHandle& ProfileHandle : ProfileHandles)
		{
			if (ProfileHandle.ProfileName == CurrentProfileName)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Animation/SkinWeightProfile.h:42

Scope: file

Source code excerpt:

	/** Whether or not this Profile should be considered the Default loaded for specific LODs rather than the original Skin Weights of the Skeletal Mesh */
	UPROPERTY(EditAnywhere, Category = SkinWeights)
	FPerPlatformBool DefaultProfile;

	/** When DefaultProfile is set any LOD below this LOD Index will override the Skin Weights of the Skeletal Mesh with the Skin Weights from this Profile */
	UPROPERTY(EditAnywhere, Category = SkinWeights, meta=(EditCondition="DefaultProfile", ClampMin=0, DisplayName = "Default Profile from LOD Index"))
	FPerPlatformInt DefaultProfileFromLODIndex;
	
#if WITH_EDITORONLY_DATA
	UPROPERTY(VisibleAnywhere, Category = SkinWeights)
	TMap<int32, FString> PerLODSourceFiles;