Navigation
API > API/Plugins > API/Plugins/ExternalSource
Class allowing to load a IDatasmithScene from a source URI.
| Name | FExternalSource |
| Type | class |
| Header File | /Engine/Plugins/Enterprise/DatasmithImporter/Source/ExternalSource/Public/ExternalSource.h |
| Include Path | #include "ExternalSource.h" |
Syntax
class FExternalSource : public TSharedFromThis< FExternalSource >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → FExternalSource
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FExternalSource
(
const FSourceUri& InSourceUri |
ExternalSource.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FExternalSource() |
ExternalSource.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOptionalScenePromise | TOptional< TPromise< TSharedPtr< IDatasmithScene > > > | ExternalSource.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnExternalSourceChanged | OnExternalSourceChangedDelegate | Delegate called on main thread every time the loaded data is updated. | ExternalSource.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AssetTranslator | TSharedPtr< IDatasmithTranslator > | ExternalSource.h | ||
| AsyncTaskNotification | TSharedPtr< FAsyncTaskNotification > | Async task notification, for when we are loading the Datasmith scene asynchronously. | ExternalSource.h | |
| PendingPromiseQueue | TQueue< FOptionalScenePromise, EQueueMode::Mpsc > | Queue containing the unfulfilled promises added by AsyncLoad() We can't directly make a TQueue of TPromise, as the queue internally creates nodes for tracking the head/tail, those nodes would then hold default-constructed TPromises and would assert on deletion, since deleting an unset promise is a programming error. | ExternalSource.h | |
| SceneGuard | TUniquePtr< FDatasmithSceneGuard > | ExternalSource.h | ||
| SceneName | FString | ExternalSource.h | ||
| SourceUri | FSourceUri | The URI of the source this ExternalSource is accessing. | ExternalSource.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TFuture< TSharedPtr< IDatasmithScene > > AsyncLoad () |
Load the external source asynchronously, the returned TFuture gives a valid IDatasmithSceneTSharedPtr if successful. | ExternalSource.h | |
void CancelAsyncLoad() |
Cancel any pending AsyncLoad() operation, pending TFuture will return invalid TSharedPtr. | ExternalSource.h | |
const TSharedPtr< IDatasmithTranslator > & GetAssetTranslator () |
DISCLAIMER: The translator is exposed here as a temporary workaround in order to set the import option before the load and load assets with bulk data (StaticMeshes/LoadLevelSequence/etc.). | ExternalSource.h | |
FExternalSourceCapabilities GetCapabilities() |
ExternalSource.h | ||
TSharedPtr< IDatasmithScene > GetDatasmithScene() |
Return the DatasmithScene if it is loaded, return an invalid TSharedPtr otherwise. | ExternalSource.h | |
FString GetFallbackFilepath() |
As long as UFactory does not offer a way to import FExternalSource directly, we must rely on using filepaths, even for source that are not on the file system. | ExternalSource.h | |
FString GetSceneName () |
Return the name of the scene that will be loaded. | ExternalSource.h | |
FMD5Hash GetSourceHash() |
Gives the hash of the source, only returns a valid hash after loading the scene. | ExternalSource.h | |
FString GetSourceName() |
ExternalSource.h | ||
const FSourceUri & GetSourceUri() |
ExternalSource.h | ||
bool IsAsyncLoading() |
True when the ExternalSource is currently loading the source asynchronously. | ExternalSource.h | |
bool IsAvailable() |
Return true if the resource pointed by this ExternalSource is available for being loaded. | ExternalSource.h | |
bool IsOutOfSync() |
Return true if the loaded scene is out-of-sync and needs to be reloaded. | ExternalSource.h | |
TSharedPtr< IDatasmithScene > Load () |
Load the external source and return a valid IDatasmithSceneTSharedPtr if successful. | ExternalSource.h | |
void SetSceneName
(
const TCHAR* SceneName |
Override the name of the scene that will be loaded. | ExternalSource.h | |
TSharedPtr< IDatasmithScene > TryLoad() |
Attempt to load the FExternalSource according to its supported capabilities. | ExternalSource.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Interrupt async task notification and clear all registered delegates. | ExternalSource.h | ||
| Synchronously load the DatasmithScene. | ExternalSource.h | ||
bool StartAsyncLoad () |
Starts an async task for loading the DatasmithScene. | ExternalSource.h | |
bool TranslatorLoadScene
(
const TSharedRef< IDatasmithScene >& Scene |
Loads a scene from the translator and starts a new translator load lifecycle. | ExternalSource.h | |
void TriggerOnExternalSourceChanged() |
Broadcast OnExternalSourceChanged delegates and set pending TPromises. | ExternalSource.h |