modelio-rs 0.2.4

Safe Rust bindings for Apple's ModelIO framework — assets, meshes, materials, lights, cameras, voxels, textures, and animation on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
use serde::Deserialize;

#[derive(Debug, Clone, Copy, PartialEq, Deserialize)]
/// Wraps the corresponding Model I/O bounding box counterpart.
pub struct BoundingBox {
    pub min: [f32; 3],
    pub max: [f32; 3],
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
/// Mirrors the corresponding Model I/O geometry type enumeration.
pub enum GeometryType {
    Points = 0,
    Lines = 1,
    Triangles = 2,
    TriangleStrips = 3,
    Quads = 4,
    VariableTopology = 5,
}

impl GeometryType {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> i32 {
        self as i32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: i32) -> Option<Self> {
        match raw {
            0 => Some(Self::Points),
            1 => Some(Self::Lines),
            2 => Some(Self::Triangles),
            3 => Some(Self::TriangleStrips),
            4 => Some(Self::Quads),
            5 => Some(Self::VariableTopology),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
/// Mirrors the corresponding Model I/O probe placement enumeration.
pub enum ProbePlacement {
    UniformGrid = 0,
    IrradianceDistribution = 1,
}

impl ProbePlacement {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> i32 {
        self as i32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: i32) -> Option<Self> {
        match raw {
            0 => Some(Self::UniformGrid),
            1 => Some(Self::IrradianceDistribution),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O index bit depth enumeration.
pub enum IndexBitDepth {
    UInt8 = 8,
    UInt16 = 16,
    UInt32 = 32,
}

impl IndexBitDepth {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            8 => Some(Self::UInt8),
            16 => Some(Self::UInt16),
            32 => Some(Self::UInt32),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O mesh buffer type enumeration.
pub enum MeshBufferType {
    Vertex = 1,
    Index = 2,
    Custom = 3,
}

impl MeshBufferType {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            1 => Some(Self::Vertex),
            2 => Some(Self::Index),
            3 => Some(Self::Custom),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O material semantic enumeration.
pub enum MaterialSemantic {
    BaseColor = 0,
    Subsurface = 1,
    Metallic = 2,
    Specular = 3,
    SpecularExponent = 4,
    SpecularTint = 5,
    Roughness = 6,
    Anisotropic = 7,
    AnisotropicRotation = 8,
    Sheen = 9,
    SheenTint = 10,
    Clearcoat = 11,
    ClearcoatGloss = 12,
    Emission = 13,
    Bump = 14,
    Opacity = 15,
    InterfaceIndexOfRefraction = 16,
    MaterialIndexOfRefraction = 17,
    ObjectSpaceNormal = 18,
    TangentSpaceNormal = 19,
    Displacement = 20,
    DisplacementScale = 21,
    AmbientOcclusion = 22,
    AmbientOcclusionScale = 23,
    None = 0x8000,
    UserDefined = 0x8001,
}

impl MaterialSemantic {
    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::BaseColor),
            1 => Some(Self::Subsurface),
            2 => Some(Self::Metallic),
            3 => Some(Self::Specular),
            4 => Some(Self::SpecularExponent),
            5 => Some(Self::SpecularTint),
            6 => Some(Self::Roughness),
            7 => Some(Self::Anisotropic),
            8 => Some(Self::AnisotropicRotation),
            9 => Some(Self::Sheen),
            10 => Some(Self::SheenTint),
            11 => Some(Self::Clearcoat),
            12 => Some(Self::ClearcoatGloss),
            13 => Some(Self::Emission),
            14 => Some(Self::Bump),
            15 => Some(Self::Opacity),
            16 => Some(Self::InterfaceIndexOfRefraction),
            17 => Some(Self::MaterialIndexOfRefraction),
            18 => Some(Self::ObjectSpaceNormal),
            19 => Some(Self::TangentSpaceNormal),
            20 => Some(Self::Displacement),
            21 => Some(Self::DisplacementScale),
            22 => Some(Self::AmbientOcclusion),
            23 => Some(Self::AmbientOcclusionScale),
            0x8000 => Some(Self::None),
            0x8001 => Some(Self::UserDefined),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O material property type enumeration.
pub enum MaterialPropertyType {
    None = 0,
    String = 1,
    Url = 2,
    Texture = 3,
    Color = 4,
    Float = 5,
    Float2 = 6,
    Float3 = 7,
    Float4 = 8,
    Matrix44 = 9,
    Buffer = 10,
}

impl MaterialPropertyType {
    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::None),
            1 => Some(Self::String),
            2 => Some(Self::Url),
            3 => Some(Self::Texture),
            4 => Some(Self::Color),
            5 => Some(Self::Float),
            6 => Some(Self::Float2),
            7 => Some(Self::Float3),
            8 => Some(Self::Float4),
            9 => Some(Self::Matrix44),
            10 => Some(Self::Buffer),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O material face enumeration.
pub enum MaterialFace {
    Front = 0,
    Back = 1,
    DoubleSided = 2,
}

impl MaterialFace {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Front),
            1 => Some(Self::Back),
            2 => Some(Self::DoubleSided),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O material texture wrap mode enumeration.
pub enum MaterialTextureWrapMode {
    Clamp = 0,
    Repeat = 1,
    Mirror = 2,
}

impl MaterialTextureWrapMode {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Clamp),
            1 => Some(Self::Repeat),
            2 => Some(Self::Mirror),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O material texture filter mode enumeration.
pub enum MaterialTextureFilterMode {
    Nearest = 0,
    Linear = 1,
}

impl MaterialTextureFilterMode {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Nearest),
            1 => Some(Self::Linear),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O material mip map filter mode enumeration.
pub enum MaterialMipMapFilterMode {
    Nearest = 0,
    Linear = 1,
}

impl MaterialMipMapFilterMode {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Nearest),
            1 => Some(Self::Linear),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O light type enumeration.
pub enum LightType {
    Unknown = 0,
    Ambient = 1,
    Directional = 2,
    Spot = 3,
    Point = 4,
    Linear = 5,
    DiscArea = 6,
    RectangularArea = 7,
    SuperElliptical = 8,
    Photometric = 9,
    Probe = 10,
    Environment = 11,
}

impl LightType {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Unknown),
            1 => Some(Self::Ambient),
            2 => Some(Self::Directional),
            3 => Some(Self::Spot),
            4 => Some(Self::Point),
            5 => Some(Self::Linear),
            6 => Some(Self::DiscArea),
            7 => Some(Self::RectangularArea),
            8 => Some(Self::SuperElliptical),
            9 => Some(Self::Photometric),
            10 => Some(Self::Probe),
            11 => Some(Self::Environment),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O camera projection enumeration.
pub enum CameraProjection {
    Perspective = 0,
    Orthographic = 1,
}

impl CameraProjection {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Perspective),
            1 => Some(Self::Orthographic),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O data precision enumeration.
pub enum DataPrecision {
    Undefined = 0,
    Float = 1,
    Double = 2,
}

impl DataPrecision {
    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Undefined),
            1 => Some(Self::Float),
            2 => Some(Self::Double),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
/// Mirrors the corresponding Model I/O animated value interpolation enumeration.
pub enum AnimatedValueInterpolation {
    Constant = 0,
    Linear = 1,
}

impl AnimatedValueInterpolation {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u32 {
        self as u32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u32) -> Option<Self> {
        match raw {
            0 => Some(Self::Constant),
            1 => Some(Self::Linear),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u64)]
/// Mirrors the corresponding Model I/O transform op rotation order enumeration.
pub enum TransformOpRotationOrder {
    Xyz = 1,
    Xzy = 2,
    Yxz = 3,
    Yzx = 4,
    Zxy = 5,
    Zyx = 6,
}

impl TransformOpRotationOrder {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> u64 {
        self as u64
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: u64) -> Option<Self> {
        match raw {
            1 => Some(Self::Xyz),
            2 => Some(Self::Xzy),
            3 => Some(Self::Yxz),
            4 => Some(Self::Yzx),
            5 => Some(Self::Zxy),
            6 => Some(Self::Zyx),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
/// Mirrors the corresponding Model I/O object kind enumeration.
pub enum ObjectKind {
    Unknown = 0,
    Object = 1,
    Mesh = 2,
    Light = 3,
    PhysicallyPlausibleLight = 4,
    Camera = 5,
    VoxelArray = 6,
    Skeleton = 7,
    PackedJointAnimation = 8,
}

impl ObjectKind {
    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: i32) -> Option<Self> {
        match raw {
            0 => Some(Self::Unknown),
            1 => Some(Self::Object),
            2 => Some(Self::Mesh),
            3 => Some(Self::Light),
            4 => Some(Self::PhysicallyPlausibleLight),
            5 => Some(Self::Camera),
            6 => Some(Self::VoxelArray),
            7 => Some(Self::Skeleton),
            8 => Some(Self::PackedJointAnimation),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
/// Mirrors the corresponding Model I/O texture channel encoding enumeration.
pub enum TextureChannelEncoding {
    UInt8 = 1,
    UInt16 = 2,
    UInt24 = 3,
    UInt32 = 4,
    Float16 = 0x102,
    Float16Sr = 0x302,
    Float32 = 0x104,
}

impl TextureChannelEncoding {
    #[must_use]
    /// Returns the raw constant used by the corresponding Model I/O counterpart.
    pub const fn as_raw(self) -> i32 {
        self as i32
    }

    #[must_use]
    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
    pub const fn from_raw(raw: i32) -> Option<Self> {
        match raw {
            1 => Some(Self::UInt8),
            2 => Some(Self::UInt16),
            3 => Some(Self::UInt24),
            4 => Some(Self::UInt32),
            0x102 => Some(Self::Float16),
            0x302 => Some(Self::Float16Sr),
            0x104 => Some(Self::Float32),
            _ => None,
        }
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O mesh buffer info counterpart.
pub struct MeshBufferInfo {
    pub length: usize,
    pub buffer_type: u32,
}

impl MeshBufferInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O mesh buffer info counterpart.
    pub fn buffer_type_enum(&self) -> Option<MeshBufferType> {
        MeshBufferType::from_raw(self.buffer_type)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O vertex attribute info counterpart.
pub struct VertexAttributeInfo {
    pub stride: usize,
    pub format: u32,
    pub buffer_size: usize,
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O texture info counterpart.
pub struct TextureInfo {
    pub name: Option<String>,
    pub dimensions: [i32; 2],
    pub row_stride: isize,
    pub channel_count: usize,
    pub mip_level_count: usize,
    pub channel_encoding: i32,
    pub is_cube: bool,
    pub has_alpha_values: bool,
    pub url: Option<String>,
}

impl TextureInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture info counterpart.
    pub fn channel_encoding_enum(&self) -> Option<TextureChannelEncoding> {
        TextureChannelEncoding::from_raw(self.channel_encoding)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O material property info counterpart.
pub struct MaterialPropertyInfo {
    pub name: String,
    pub semantic: u32,
    pub property_type: u32,
    pub string_value: Option<String>,
    pub url_value: Option<String>,
    pub float_value: Option<f32>,
    pub float2_value: Option<[f32; 2]>,
    pub float3_value: Option<[f32; 3]>,
    pub float4_value: Option<[f32; 4]>,
    pub matrix4x4: Option<[f32; 16]>,
    pub color: Option<[f32; 4]>,
    pub luminance: Option<f32>,
    pub texture: Option<TextureInfo>,
}

impl MaterialPropertyInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O material property info counterpart.
    pub fn semantic_enum(&self) -> Option<MaterialSemantic> {
        MaterialSemantic::from_raw(self.semantic)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O material property info counterpart.
    pub fn property_type_enum(&self) -> Option<MaterialPropertyType> {
        MaterialPropertyType::from_raw(self.property_type)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O material info counterpart.
pub struct MaterialInfo {
    pub name: String,
    pub count: usize,
    pub material_face: u32,
}

impl MaterialInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O material info counterpart.
    pub fn material_face_enum(&self) -> Option<MaterialFace> {
        MaterialFace::from_raw(self.material_face)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O texture filter info counterpart.
pub struct TextureFilterInfo {
    pub s_wrap_mode: u32,
    pub t_wrap_mode: u32,
    pub r_wrap_mode: u32,
    pub min_filter: u32,
    pub mag_filter: u32,
    pub mip_filter: u32,
}

impl TextureFilterInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
    pub fn s_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
        MaterialTextureWrapMode::from_raw(self.s_wrap_mode)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
    pub fn t_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
        MaterialTextureWrapMode::from_raw(self.t_wrap_mode)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
    pub fn r_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
        MaterialTextureWrapMode::from_raw(self.r_wrap_mode)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
    pub fn min_filter_enum(&self) -> Option<MaterialTextureFilterMode> {
        MaterialTextureFilterMode::from_raw(self.min_filter)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
    pub fn mag_filter_enum(&self) -> Option<MaterialTextureFilterMode> {
        MaterialTextureFilterMode::from_raw(self.mag_filter)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
    pub fn mip_filter_enum(&self) -> Option<MaterialMipMapFilterMode> {
        MaterialMipMapFilterMode::from_raw(self.mip_filter)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O texture sampler info counterpart.
pub struct TextureSamplerInfo {
    pub has_texture: bool,
    pub has_hardware_filter: bool,
    pub has_transform: bool,
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O asset info counterpart.
pub struct AssetInfo {
    pub count: usize,
    pub frame_interval: f64,
    pub start_time: f64,
    pub end_time: f64,
    pub bounding_box: BoundingBox,
    pub up_axis: [f32; 3],
    pub url: Option<String>,
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O object info counterpart.
pub struct ObjectInfo {
    pub kind: i32,
    pub name: String,
    pub path: String,
    pub hidden: bool,
    pub component_count: usize,
    pub child_count: usize,
    pub has_parent: bool,
    pub has_instance: bool,
    pub bounding_box: BoundingBox,
}

impl ObjectInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O object info counterpart.
    pub fn kind_enum(&self) -> Option<ObjectKind> {
        ObjectKind::from_raw(self.kind)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O light info counterpart.
pub struct LightInfo {
    pub light_type: u32,
    pub color_space: String,
}

impl LightInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O light info counterpart.
    pub fn light_type_enum(&self) -> Option<LightType> {
        LightType::from_raw(self.light_type)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O physically plausible light info counterpart.
pub struct PhysicallyPlausibleLightInfo {
    pub light_type: u32,
    pub color_space: String,
    pub color: Option<[f32; 4]>,
    pub lumens: f32,
    pub inner_cone_angle: f32,
    pub outer_cone_angle: f32,
    pub attenuation_start_distance: f32,
    pub attenuation_end_distance: f32,
}

impl PhysicallyPlausibleLightInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O physically plausible light info counterpart.
    pub fn light_type_enum(&self) -> Option<LightType> {
        LightType::from_raw(self.light_type)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O area light info counterpart.
pub struct AreaLightInfo {
    pub light_type: u32,
    pub color_space: String,
    pub color: Option<[f32; 4]>,
    pub lumens: f32,
    pub inner_cone_angle: f32,
    pub outer_cone_angle: f32,
    pub attenuation_start_distance: f32,
    pub attenuation_end_distance: f32,
    pub area_radius: f32,
    pub super_elliptic_power: [f32; 2],
    pub aspect: f32,
}

impl AreaLightInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O area light info counterpart.
    pub fn light_type_enum(&self) -> Option<LightType> {
        LightType::from_raw(self.light_type)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O photometric light info counterpart.
pub struct PhotometricLightInfo {
    pub light_type: u32,
    pub color_space: String,
    pub color: Option<[f32; 4]>,
    pub lumens: f32,
    pub inner_cone_angle: f32,
    pub outer_cone_angle: f32,
    pub attenuation_start_distance: f32,
    pub attenuation_end_distance: f32,
    pub spherical_harmonics_level: usize,
    pub spherical_harmonics_coefficients_length: usize,
    pub has_light_cube_map: bool,
}

impl PhotometricLightInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O photometric light info counterpart.
    pub fn light_type_enum(&self) -> Option<LightType> {
        LightType::from_raw(self.light_type)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O camera info counterpart.
pub struct CameraInfo {
    pub projection: u32,
    pub projection_matrix: [f32; 16],
    pub near_visibility_distance: f32,
    pub far_visibility_distance: f32,
    pub world_to_meters_conversion_scale: f32,
    pub barrel_distortion: f32,
    pub fisheye_distortion: f32,
    pub optical_vignetting: f32,
    pub chromatic_aberration: f32,
    pub focal_length: f32,
    pub focus_distance: f32,
    pub field_of_view: f32,
    pub f_stop: f32,
    pub aperture_blade_count: usize,
    pub maximum_circle_of_confusion: f32,
    pub shutter_open_interval: f64,
    pub sensor_vertical_aperture: f32,
    pub sensor_aspect: f32,
    pub sensor_enlargement: [f32; 2],
    pub sensor_shift: [f32; 2],
    pub flash: [f32; 3],
    pub exposure_compression: [f32; 2],
    pub exposure: [f32; 3],
}

impl CameraInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O camera info counterpart.
    pub fn projection_enum(&self) -> Option<CameraProjection> {
        CameraProjection::from_raw(self.projection)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O stereoscopic camera info counterpart.
pub struct StereoscopicCameraInfo {
    pub inter_pupillary_distance: f32,
    pub left_vergence: f32,
    pub right_vergence: f32,
    pub overlap: f32,
    pub left_view_matrix: [f32; 16],
    pub right_view_matrix: [f32; 16],
    pub left_projection_matrix: [f32; 16],
    pub right_projection_matrix: [f32; 16],
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O voxel index extent counterpart.
pub struct VoxelIndexExtent {
    pub minimum_extent: [i32; 4],
    pub maximum_extent: [i32; 4],
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O voxel array info counterpart.
pub struct VoxelArrayInfo {
    pub count: usize,
    pub bounding_box: BoundingBox,
    pub voxel_index_extent: VoxelIndexExtent,
    pub is_valid_signed_shell_field: bool,
    pub shell_field_interior_thickness: f32,
    pub shell_field_exterior_thickness: f32,
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O animated value info counterpart.
pub struct AnimatedValueInfo {
    pub is_animated: bool,
    pub precision: u32,
    pub time_sample_count: usize,
    pub minimum_time: f64,
    pub maximum_time: f64,
    pub interpolation: u32,
    pub key_times: Vec<f64>,
    pub element_count: Option<usize>,
}

impl AnimatedValueInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O animated value info counterpart.
    pub fn precision_enum(&self) -> Option<DataPrecision> {
        DataPrecision::from_raw(self.precision)
    }

    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O animated value info counterpart.
    pub fn interpolation_enum(&self) -> Option<AnimatedValueInterpolation> {
        AnimatedValueInterpolation::from_raw(self.interpolation)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O packed joint animation info counterpart.
pub struct PackedJointAnimationInfo {
    pub name: String,
    pub path: String,
    pub joint_paths: Vec<String>,
    pub joint_count: usize,
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O animation bind component info counterpart.
pub struct AnimationBindComponentInfo {
    pub has_skeleton: bool,
    pub has_joint_animation: bool,
    pub joint_paths: Option<Vec<String>>,
    pub geometry_bind_transform: [f32; 16],
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O skeleton info counterpart.
pub struct SkeletonInfo {
    pub name: String,
    pub path: String,
    pub joint_paths: Vec<String>,
    pub joint_count: usize,
    pub joint_bind_transform_count: usize,
    pub joint_rest_transform_count: usize,
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O matrix4x4array info counterpart.
pub struct Matrix4x4ArrayInfo {
    pub element_count: usize,
    pub precision: u32,
}

impl Matrix4x4ArrayInfo {
    #[must_use]
    /// Calls the corresponding Model I/O method on the wrapped Model I/O matrix4x4array info counterpart.
    pub fn precision_enum(&self) -> Option<DataPrecision> {
        DataPrecision::from_raw(self.precision)
    }
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O vertex attribute descriptor info counterpart.
pub struct VertexAttributeDescriptorInfo {
    pub name: String,
    pub format: u32,
    pub offset: usize,
    pub buffer_index: usize,
    pub time: f64,
    pub initialization_value: [f32; 4],
}

#[derive(Debug, Clone, Deserialize)]
/// Wraps the corresponding Model I/O vertex descriptor info counterpart.
pub struct VertexDescriptorInfo {
    pub attribute_count: usize,
    pub attributes: Vec<VertexAttributeDescriptorInfo>,
    pub layout_strides: Vec<usize>,
}

/// Groups helper APIs for the corresponding Model I/O vertex format symbols.
pub mod vertex_format {
    /// Exposes the corresponding Model I/O constant for invalid: u32.
    pub const INVALID: u32 = 0;
    /// Exposes the corresponding Model I/O constant for packed bit: u32.
    pub const PACKED_BIT: u32 = 0x1000;

    /// Exposes the corresponding Model I/O constant for uchar bits: u32.
    pub const UCHAR_BITS: u32 = 0x10000;
    /// Exposes the corresponding Model I/O constant for char bits: u32.
    pub const CHAR_BITS: u32 = 0x20000;
    /// Exposes the corresponding Model I/O constant for uchar normalized bits: u32.
    pub const UCHAR_NORMALIZED_BITS: u32 = 0x30000;
    /// Exposes the corresponding Model I/O constant for char normalized bits: u32.
    pub const CHAR_NORMALIZED_BITS: u32 = 0x40000;
    /// Exposes the corresponding Model I/O constant for ushort bits: u32.
    pub const USHORT_BITS: u32 = 0x50000;
    /// Exposes the corresponding Model I/O constant for short bits: u32.
    pub const SHORT_BITS: u32 = 0x60000;
    /// Exposes the corresponding Model I/O constant for ushort normalized bits: u32.
    pub const USHORT_NORMALIZED_BITS: u32 = 0x70000;
    /// Exposes the corresponding Model I/O constant for short normalized bits: u32.
    pub const SHORT_NORMALIZED_BITS: u32 = 0x80000;
    /// Exposes the corresponding Model I/O constant for uint bits: u32.
    pub const UINT_BITS: u32 = 0x90000;
    /// Exposes the corresponding Model I/O constant for int bits: u32.
    pub const INT_BITS: u32 = 0xA0000;
    /// Exposes the corresponding Model I/O constant for half bits: u32.
    pub const HALF_BITS: u32 = 0xB0000;
    /// Exposes the corresponding Model I/O constant for float bits: u32.
    pub const FLOAT_BITS: u32 = 0xC0000;

    /// Exposes the corresponding Model I/O constant for uchar: u32.
    pub const UCHAR: u32 = UCHAR_BITS | 1;
    /// Exposes the corresponding Model I/O constant for uchar2: u32.
    pub const UCHAR2: u32 = UCHAR_BITS | 2;
    /// Exposes the corresponding Model I/O constant for uchar3: u32.
    pub const UCHAR3: u32 = UCHAR_BITS | 3;
    /// Exposes the corresponding Model I/O constant for uchar4: u32.
    pub const UCHAR4: u32 = UCHAR_BITS | 4;

    /// Exposes the corresponding Model I/O constant for char: u32.
    pub const CHAR: u32 = CHAR_BITS | 1;
    /// Exposes the corresponding Model I/O constant for char2: u32.
    pub const CHAR2: u32 = CHAR_BITS | 2;
    /// Exposes the corresponding Model I/O constant for char3: u32.
    pub const CHAR3: u32 = CHAR_BITS | 3;
    /// Exposes the corresponding Model I/O constant for char4: u32.
    pub const CHAR4: u32 = CHAR_BITS | 4;

    /// Exposes the corresponding Model I/O constant for uchar normalized: u32.
    pub const UCHAR_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 1;
    /// Exposes the corresponding Model I/O constant for uchar2 normalized: u32.
    pub const UCHAR2_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 2;
    /// Exposes the corresponding Model I/O constant for uchar3 normalized: u32.
    pub const UCHAR3_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 3;
    /// Exposes the corresponding Model I/O constant for uchar4 normalized: u32.
    pub const UCHAR4_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 4;

    /// Exposes the corresponding Model I/O constant for char normalized: u32.
    pub const CHAR_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 1;
    /// Exposes the corresponding Model I/O constant for char2 normalized: u32.
    pub const CHAR2_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 2;
    /// Exposes the corresponding Model I/O constant for char3 normalized: u32.
    pub const CHAR3_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 3;
    /// Exposes the corresponding Model I/O constant for char4 normalized: u32.
    pub const CHAR4_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 4;

    /// Exposes the corresponding Model I/O constant for ushort: u32.
    pub const USHORT: u32 = USHORT_BITS | 1;
    /// Exposes the corresponding Model I/O constant for ushort2: u32.
    pub const USHORT2: u32 = USHORT_BITS | 2;
    /// Exposes the corresponding Model I/O constant for ushort3: u32.
    pub const USHORT3: u32 = USHORT_BITS | 3;
    /// Exposes the corresponding Model I/O constant for ushort4: u32.
    pub const USHORT4: u32 = USHORT_BITS | 4;

    /// Exposes the corresponding Model I/O constant for short: u32.
    pub const SHORT: u32 = SHORT_BITS | 1;
    /// Exposes the corresponding Model I/O constant for short2: u32.
    pub const SHORT2: u32 = SHORT_BITS | 2;
    /// Exposes the corresponding Model I/O constant for short3: u32.
    pub const SHORT3: u32 = SHORT_BITS | 3;
    /// Exposes the corresponding Model I/O constant for short4: u32.
    pub const SHORT4: u32 = SHORT_BITS | 4;

    /// Exposes the corresponding Model I/O constant for ushort normalized: u32.
    pub const USHORT_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 1;
    /// Exposes the corresponding Model I/O constant for ushort2 normalized: u32.
    pub const USHORT2_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 2;
    /// Exposes the corresponding Model I/O constant for ushort3 normalized: u32.
    pub const USHORT3_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 3;
    /// Exposes the corresponding Model I/O constant for ushort4 normalized: u32.
    pub const USHORT4_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 4;

    /// Exposes the corresponding Model I/O constant for short normalized: u32.
    pub const SHORT_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 1;
    /// Exposes the corresponding Model I/O constant for short2 normalized: u32.
    pub const SHORT2_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 2;
    /// Exposes the corresponding Model I/O constant for short3 normalized: u32.
    pub const SHORT3_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 3;
    /// Exposes the corresponding Model I/O constant for short4 normalized: u32.
    pub const SHORT4_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 4;

    /// Exposes the corresponding Model I/O constant for uint: u32.
    pub const UINT: u32 = UINT_BITS | 1;
    /// Exposes the corresponding Model I/O constant for uint2: u32.
    pub const UINT2: u32 = UINT_BITS | 2;
    /// Exposes the corresponding Model I/O constant for uint3: u32.
    pub const UINT3: u32 = UINT_BITS | 3;
    /// Exposes the corresponding Model I/O constant for uint4: u32.
    pub const UINT4: u32 = UINT_BITS | 4;

    /// Exposes the corresponding Model I/O constant for int: u32.
    pub const INT: u32 = INT_BITS | 1;
    /// Exposes the corresponding Model I/O constant for int2: u32.
    pub const INT2: u32 = INT_BITS | 2;
    /// Exposes the corresponding Model I/O constant for int3: u32.
    pub const INT3: u32 = INT_BITS | 3;
    /// Exposes the corresponding Model I/O constant for int4: u32.
    pub const INT4: u32 = INT_BITS | 4;

    /// Exposes the corresponding Model I/O constant for half: u32.
    pub const HALF: u32 = HALF_BITS | 1;
    /// Exposes the corresponding Model I/O constant for half2: u32.
    pub const HALF2: u32 = HALF_BITS | 2;
    /// Exposes the corresponding Model I/O constant for half3: u32.
    pub const HALF3: u32 = HALF_BITS | 3;
    /// Exposes the corresponding Model I/O constant for half4: u32.
    pub const HALF4: u32 = HALF_BITS | 4;

    /// Exposes the corresponding Model I/O constant for float: u32.
    pub const FLOAT: u32 = FLOAT_BITS | 1;
    /// Exposes the corresponding Model I/O constant for float2: u32.
    pub const FLOAT2: u32 = FLOAT_BITS | 2;
    /// Exposes the corresponding Model I/O constant for float3: u32.
    pub const FLOAT3: u32 = FLOAT_BITS | 3;
    /// Exposes the corresponding Model I/O constant for float4: u32.
    pub const FLOAT4: u32 = FLOAT_BITS | 4;

    /// Exposes the corresponding Model I/O constant for int1010102 normalized: u32.
    pub const INT1010102_NORMALIZED: u32 = INT_BITS | PACKED_BIT | 4;
    /// Exposes the corresponding Model I/O constant for uint1010102 normalized: u32.
    pub const UINT1010102_NORMALIZED: u32 = UINT_BITS | PACKED_BIT | 4;
}