bExportMorphTargets

bExportMorphTargets

#Overview

name: bExportMorphTargets

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

#Summary

#Usage in the C++ source code

The purpose of bExportMorphTargets is to control whether morph targets (also known as blend shapes) should be exported when creating or updating animation sequences from Unreal Engine’s sequencer or other animation export processes.

This setting variable is primarily used in the animation and export systems of Unreal Engine. It is referenced in several plugins and modules, including:

  1. ControlRig
  2. SequencerScripting
  3. MovieSceneTools
  4. UnrealEd (specifically in FBX export options)
  5. LevelSequence

The value of this variable is typically set in export option objects, such as UAnimSeqExportOption and UFbxExportOption. It can be modified through the Unreal Engine editor interface or programmatically in C++ code.

bExportMorphTargets often interacts with other export-related variables, such as:

Developers should be aware that:

  1. Exporting morph targets can increase the size of the exported animation data.
  2. Not all target formats or workflows may support morph target animations.
  3. The export process may be slower when including morph targets.

Best practices when using this variable include:

  1. Only enable morph target export when necessary for your project’s needs.
  2. Consider performance implications when exporting large numbers of morph targets.
  3. Ensure that the target format or workflow supports morph target animations before enabling this option.
  4. Use this option in conjunction with other export settings to achieve the desired result in the exported animation.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:73, section: [/Script/UnrealEd.FbxExportOption]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/ControlRigEditorModule.cpp:1260

Scope (from outer to inner):

file
function     void FControlRigEditorModule::BakeToControlRig
lambda-function

Source code excerpt:

						LevelAnimLinkItem.SkelTrackGuid = ActorTrackGuid;
						LevelAnimLinkItem.PathToAnimSequence = FSoftObjectPath(AnimSequence);
						LevelAnimLinkItem.bExportMorphTargets = true; 
						LevelAnimLinkItem.bExportAttributeCurves = true;
						LevelAnimLinkItem.Interpolation = EAnimInterpolationType::Linear;
						LevelAnimLinkItem.CurveInterpolation = ERichCurveInterpMode::RCIM_Linear;
						LevelAnimLinkItem.bExportMaterialCurves = true;
						LevelAnimLinkItem.bExportTransforms = true;
						LevelAnimLinkItem.bRecordInWorldSpace = false;

#Loc: <Workspace>/Engine/Plugins/MovieScene/SequencerScripting/Source/SequencerScriptingEditor/Private/SequencerTools.cpp:463

Scope (from outer to inner):

file
function     bool USequencerToolsFunctionLibrary::LinkAnimSequence

Source code excerpt:

						}
						LevelAnimLinkItem.PathToAnimSequence = FSoftObjectPath(AnimSequence);
						LevelAnimLinkItem.bExportMorphTargets = ExportOptions->bExportMorphTargets;
						LevelAnimLinkItem.bExportAttributeCurves = ExportOptions->bExportAttributeCurves;
						LevelAnimLinkItem.bExportMaterialCurves = ExportOptions->bExportMaterialCurves;
						LevelAnimLinkItem.bExportTransforms = ExportOptions->bExportTransforms;
						LevelAnimLinkItem.Interpolation = ExportOptions->Interpolation;
						LevelAnimLinkItem.CurveInterpolation = ExportOptions->CurveInterpolation;
						LevelAnimLinkItem.bRecordInWorldSpace = ExportOptions->bRecordInWorldSpace;

#Loc: <Workspace>/Engine/Plugins/MovieScene/SequencerScripting/Source/SequencerScriptingEditor/Private/SequencerTools.cpp:485

Scope (from outer to inner):

file
function     bool USequencerToolsFunctionLibrary::LinkAnimSequence

Source code excerpt:

				LevelAnimLinkItem.SkelTrackGuid = Binding.BindingID;
				LevelAnimLinkItem.PathToAnimSequence = FSoftObjectPath(AnimSequence);
				LevelAnimLinkItem.bExportMorphTargets = ExportOptions->bExportMorphTargets;
				LevelAnimLinkItem.bExportAttributeCurves = ExportOptions->bExportAttributeCurves;
				LevelAnimLinkItem.Interpolation = ExportOptions->Interpolation;
				LevelAnimLinkItem.CurveInterpolation = ExportOptions->CurveInterpolation;
				LevelAnimLinkItem.bExportMaterialCurves = ExportOptions->bExportMaterialCurves;
				LevelAnimLinkItem.bExportTransforms = ExportOptions->bExportTransforms;
				LevelAnimLinkItem.bRecordInWorldSpace = ExportOptions->bRecordInWorldSpace;

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/MovieSceneToolHelpers.cpp:3937

Scope (from outer to inner):

file
function     bool MovieSceneToolHelpers::ExportToAnimSequence
lambda-function

Source code excerpt:

		RecordingSettings.bCheckDeltaTimeAtBeginning = false;
		RecordingSettings.bRecordTransforms = ExportOptions->bExportTransforms;
		RecordingSettings.bRecordMorphTargets = ExportOptions->bExportMorphTargets;
		RecordingSettings.bRecordAttributeCurves = ExportOptions->bExportAttributeCurves;
		RecordingSettings.bRecordMaterialCurves = ExportOptions->bExportMaterialCurves;
		RecordingSettings.bRecordInWorldSpace = ExportOptions->bRecordInWorldSpace;
		RecordingSettings.IncludeAnimationNames = ExportOptions->IncludeAnimationNames;
		RecordingSettings.ExcludeAnimationNames = ExportOptions->ExcludeAnimationNames;
		RecordingSettings.bTransactRecording = ExportOptions->bTransactRecording;

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/SkeletalAnimationTrackEditor.cpp:1307

Scope (from outer to inner):

file
function     void FSkeletalAnimationTrackEditor::OnSequencerSaved

Source code excerpt:

					if (AnimSequence && SkelMeshComp)
					{
						const bool bSavedExportMorphTargets = AnimSeqExportOption->bExportMorphTargets;
						const bool bSavedExportAttributeCurves = AnimSeqExportOption->bExportAttributeCurves;
						const bool bSavedExportMaterialCurves = AnimSeqExportOption->bExportMaterialCurves;
						const bool bSavedExportTransforms = AnimSeqExportOption->bExportTransforms;
						const bool bSavedIncludeComponentTransform = AnimSeqExportOption->bRecordInWorldSpace;
						const bool bSavedEvaluateAllSkeletalMeshComponents = AnimSeqExportOption->bEvaluateAllSkeletalMeshComponents;
						const EAnimInterpolationType SavedInterpolationType = AnimSeqExportOption->Interpolation;
						const ERichCurveInterpMode SavedCurveInterpolationType = AnimSeqExportOption->CurveInterpolation;

						AnimSeqExportOption->bExportMorphTargets = Item.bExportMorphTargets;
						AnimSeqExportOption->bExportAttributeCurves = Item.bExportAttributeCurves;
						AnimSeqExportOption->bExportMaterialCurves = Item.bExportMaterialCurves;
						AnimSeqExportOption->bExportTransforms = Item.bExportTransforms;
						AnimSeqExportOption->bRecordInWorldSpace = Item.bRecordInWorldSpace;
						AnimSeqExportOption->bEvaluateAllSkeletalMeshComponents = Item.bEvaluateAllSkeletalMeshComponents;
						AnimSeqExportOption->Interpolation = Item.Interpolation;

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/SkeletalAnimationTrackEditor.cpp:1327

Scope (from outer to inner):

file
function     void FSkeletalAnimationTrackEditor::OnSequencerSaved

Source code excerpt:

						bool bResult = MovieSceneToolHelpers::ExportToAnimSequence(AnimSequence, AnimSeqExportOption, MovieScene, SequencerPtr.Get(), SkelMeshComp, Template, RootToLocalTransform);

						AnimSeqExportOption->bExportMorphTargets = bSavedExportMorphTargets;
						AnimSeqExportOption->bExportAttributeCurves = bSavedExportAttributeCurves;
						AnimSeqExportOption->bExportMaterialCurves = bSavedExportMaterialCurves;
						AnimSeqExportOption->bExportTransforms = bSavedExportTransforms;
						AnimSeqExportOption->bRecordInWorldSpace = bSavedIncludeComponentTransform;
						AnimSeqExportOption->bEvaluateAllSkeletalMeshComponents = bSavedEvaluateAllSkeletalMeshComponents;
						AnimSeqExportOption->Interpolation = SavedInterpolationType;

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/SkeletalAnimationTrackEditor.cpp:1528

Scope (from outer to inner):

file
function     bool FSkeletalAnimationTrackEditor::CreateAnimationSequence

Source code excerpt:

								}
								LevelAnimLinkItem.PathToAnimSequence = FSoftObjectPath(AnimSequence);
								LevelAnimLinkItem.bExportMorphTargets = AnimSeqExportOption->bExportMorphTargets;
								LevelAnimLinkItem.bExportAttributeCurves = AnimSeqExportOption->bExportAttributeCurves;
								LevelAnimLinkItem.bExportMaterialCurves = AnimSeqExportOption->bExportMaterialCurves;
								LevelAnimLinkItem.bExportTransforms = AnimSeqExportOption->bExportTransforms;
								LevelAnimLinkItem.bRecordInWorldSpace = AnimSeqExportOption->bRecordInWorldSpace;
								LevelAnimLinkItem.bEvaluateAllSkeletalMeshComponents = AnimSeqExportOption->bEvaluateAllSkeletalMeshComponents;
								LevelAnimLinkItem.Interpolation = AnimSeqExportOption->Interpolation;

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/SkeletalAnimationTrackEditor.cpp:1551

Scope (from outer to inner):

file
function     bool FSkeletalAnimationTrackEditor::CreateAnimationSequence

Source code excerpt:

						LevelAnimLinkItem.SkelTrackGuid = Binding;
						LevelAnimLinkItem.PathToAnimSequence = FSoftObjectPath(AnimSequence);
						LevelAnimLinkItem.bExportMorphTargets = AnimSeqExportOption->bExportMorphTargets;
						LevelAnimLinkItem.bExportAttributeCurves = AnimSeqExportOption->bExportAttributeCurves;
						LevelAnimLinkItem.bExportMaterialCurves = AnimSeqExportOption->bExportMaterialCurves;
						LevelAnimLinkItem.bExportTransforms = AnimSeqExportOption->bExportTransforms;
						LevelAnimLinkItem.bRecordInWorldSpace = AnimSeqExportOption->bRecordInWorldSpace;
						LevelAnimLinkItem.bEvaluateAllSkeletalMeshComponents = AnimSeqExportOption->bEvaluateAllSkeletalMeshComponents;
						LevelAnimLinkItem.Interpolation = AnimSeqExportOption->Interpolation;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Exporters/AnimSeqExportOption.h:24

Scope (from outer to inner):

file
class        class UAnimSeqExportOption : public UObject

Source code excerpt:

	/** If enabled, export the morph targets from the animation */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = Export)
	bool bExportMorphTargets = true;

	/** If enabled, export the attribute curves from the animation */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = Export)
	bool bExportAttributeCurves = true;

	/** If enabled, export the material curves from the animation */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Exporters/AnimSeqExportOption.h:73

Scope (from outer to inner):

file
class        class UAnimSeqExportOption : public UObject
function     void ResetToDefault

Source code excerpt:

	{
		bExportTransforms = true;
		bExportMorphTargets = true;
		bExportAttributeCurves = true;
		bExportMaterialCurves = true;
		bRecordInWorldSpace = false;
		Interpolation = EAnimInterpolationType::Linear;
		CurveInterpolation = ERichCurveInterpMode::RCIM_Linear;
		bEvaluateAllSkeletalMeshComponents = true;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Exporters/FbxExportOption.h:76

Scope (from outer to inner):

file
class        class UFbxExportOption : public UObject

Source code excerpt:

	/** If enabled, export the morph targets */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, config, category = SkeletalMesh)
	uint32 bExportMorphTargets : 1;

	/** If enable, the preview mesh link to the exported animations will be also exported. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, config, category = Animation)
	uint32 bExportPreviewMesh : 1;

	/** If enable, Map skeletal actor motion to the root bone of the skeleton. */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxAnimationExport.cpp:96

Scope (from outer to inner):

file
namespace    UnFbx
function     void FFbxExporter::ExportAnimSequenceToFbx

Source code excerpt:

	{
		const UFbxExportOption* ExportOptions = GetExportOptions();
		const bool bExportMorphTargetCurvesInMesh = ExportOptions && ExportOptions->bExportPreviewMesh && ExportOptions->bExportMorphTargets;

		Skeleton->ForEachCurveMetaData([&CustomCurveMap, &BoneNodes, InAnimLayer, bExportMorphTargetCurvesInMesh](const FName& InCurveName, const FCurveMetaData& InMetaData)
		{
			//Only export the custom curve if it is not used in a MorphTarget that will be exported latter on.
			if(!(bExportMorphTargetCurvesInMesh && InMetaData.Type.bMorphtarget))
			{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxExportOption.cpp:24

Scope (from outer to inner):

file
function     UFbxExportOption::UFbxExportOption

Source code excerpt:

	Collision = true;
	bExportSourceMesh = false;
	bExportMorphTargets = true;
	VertexColor = true;
	MapSkeletalMotionToRoot = false;
	bExportLocalTime = true;
	BakeCameraAndLightAnimation = EMovieSceneBakeType::BakeTransforms;
	BakeActorAnimation = EMovieSceneBakeType::None;
}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSkeletalMeshExport.cpp:257

Scope (from outer to inner):

file
namespace    UnFbx
function     FbxNode* FFbxExporter::CreateMesh

Source code excerpt:



	if (GetExportOptions()->bExportMorphTargets && SkelMesh->GetSkeleton()) //The skeleton can be null if this is a destructible mesh.
	{
		TMap<FName, FbxAnimCurve*> BlendShapeCurvesMap;

		if (SkelMesh->GetMorphTargets().Num())
		{
			// The original BlendShape Name was not saved during import, so we need to come up with a new one.

#Loc: <Workspace>/Engine/Source/Runtime/LevelSequence/Public/LevelSequenceAnimSequenceLink.h:32

Scope: file

Source code excerpt:

	bool bExportTransforms = true;
	UPROPERTY(BlueprintReadWrite, Category = Property)
	bool bExportMorphTargets = true;
	UPROPERTY(BlueprintReadWrite, Category = Property)
	bool bExportAttributeCurves = true;
	UPROPERTY(BlueprintReadWrite, Category = Property)
	bool bExportMaterialCurves = true;
	UPROPERTY(BlueprintReadWrite, Category = Property);
	EAnimInterpolationType Interpolation = EAnimInterpolationType::Linear;