Scene Export Manifest Builder for C++
USimplygonSceneExportManifestBuilder builds a scene export manifest. The scene export commandlet later uses the manifest to export Simplygon scenes in a separate process.
#include "ImportExport/Export/Manifest/SimplygonSceneExportManifestBuilder.h"Functions return SG::FTaskResult and are synchronous. Call them on the game thread. Every successful add keeps the manifest valid.
Methods
| Name | Description |
|---|---|
| Create | Create an empty builder. |
| AddActorScene | Add a scene that exports the static mesh components of saved actors. |
| AddActorSceneFromWorldPartitionActors | Add an actor scene from World Partition actors without loading them. |
| AddStaticMeshScene | Add a scene that exports a static mesh asset. |
| RemoveScene | Remove a scene. |
| GetSceneNames | Get the scene names in manifest order. |
| AddLandscapeClipping | Add landscape clipping geometry inside the bounds of an actor scene. |
| AddLandscapeGeometryAppend | Add landscape geometry with explicit settings. |
| AddSceneCapture | Add a scene capture with explicit settings. |
| AddSplatterCasterCapture | Add a scene capture set up for a splatter caster. |
| Validate | Validate the manifest without saving it. |
| SaveToFile | Validate and save the manifest. |
| LoadFromFile | Load a manifest into a new builder. |
| GetManifestWorldPartitionActors | List the actors of a World Partition world without loading them. |
Method details
Create
static USimplygonSceneExportManifestBuilder* Create()Creates an empty builder in the transient package. The builder isn't rooted, so keep it referenced, for example with a UPROPERTY or TStrongObjectPtr, across anything that can run garbage collection, such as loading a map.
AddActorScene
SG::FTaskResult<void> AddActorScene(
const FString& InSceneName,
const FString& InOutputFile,
const TArray<AActor*>& InActors,
const FSgSceneExportSettings& InExportSettings)Adds a scene that exports the static mesh components of saved actors in one editor world. Each actor is stored by actor GUID and level package. The actors must be saved, have a persistent actor GUID, and have at least one exportable static mesh component. Actors inside a Level Instance that is being edited are rejected, because the commandlet only sees saved levels.
InSceneName must be unique. InOutputFile is the .sgscene file to write, stored as an absolute path. Relative paths are relative to the process base directory, like FPaths::ProjectSavedDir(). InExportSettings are passed as-is to the component export API. The receipt is written to <output file without extension>.receipt.json.
AddActorSceneFromWorldPartitionActors
SG::FTaskResult<void> AddActorSceneFromWorldPartitionActors(
const FString& InSceneName,
const FString& InOutputFile,
const UWorld* InWorld,
const TArray<FSgSceneExportManifestWorldPartitionActor>& InManifestWorldPartitionActors,
const FSgSceneExportSettings& InExportSettings)Adds an actor scene from actors listed with GetManifestWorldPartitionActors, without loading them. InWorld must be a saved and initialized World Partition editor world. The references and the bounds used by AddLandscapeClipping come from the saved actor descriptors. Actors with unsaved changes are captured as last saved and logged as a warning.
Unlike AddActorScene, the actors' components aren't checked. Actors without exportable static meshes are skipped and reported in the receipt when the commandlet exports the scene.
AddStaticMeshScene
SG::FTaskResult<void> AddStaticMeshScene(
const FString& InSceneName,
const FString& InOutputFile,
UStaticMesh* InStaticMesh,
const FSgSceneMeshExportSettings& InExportSettings)Adds a scene that exports a saved static mesh asset. InExportSettings are passed as-is to the static mesh export API.
RemoveScene
SG::FTaskResult<void> RemoveScene(const FString& InSceneName)Removes a scene with its geometry appends and scene captures.
GetSceneNames
TArray<FString> GetSceneNames() constReturns the scene names in manifest order.
AddLandscapeClipping
SG::FTaskResult<void> AddLandscapeClipping(
const FString& InSceneName,
ELandscapeCullingPrecision::Type InPrecision = ELandscapeCullingPrecision::Medium,
bool bInAllowEmpty = false)Adds the landscape inside the bounds of an actor scene added on this builder to the clipping geometry selection set, with the scene's world offset and without texture coordinates, normals, tangents, or vertex colors. The bounds are the union of the scene's static mesh component bounds, or of the actors' saved bounds for scenes added with AddActorSceneFromWorldPartitionActors. When bInAllowEmpty is false, the export fails if no landscape intersects the bounds. The geometry append is named LandscapeClippingAppendName (LandscapeClipping).
Bounds aren't stored in the manifest, so use AddLandscapeGeometryAppend for scenes of a loaded manifest.
AddLandscapeGeometryAppend
SG::FTaskResult<void> AddLandscapeGeometryAppend(
const FString& InSceneName,
const FString& InAppendName,
const FSgLandscapeGeometryExportSettings& InLandscapeSettings,
const FSgAppendSceneGeometrySettings& InAppendSettings,
bool bInAllowEmpty = false)Adds landscape geometry to an actor scene using the settings as-is. InAppendName must be unique within the scene. InLandscapeSettings must have explicit world bounds. InAppendSettings needs a selection set name and the same world offset as the scene's export settings.
AddSceneCapture
SG::FTaskResult<void> AddSceneCapture(
const FString& InSceneName,
const FString& InCaptureName,
const FSCOBBCameraGenerationSettings& InCameraGenerationSettings,
const FSgCaptureComponentsToSceneSettings& InCaptureSettings,
ESgSceneExportManifestCaptureWorld InCaptureWorld = ESgSceneExportManifestCaptureWorld::Preview)Adds a scene capture to an actor scene. When the scene is exported, cameras are generated around all its components and the components are captured into the scene's camera selection set. InCaptureName must be unique within the scene. The capture settings must have no cameras, the same output image dimensions as the camera generation, the same world offset as the scene's export settings, and a camera selection set name that is unique in the scene. See Managed Scene Export and Capture for the settings.
InCaptureWorld selects Preview to capture preview copies of the components in an isolated preview world, or Existing to capture the components in their own world without duplicating them. An existing-world capture ignores the scene settings, except bForceLOD0.
AddSplatterCasterCapture
SG::FTaskResult<void> AddSplatterCasterCapture(
const FString& InSceneName,
double InViewDistance = 100.0,
int32 InCaptureResolution = 1024,
int32 InMaxCameraCount = 128,
int32 InBufferTypes = static_cast<int32>(ESgBufferCaptureType::BaseColor | ESgBufferCaptureType::WorldNormal),
ESgSceneExportManifestCaptureWorld InCaptureWorld = ESgSceneExportManifestCaptureWorld::Preview)Adds a scene capture for a splatter caster to an actor scene: perspective cameras named SplatterCasterCamera in the splatter caster camera selection set, rendering of source LOD 0, and the scene's world offset. The capture is named SplatterCasterCaptureName (SplatterCaster).
InViewDistance is the expected viewing distance from the geometry in world units (centimeters). InCaptureResolution is the width and height in pixels of each image. InBufferTypes is a bitmask of ESgBufferCaptureType channels. InCaptureWorld is the same as for AddSceneCapture.
Export the scene's geometry without materials, texture coordinates, normals, tangents, and vertex colors, since the splatter caster bakes materials from the captured images.
Validate
SG::FTaskResult<void> Validate() constValidates the manifest in the same way as SaveToFile, without writing it.
SaveToFile
SG::FTaskResult<void> SaveToFile(const FString& InFilePath) constValidates the manifest and writes it to a JSON file atomically. Relative paths are relative to the process base directory.
LoadFromFile
static SG::FTaskResult<TStrongObjectPtr<USimplygonSceneExportManifestBuilder>> LoadFromFile(const FString& InFilePath)Loads a manifest file into a new builder.
GetManifestWorldPartitionActors
#include "ImportExport/Export/Manifest/SceneExportManifestWorldPartitionActors.h"
SG::FTaskResult<TArray<FSgSceneExportManifestWorldPartitionActor>> SG::SceneExportManifest::GetManifestWorldPartitionActors(
const UWorld* InWorld,
const FSgSceneExportManifestWorldPartitionActorFilter& InFilter)Lists the actors of an initialized World Partition editor world from World Partition's saved actor descriptors, without loading any actors. The list includes the actors of the main world, its external data layers, and every placement of its Level Instances, including nested ones. Packed Level Actors are listed as actors. The result is sorted by actor path.
Actor descriptors are written when actors are saved. Actors with unsaved changes are described as last saved. Loaded actors that have never been saved are an error unless the filter skips them. Source levels saved by an engine version that didn't write actor descriptors are an error too; resave them.
FSgSceneExportManifestWorldPartitionActor has these properties:
| Name | Description |
|---|---|
Actor | The actor reference that the manifest captures. |
ActorClass | Most derived class of the actor, which is a Blueprint class for Blueprint actors. |
NativeClass | Closest native class of the actor. |
EditorBounds | Editor bounds of the actor in world space when it was saved. |
FSgSceneExportManifestWorldPartitionActorFilter selects the actors to leave out. Every option is on by default:
| Name | Description |
|---|---|
bSkipHLODActors | Skip World Partition HLOD actors. |
bSkipEditorOnlyActors | Skip editor-only actors. |
bSkipLevelInstanceActors | Skip Level Instance actors, which have no meshes of their own. The actors inside them are listed instead. Packed Level Actors are kept. |
bSkipLandscapes | Skip landscape actors and proxies. Use AddLandscapeClipping instead. |
ExcludedClasses | Skip actors of these classes and their subclasses. |
