Interface IGltfReadable
Provides read-only access to a glTF (schema and imported Unity resources)
Namespace: GLTFast
Syntax
public interface IGltfReadable
Properties
ImageCount
Number of images
Declaration
int ImageCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
MaterialCount
Number of materials
Declaration
int MaterialCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
TextureCount
Number of textures
Declaration
int TextureCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
GetBindPoses(Int32)
Returns an array of inverse bone matrices representing a skin's bind pose suitable for use with UnityEngine.Mesh.bindposes by glTF skin index.
Declaration
Matrix4x4[] GetBindPoses(int skinId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | skinId | glTF skin index |
Returns
Type | Description |
---|---|
Matrix4x4[] | Corresponding bind poses |
GetDefaultMaterial()
Returns a fallback material to be used when no material was assigned (provided by the IMaterialGenerator)
Declaration
Material GetDefaultMaterial()
Returns
Type | Description |
---|---|
Material | Default material |
GetImage(Int32)
Get texture by glTF image index
Declaration
Texture2D GetImage(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF image index |
Returns
Type | Description |
---|---|
Texture2D | Loaded Unity texture |
GetMaterial(Int32)
Get a Unity Material by its glTF material index
Declaration
Material GetMaterial(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF material index |
Returns
Type | Description |
---|---|
Material | Corresponding Unity Material |
GetSourceCamera(UInt32)
Get source (de-serialized glTF) camera
Declaration
Camera GetSourceCamera(uint index)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | glTF camera index |
Returns
Type | Description |
---|---|
Camera | De-serialized glTF camera |
GetSourceImage(Int32)
Get source (de-serialized glTF) image
Declaration
Image GetSourceImage(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF image index |
Returns
Type | Description |
---|---|
Image | De-serialized glTF image |
GetSourceLightPunctual(UInt32)
Get source (de-serialized glTF) light
Declaration
LightPunctual GetSourceLightPunctual(uint index)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | glTF light index |
Returns
Type | Description |
---|---|
LightPunctual | De-serialized glTF light |
GetSourceMaterial(Int32)
Get source (de-serialized glTF) material
Declaration
Material GetSourceMaterial(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF material index |
Returns
Type | Description |
---|---|
Material | De-serialized glTF material |
GetSourceNode(Int32)
Get source (de-serialized glTF) node
Declaration
Node GetSourceNode(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF node index |
Returns
Type | Description |
---|---|
Node | De-serialized glTF node |
GetSourceRoot()
Get source root (de-serialized glTF JSON). This is intended for read-only access. Changes might corrupt data and break subsequent scene instantiation.
Declaration
Root GetSourceRoot()
Returns
Type | Description |
---|---|
Root | De-serialized glTF root object |
GetSourceScene(Int32)
Get source (de-serialized glTF) scene
Declaration
Scene GetSourceScene(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF scene index |
Returns
Type | Description |
---|---|
Scene | De-serialized glTF scene |
GetSourceTexture(Int32)
Get source (de-serialized glTF) texture
Declaration
Texture GetSourceTexture(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF texture index |
Returns
Type | Description |
---|---|
Texture | De-serialized glTF texture |
GetTexture(Int32)
Get texture by glTF texture index
Declaration
Texture2D GetTexture(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | glTF texture index |
Returns
Type | Description |
---|---|
Texture2D | Loaded Unity texture |