Material API

Material API#

instant3Dhub: Material API
instant3Dhub

Detailed Description

The Material API creates and manages material entities identified by a material ID.

After creating a material, its materialId can be embedded into an appearance URI such as urn:X-l3d:material:<ID> and assigned to a node through the EI3DHProperty::AppearanceURI property.

Multiple nodes can reference the same material entity through their AppearanceURI, so the 3D data shaded by those nodes shares one reusable material definition.

Compared to the simpler urn:X-l3d:color appearance URNs, the Material API provides more advanced shading capabilities.

Classes

class  FI3DHMaterialAPI
struct  FI3DHMaterialProperties
struct  FI3DHBlueprintMaterialProperties

Functions

virtual void FI3DHMaterialAPI::CreateMaterial (const FI3DHMaterialProperties &Properties, TUniqueFunction< void(int32 MaterialId, EI3DHErrorCode ErrorCode)> OnComplete)=0
virtual void FI3DHMaterialAPI::ChangeMaterial (int32 MaterialId, const FI3DHMaterialProperties &Properties, TUniqueFunction< void(const FI3DHMaterialProperties &Properties, EI3DHErrorCode ErrorCode)> OnComplete)=0
virtual void FI3DHMaterialAPI::RemoveMaterial (int32 MaterialId, bool bSafe, TUniqueFunction< void(EI3DHRemoveState RemoveState, EI3DHErrorCode ErrorCode)> OnComplete)=0
virtual void FI3DHMaterialAPI::GetMaterials (TUniqueFunction< void(TArray< int32 > MaterialIds, EI3DHErrorCode ErrorCode)> OnComplete)=0
virtual void FI3DHMaterialAPI::GetMaterialData (int32 MaterialId, TUniqueFunction< void(const FI3DHMaterialProperties &Properties, EI3DHErrorCode ErrorCode)> OnComplete)=0

Function Documentation

◆ ChangeMaterial()

virtual void FI3DHMaterialAPI::ChangeMaterial ( int32 MaterialId,
const FI3DHMaterialProperties & Properties,
TUniqueFunction< void(const FI3DHMaterialProperties &Properties, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Changes one or more properties of the material with the specified ID.

Experimental
Introduced in v1.4.0. "The instant3Dhub Material API is experimental and under active development."
This API is experimental. As such, there is no guarantee that it won't change or be removed in future releases. Please use at your own risk.
Parameters
MaterialIdThe ID of the material to change.
PropertiesThe properties to change. Unspecified properties keep their current values.
OnCompleteCallback called on completion.

◆ CreateMaterial()

virtual void FI3DHMaterialAPI::CreateMaterial ( const FI3DHMaterialProperties & Properties,
TUniqueFunction< void(int32 MaterialId, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Creates a new material.

Experimental
Introduced in v1.4.0. "The instant3Dhub Material API is experimental and under active development."
This API is experimental. As such, there is no guarantee that it won't change or be removed in future releases. Please use at your own risk.
Parameters
PropertiesInitial properties of the created material.
OnCompleteCallback called on completion. On success, the returned material ID identifies the material and can be used to create an appearance URI such as urn:X-l3d:material:<ID>.

◆ GetMaterialData()

virtual void FI3DHMaterialAPI::GetMaterialData ( int32 MaterialId,
TUniqueFunction< void(const FI3DHMaterialProperties &Properties, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Returns the properties of the material entity with the specified ID.

Experimental
Introduced in v1.4.0. "The instant3Dhub Material API is experimental and under active development."
This API is experimental. As such, there is no guarantee that it won't change or be removed in future releases. Please use at your own risk.
Parameters
MaterialIdThe ID of the material entity.
OnCompleteCallback called on completion.

◆ GetMaterials()

virtual void FI3DHMaterialAPI::GetMaterials ( TUniqueFunction< void(TArray< int32 > MaterialIds, EI3DHErrorCode ErrorCode)> OnComplete)
pure virtual

Returns the IDs of all available material entities.

Experimental
Introduced in v1.4.0. "The instant3Dhub Material API is experimental and under active development."
This API is experimental. As such, there is no guarantee that it won't change or be removed in future releases. Please use at your own risk.
Parameters
OnCompleteCallback called on completion.

◆ RemoveMaterial()

virtual void FI3DHMaterialAPI::RemoveMaterial ( int32 MaterialId,
bool bSafe,
TUniqueFunction< void(EI3DHRemoveState RemoveState, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Removes the material with the specified ID.

Experimental
Introduced in v1.4.0. "The instant3Dhub Material API is experimental and under active development."
This API is experimental. As such, there is no guarantee that it won't change or be removed in future releases. Please use at your own risk.
Parameters
MaterialIdThe ID of the material to remove.
bSafeIf true, performs a safe remove that interrupts removal when the material cannot be removed safely.
OnCompleteCallback called on completion.