Diligent Engine
Loading...
Searching...
No Matches
Diligent::IRadientSceneAssetImporter Struct Referenceabstract

#include <RadientSceneAssetImporter.hpp>

Inheritance diagram for Diligent::IRadientSceneAssetImporter:
Diligent.IObject

Public Member Functions

virtual const Char *DILIGENT_CALL_TYPE GetIdentifier () const =0
virtual Bool DILIGENT_CALL_TYPE CanImport (const Char *URI) const =0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE Import (const RadientSceneAssetImportContext &Context, RadientImport::ImportedDocument &Document)=0
Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type>
void QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface)
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0

Detailed Description

Converts an external scene format into an owning ImportedDocument. Register an implementation with IRadientAssetManager::RegisterSceneAssetImporter().

Importer methods can be called concurrently on the same object. Each Import call has its own context and output document; per-document parser state is local to that call or otherwise synchronized by the implementation. The manager retains registered importers and selected importers remain fixed for each accepted load request. This interface describes file-format conversion; IRadientSceneImporter separately instantiates loaded assets into a scene.

Member Function Documentation

◆ CanImport()

virtual Bool DILIGENT_CALL_TYPE Diligent::IRadientSceneAssetImporter::CanImport ( const Char * URI) const
pure virtual

Recognizes an original request URI without opening the source. URI is non-null and nonempty. Automatic selection checks a fixed snapshot of registered importers in registration order and selects the first match. Multiple matches produce an informational message. Set RadientSceneLoadInfo::ImporterId to select an importer explicitly, bypassing this call. The URI is valid only during the call.

Keep this URI predicate quick. It runs without the manager's registration lock held; later registrations do not change the selection's snapshot.

◆ GetIdentifier()

virtual const Char *DILIGENT_CALL_TYPE Diligent::IRadientSceneAssetImporter::GetIdentifier ( ) const
pure virtual

Non-null, nonempty, case-sensitive identifier, e.g. "gltf" or "obj". The identifier is immutable and its string remains valid for the object's lifetime. Registration copies the identifier and retains the importer. Identifiers are unique within an asset manager.

◆ Import()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneAssetImporter::Import ( const RadientSceneAssetImportContext & Context,
RadientImport::ImportedDocument & Document )
pure virtual

Converts the source into Document as an asset-loading task. The task may run on a worker or a thread calling WaitForAssetLoad; it has no guaranteed thread affinity. No importer-registration lock is held during this call. Document is initially empty. Return RADIENT_STATUS_OK only after all metadata and asset references have been populated. Child assets may still be pending; scene dependency tracking handles their completion.

A negative status fails the scene load; a partially filled document is discarded. Other nonnegative statuses, including PENDING, are invalid and fail the load with RADIENT_STATUS_FAILED. Exceptions are caught by the manager and also fail the load. A failed import does not try another importer. Successful documents are moved into the scene asset; neither the output object nor the context needs to remain alive afterward.