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.
|
| 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 |
◆ ChangeMaterial()
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
-
| MaterialId | The ID of the material to change. |
| Properties | The properties to change. Unspecified properties keep their current values. |
| OnComplete | Callback called on completion. |
◆ CreateMaterial()
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
-
| Properties | Initial properties of the created material. |
| OnComplete | Callback 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()
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
-
| MaterialId | The ID of the material entity. |
| OnComplete | Callback called on completion. |
◆ GetMaterials()
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
-
| OnComplete | Callback called on completion. |
◆ RemoveMaterial()
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
-
| MaterialId | The ID of the material to remove. |
| bSafe | If true, performs a safe remove that interrupts removal when the material cannot be removed safely. |
| OnComplete | Callback called on completion. |