1pub mod convert;
2pub mod error;
3pub(crate) mod gltf_primitive_data;
4pub mod unity_gltf;
5pub mod unity_image;
6pub mod unity_indices;
7pub mod unity_mesh;
8pub mod unity_node;
9pub mod unity_node_transform;
10pub mod unity_pbr_metallic_roughness;
11pub mod unity_scene;
12pub mod unity_submesh;
13
14pub use unity_gltf::{UnityGltf, gltforge_load, gltforge_release, gltforge_retain};
17pub use unity_image::{UnityImage, gltforge_image_count, gltforge_image_name, gltforge_image_uri};
18pub use unity_indices::UnityIndices;
19pub use unity_mesh::{
20 UnityMesh, gltforge_mesh_count, gltforge_mesh_index_format, gltforge_mesh_name,
21 gltforge_mesh_normals, gltforge_mesh_positions, gltforge_mesh_tangents,
22 gltforge_mesh_uv_channel_count, gltforge_mesh_uvs, gltforge_mesh_vertex_count,
23};
24pub use unity_node::{
25 UnityNode, gltforge_node_child, gltforge_node_child_count, gltforge_node_count,
26 gltforge_node_mesh_count, gltforge_node_mesh_index, gltforge_node_name,
27 gltforge_node_transform,
28};
29pub use unity_node_transform::UnityNodeTransform;
30pub use unity_pbr_metallic_roughness::{
31 ALPHA_MODE_BLEND, ALPHA_MODE_MASK, ALPHA_MODE_OPAQUE, UnityPbrMetallicRoughness,
32 gltforge_pbr_metallic_roughness_alpha_cutoff, gltforge_pbr_metallic_roughness_alpha_mode,
33 gltforge_pbr_metallic_roughness_base_color_factor,
34 gltforge_pbr_metallic_roughness_base_color_texture, gltforge_pbr_metallic_roughness_count,
35 gltforge_pbr_metallic_roughness_cull, gltforge_pbr_metallic_roughness_emissive_factor,
36 gltforge_pbr_metallic_roughness_emissive_texture,
37 gltforge_pbr_metallic_roughness_metallic_factor,
38 gltforge_pbr_metallic_roughness_metallic_roughness_texture,
39 gltforge_pbr_metallic_roughness_name, gltforge_pbr_metallic_roughness_normal_scale,
40 gltforge_pbr_metallic_roughness_normal_texture,
41 gltforge_pbr_metallic_roughness_occlusion_strength,
42 gltforge_pbr_metallic_roughness_occlusion_texture,
43 gltforge_pbr_metallic_roughness_roughness_factor,
44};
45pub use unity_scene::{gltforge_root_node_count, gltforge_root_node_index, gltforge_scene_name};
46pub use unity_submesh::{
47 UnitySubMesh, gltforge_mesh_submesh_count, gltforge_mesh_submesh_indices_u16,
48 gltforge_mesh_submesh_indices_u32, gltforge_mesh_submesh_material,
49};
50
51unsafe fn write_name(name: Option<&String>, out_len: *mut u32) -> *const u8 {
56 match name {
57 Some(s) => {
58 if !out_len.is_null() {
59 unsafe { *out_len = s.len() as u32 };
60 }
61 s.as_ptr()
62 }
63 None => {
64 if !out_len.is_null() {
65 unsafe { *out_len = 0 };
66 }
67 std::ptr::null()
68 }
69 }
70}