Files
UnrealEngine/Engine/Plugins/Mutable/Source/CustomizableObjectEditor/Internal/MuCOE/CustomizableObjectInstanceBakingUtils.h
2025-05-18 13:04:45 +08:00

38 lines
2.1 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MuCO/CustomizableObjectInstance.h"
/**
* Schedules the async update of the target instance. It will clear previous update data.
* This method will also take care of setting and later resetting the state of the Customizable Object System.
* @param InInstance The instance we want to update so we can later bake it's resources.
* @param InInstanceUpdateDelegate Delegate to be called after the instance gets updated.
*/
CUSTOMIZABLEOBJECTEDITOR_API void ScheduleInstanceUpdateForBaking(UCustomizableObjectInstance& InInstance, FInstanceUpdateNativeDelegate& InInstanceUpdateDelegate);
UE_DEPRECATED(5.6, "Use the function with the same name that uses an FBakingConfiguration as input instead.")
CUSTOMIZABLEOBJECTEDITOR_API bool BakeCustomizableObjectInstance (UCustomizableObjectInstance& InInstance,
const FString& FileName,
const FString& AssetPath,
const bool bExportAllResources,
const bool bGenerateConstantMaterialInstances,
bool bHasPermissionToOverride,
bool bIsUnattendedExecution,
TArray<TPair<EPackageSaveResolutionType,UPackage*>>& OutSavedPackages);
/**
* Serializes onto disk the resources used by the targeted Customizable Object Instance. The operation can be configured in the FInstanceBakingSettings settings object.
* @param InInstance The mutable COI instance whose resources we want to bake onto disk
* @param Configuration The baking configuration object with all the settings to be used for this baking operation.
* @param bIsUnattendedExecution Determines if we want to run this method and show promps for user interaction or if we want to automatically chose the more sensible option (without the need of user interaction)
* @param OutSavedPackages A collection with the packages marked for save.
* @return True if the baking operation could be completed without issues and false otherwise
*/
CUSTOMIZABLEOBJECTEDITOR_API bool BakeCustomizableObjectInstance(
UCustomizableObjectInstance& InInstance,
const FBakingConfiguration& Configuration,
bool bIsUnattendedExecution,
TMap<UPackage*,EPackageSaveResolutionType>& OutSavedPackages);