ufbx.h 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089
  1. /*
  2. I removed C99 style comments, replaced "inline" with "__inline__", added this license block, otherwise verbatim.
  3. https://github.com/bqqbarbhg/ufbx
  4. ALTERNATIVE A - MIT License
  5. Copyright (c) 2020 Samuli Raivio
  6. Permission is hereby granted, free of charge, to any person obtaining a copy of
  7. this software and associated documentation files (the "Software"), to deal in
  8. the Software without restriction, including without limitation the rights to
  9. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  10. of the Software, and to permit persons to whom the Software is furnished to do
  11. so, subject to the following conditions:
  12. The above copyright notice and this permission notice shall be included in all
  13. copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. SOFTWARE.
  21. */
  22. #ifndef UFBX_UFBX_H_INLCUDED
  23. #define UFBX_UFBX_H_INLCUDED
  24. #if defined(UFBX_CONFIG_HEADER)
  25. #include UFBX_CONFIG_HEADER
  26. #endif
  27. #include <stdint.h>
  28. #include <stddef.h>
  29. #include <stdbool.h>
  30. #include <string.h>
  31. #if defined(_MSC_VER)
  32. #pragma warning(push)
  33. #pragma warning(disable: 4201)
  34. #pragma warning(disable: 4505)
  35. #define ufbx_inline static __forceinline
  36. #elif defined(__GNUC__)
  37. #define ufbx_inline static __inline__ __attribute__((always_inline, unused))
  38. #else
  39. #define ufbx_inline static
  40. #endif
  41. #ifndef ufbx_assert
  42. #include <assert.h>
  43. #define ufbx_assert(cond) assert(cond)
  44. #endif
  45. #define ufbx_nullable
  46. #define ufbx_unsafe
  47. #ifndef ufbx_abi
  48. #define ufbx_abi
  49. #endif
  50. typedef double ufbx_real;
  51. #define UFBX_ERROR_STACK_MAX_DEPTH 8
  52. #define UFBX_PANIC_MESSAGE_LENGTH 128
  53. #if defined(__cplusplus)
  54. #define UFBX_LIST_TYPE(p_name, p_type) struct p_name { p_type *data; size_t count; \
  55. p_type &operator[](size_t index) const { ufbx_assert(index < count); return data[index]; } \
  56. p_type *begin() const { return data; } \
  57. p_type *end() const { return data + count; } }
  58. #else
  59. #define UFBX_LIST_TYPE(p_name, p_type) typedef struct p_name { p_type *data; size_t count; } p_name
  60. #endif
  61. #if defined(__cplusplus)
  62. #define UFBX_VERTEX_ATTRIB_IMPL(p_type) \
  63. p_type &operator[](size_t index) const { ufbx_assert(index < indices.count); return values.data[indices.data[index]]; }
  64. #else
  65. #define UFBX_VERTEX_ATTRIB_IMPL(p_type)
  66. #endif
  67. #if defined(__cplusplus) && (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900))
  68. #define UFBX_CALLBACK_IMPL(p_name, p_fn, p_params, p_args) \
  69. p_name() = default; \
  70. p_name(p_fn *f) : fn(f), user(nullptr) { } \
  71. template <typename F> p_name(F &f) \
  72. : fn([] p_params { F *f = (F*)user; return f p_args; }), user((void*)&f) { }
  73. #else
  74. #define UFBX_CALLBACK_IMPL(p_name, p_fn, p_params, p_args)
  75. #endif
  76. #define ufbx_pack_version(major, minor, patch) ((uint32_t)(major)*1000000u + (uint32_t)(minor)*1000u + (uint32_t)(patch))
  77. #define ufbx_version_major(version) ((uint32_t)(version)/1000000u%1000u)
  78. #define ufbx_version_minor(version) ((uint32_t)(version)/1000u%1000u)
  79. #define ufbx_version_patch(version) ((uint32_t)(version)%1000u)
  80. #define UFBX_HEADER_VERSION ufbx_pack_version(0, 1, 1)
  81. #define UFBX_NO_INDEX ((uint32_t)~0u)
  82. typedef struct ufbx_string {
  83. const char *data;
  84. size_t length;
  85. } ufbx_string;
  86. typedef struct ufbx_blob {
  87. const void *data;
  88. size_t size;
  89. } ufbx_blob;
  90. typedef struct ufbx_vec2 {
  91. union {
  92. struct { ufbx_real x, y; };
  93. ufbx_real v[2];
  94. };
  95. } ufbx_vec2;
  96. typedef struct ufbx_vec3 {
  97. union {
  98. struct { ufbx_real x, y, z; };
  99. ufbx_real v[3];
  100. };
  101. } ufbx_vec3;
  102. typedef struct ufbx_vec4 {
  103. union {
  104. struct { ufbx_real x, y, z, w; };
  105. ufbx_real v[4];
  106. };
  107. } ufbx_vec4;
  108. typedef struct ufbx_quat {
  109. union {
  110. struct { ufbx_real x, y, z, w; };
  111. ufbx_real v[4];
  112. };
  113. } ufbx_quat;
  114. typedef enum ufbx_rotation_order {
  115. UFBX_ROTATION_XYZ,
  116. UFBX_ROTATION_XZY,
  117. UFBX_ROTATION_YZX,
  118. UFBX_ROTATION_YXZ,
  119. UFBX_ROTATION_ZXY,
  120. UFBX_ROTATION_ZYX,
  121. UFBX_ROTATION_SPHERIC,
  122. UFBX_ROTATION_ORDER_COUNT,
  123. UFBX_ROTATION_ORDER_FORCE_32BIT = 0x7fffffff,
  124. } ufbx_rotation_order;
  125. typedef struct ufbx_transform {
  126. ufbx_vec3 translation;
  127. ufbx_quat rotation;
  128. ufbx_vec3 scale;
  129. } ufbx_transform;
  130. typedef struct ufbx_matrix {
  131. union {
  132. struct {
  133. ufbx_real m00, m10, m20;
  134. ufbx_real m01, m11, m21;
  135. ufbx_real m02, m12, m22;
  136. ufbx_real m03, m13, m23;
  137. };
  138. ufbx_vec3 cols[4];
  139. ufbx_real v[12];
  140. };
  141. } ufbx_matrix;
  142. typedef struct ufbx_void_list {
  143. void *data;
  144. size_t count;
  145. } ufbx_void_list;
  146. UFBX_LIST_TYPE(ufbx_bool_list, bool);
  147. UFBX_LIST_TYPE(ufbx_uint32_list, uint32_t);
  148. UFBX_LIST_TYPE(ufbx_real_list, ufbx_real);
  149. UFBX_LIST_TYPE(ufbx_vec2_list, ufbx_vec2);
  150. UFBX_LIST_TYPE(ufbx_vec3_list, ufbx_vec3);
  151. UFBX_LIST_TYPE(ufbx_vec4_list, ufbx_vec4);
  152. UFBX_LIST_TYPE(ufbx_string_list, ufbx_string);
  153. typedef enum ufbx_dom_value_type {
  154. UFBX_DOM_VALUE_NUMBER,
  155. UFBX_DOM_VALUE_STRING,
  156. UFBX_DOM_VALUE_ARRAY_I8,
  157. UFBX_DOM_VALUE_ARRAY_I32,
  158. UFBX_DOM_VALUE_ARRAY_I64,
  159. UFBX_DOM_VALUE_ARRAY_F32,
  160. UFBX_DOM_VALUE_ARRAY_F64,
  161. UFBX_DOM_VALUE_ARRAY_RAW_STRING,
  162. UFBX_DOM_VALUE_ARRAY_IGNORED,
  163. UFBX_DOM_VALUE_TYPE_COUNT,
  164. UFBX_DOM_VALUE_TYPE_FORCE_32BIT = 0x7fffffff,
  165. } ufbx_dom_value_type;
  166. typedef struct ufbx_dom_node ufbx_dom_node;
  167. typedef struct ufbx_dom_value {
  168. ufbx_dom_value_type type;
  169. ufbx_string value_str;
  170. ufbx_blob value_blob;
  171. int64_t value_int;
  172. double value_float;
  173. } ufbx_dom_value;
  174. UFBX_LIST_TYPE(ufbx_dom_node_list, ufbx_dom_node*);
  175. UFBX_LIST_TYPE(ufbx_dom_value_list, ufbx_dom_value);
  176. struct ufbx_dom_node {
  177. ufbx_string name;
  178. ufbx_dom_node_list children;
  179. ufbx_dom_value_list values;
  180. };
  181. typedef struct ufbx_prop ufbx_prop;
  182. typedef struct ufbx_props ufbx_props;
  183. typedef enum ufbx_prop_type {
  184. UFBX_PROP_UNKNOWN,
  185. UFBX_PROP_BOOLEAN,
  186. UFBX_PROP_INTEGER,
  187. UFBX_PROP_NUMBER,
  188. UFBX_PROP_VECTOR,
  189. UFBX_PROP_COLOR,
  190. UFBX_PROP_COLOR_WITH_ALPHA,
  191. UFBX_PROP_STRING,
  192. UFBX_PROP_DATE_TIME,
  193. UFBX_PROP_TRANSLATION,
  194. UFBX_PROP_ROTATION,
  195. UFBX_PROP_SCALING,
  196. UFBX_PROP_DISTANCE,
  197. UFBX_PROP_COMPOUND,
  198. UFBX_PROP_BLOB,
  199. UFBX_PROP_REFERENCE,
  200. UFBX_NUM_PROP_TYPES,
  201. UFBX_PROP_TYPE_FORCE_32BIT = 0x7fffffff,
  202. } ufbx_prop_type;
  203. typedef enum ufbx_prop_flags {
  204. UFBX_PROP_FLAG_ANIMATABLE = 0x1,
  205. UFBX_PROP_FLAG_USER_DEFINED = 0x2,
  206. UFBX_PROP_FLAG_HIDDEN = 0x4,
  207. UFBX_PROP_FLAG_LOCK_X = 0x10,
  208. UFBX_PROP_FLAG_LOCK_Y = 0x20,
  209. UFBX_PROP_FLAG_LOCK_Z = 0x40,
  210. UFBX_PROP_FLAG_LOCK_W = 0x80,
  211. UFBX_PROP_FLAG_MUTE_X = 0x100,
  212. UFBX_PROP_FLAG_MUTE_Y = 0x200,
  213. UFBX_PROP_FLAG_MUTE_Z = 0x400,
  214. UFBX_PROP_FLAG_MUTE_W = 0x800,
  215. UFBX_PROP_FLAG_SYNTHETIC = 0x1000,
  216. UFBX_PROP_FLAG_ANIMATED = 0x2000,
  217. UFBX_PROP_FLAG_NOT_FOUND = 0x4000,
  218. UFBX_PROP_FLAG_CONNECTED = 0x8000,
  219. UFBX_PROP_FLAG_NO_VALUE = 0x10000,
  220. UFBX_PROP_FLAG_OVERRIDDEN = 0x20000,
  221. UFBX_PROP_FLAG_FORCE_32BIT = 0x7fffffff,
  222. } ufbx_prop_flags;
  223. struct ufbx_prop {
  224. ufbx_string name;
  225. uint32_t _internal_key;
  226. ufbx_prop_type type;
  227. ufbx_prop_flags flags;
  228. ufbx_string value_str;
  229. ufbx_blob value_blob;
  230. int64_t value_int;
  231. union {
  232. ufbx_real value_real_arr[4];
  233. ufbx_real value_real;
  234. ufbx_vec2 value_vec2;
  235. ufbx_vec3 value_vec3;
  236. ufbx_vec4 value_vec4;
  237. };
  238. };
  239. UFBX_LIST_TYPE(ufbx_prop_list, ufbx_prop);
  240. struct ufbx_props {
  241. ufbx_prop_list props;
  242. size_t num_animated;
  243. ufbx_nullable ufbx_props *defaults;
  244. };
  245. typedef struct ufbx_scene ufbx_scene;
  246. typedef struct ufbx_element ufbx_element;
  247. typedef struct ufbx_unknown ufbx_unknown;
  248. typedef struct ufbx_node ufbx_node;
  249. typedef struct ufbx_mesh ufbx_mesh;
  250. typedef struct ufbx_light ufbx_light;
  251. typedef struct ufbx_camera ufbx_camera;
  252. typedef struct ufbx_bone ufbx_bone;
  253. typedef struct ufbx_empty ufbx_empty;
  254. typedef struct ufbx_line_curve ufbx_line_curve;
  255. typedef struct ufbx_nurbs_curve ufbx_nurbs_curve;
  256. typedef struct ufbx_nurbs_surface ufbx_nurbs_surface;
  257. typedef struct ufbx_nurbs_trim_surface ufbx_nurbs_trim_surface;
  258. typedef struct ufbx_nurbs_trim_boundary ufbx_nurbs_trim_boundary;
  259. typedef struct ufbx_procedural_geometry ufbx_procedural_geometry;
  260. typedef struct ufbx_stereo_camera ufbx_stereo_camera;
  261. typedef struct ufbx_camera_switcher ufbx_camera_switcher;
  262. typedef struct ufbx_marker ufbx_marker;
  263. typedef struct ufbx_lod_group ufbx_lod_group;
  264. typedef struct ufbx_skin_deformer ufbx_skin_deformer;
  265. typedef struct ufbx_skin_cluster ufbx_skin_cluster;
  266. typedef struct ufbx_blend_deformer ufbx_blend_deformer;
  267. typedef struct ufbx_blend_channel ufbx_blend_channel;
  268. typedef struct ufbx_blend_shape ufbx_blend_shape;
  269. typedef struct ufbx_cache_deformer ufbx_cache_deformer;
  270. typedef struct ufbx_cache_file ufbx_cache_file;
  271. typedef struct ufbx_material ufbx_material;
  272. typedef struct ufbx_texture ufbx_texture;
  273. typedef struct ufbx_video ufbx_video;
  274. typedef struct ufbx_shader ufbx_shader;
  275. typedef struct ufbx_shader_binding ufbx_shader_binding;
  276. typedef struct ufbx_anim_stack ufbx_anim_stack;
  277. typedef struct ufbx_anim_layer ufbx_anim_layer;
  278. typedef struct ufbx_anim_value ufbx_anim_value;
  279. typedef struct ufbx_anim_curve ufbx_anim_curve;
  280. typedef struct ufbx_display_layer ufbx_display_layer;
  281. typedef struct ufbx_selection_set ufbx_selection_set;
  282. typedef struct ufbx_selection_node ufbx_selection_node;
  283. typedef struct ufbx_character ufbx_character;
  284. typedef struct ufbx_constraint ufbx_constraint;
  285. typedef struct ufbx_pose ufbx_pose;
  286. typedef struct ufbx_metadata_object ufbx_metadata_object;
  287. UFBX_LIST_TYPE(ufbx_element_list, ufbx_element*);
  288. UFBX_LIST_TYPE(ufbx_unknown_list, ufbx_unknown*);
  289. UFBX_LIST_TYPE(ufbx_node_list, ufbx_node*);
  290. UFBX_LIST_TYPE(ufbx_mesh_list, ufbx_mesh*);
  291. UFBX_LIST_TYPE(ufbx_light_list, ufbx_light*);
  292. UFBX_LIST_TYPE(ufbx_camera_list, ufbx_camera*);
  293. UFBX_LIST_TYPE(ufbx_bone_list, ufbx_bone*);
  294. UFBX_LIST_TYPE(ufbx_empty_list, ufbx_empty*);
  295. UFBX_LIST_TYPE(ufbx_line_curve_list, ufbx_line_curve*);
  296. UFBX_LIST_TYPE(ufbx_nurbs_curve_list, ufbx_nurbs_curve*);
  297. UFBX_LIST_TYPE(ufbx_nurbs_surface_list, ufbx_nurbs_surface*);
  298. UFBX_LIST_TYPE(ufbx_nurbs_trim_surface_list, ufbx_nurbs_trim_surface*);
  299. UFBX_LIST_TYPE(ufbx_nurbs_trim_boundary_list, ufbx_nurbs_trim_boundary*);
  300. UFBX_LIST_TYPE(ufbx_procedural_geometry_list, ufbx_procedural_geometry*);
  301. UFBX_LIST_TYPE(ufbx_stereo_camera_list, ufbx_stereo_camera*);
  302. UFBX_LIST_TYPE(ufbx_camera_switcher_list, ufbx_camera_switcher*);
  303. UFBX_LIST_TYPE(ufbx_marker_list, ufbx_marker*);
  304. UFBX_LIST_TYPE(ufbx_lod_group_list, ufbx_lod_group*);
  305. UFBX_LIST_TYPE(ufbx_skin_deformer_list, ufbx_skin_deformer*);
  306. UFBX_LIST_TYPE(ufbx_skin_cluster_list, ufbx_skin_cluster*);
  307. UFBX_LIST_TYPE(ufbx_blend_deformer_list, ufbx_blend_deformer*);
  308. UFBX_LIST_TYPE(ufbx_blend_channel_list, ufbx_blend_channel*);
  309. UFBX_LIST_TYPE(ufbx_blend_shape_list, ufbx_blend_shape*);
  310. UFBX_LIST_TYPE(ufbx_cache_deformer_list, ufbx_cache_deformer*);
  311. UFBX_LIST_TYPE(ufbx_cache_file_list, ufbx_cache_file*);
  312. UFBX_LIST_TYPE(ufbx_material_list, ufbx_material*);
  313. UFBX_LIST_TYPE(ufbx_texture_list, ufbx_texture*);
  314. UFBX_LIST_TYPE(ufbx_video_list, ufbx_video*);
  315. UFBX_LIST_TYPE(ufbx_shader_list, ufbx_shader*);
  316. UFBX_LIST_TYPE(ufbx_shader_binding_list, ufbx_shader_binding*);
  317. UFBX_LIST_TYPE(ufbx_anim_stack_list, ufbx_anim_stack*);
  318. UFBX_LIST_TYPE(ufbx_anim_layer_list, ufbx_anim_layer*);
  319. UFBX_LIST_TYPE(ufbx_anim_value_list, ufbx_anim_value*);
  320. UFBX_LIST_TYPE(ufbx_anim_curve_list, ufbx_anim_curve*);
  321. UFBX_LIST_TYPE(ufbx_display_layer_list, ufbx_display_layer*);
  322. UFBX_LIST_TYPE(ufbx_selection_set_list, ufbx_selection_set*);
  323. UFBX_LIST_TYPE(ufbx_selection_node_list, ufbx_selection_node*);
  324. UFBX_LIST_TYPE(ufbx_character_list, ufbx_character*);
  325. UFBX_LIST_TYPE(ufbx_constraint_list, ufbx_constraint*);
  326. UFBX_LIST_TYPE(ufbx_pose_list, ufbx_pose*);
  327. UFBX_LIST_TYPE(ufbx_metadata_object_list, ufbx_metadata_object*);
  328. typedef enum ufbx_element_type {
  329. UFBX_ELEMENT_UNKNOWN,
  330. UFBX_ELEMENT_NODE,
  331. UFBX_ELEMENT_MESH,
  332. UFBX_ELEMENT_LIGHT,
  333. UFBX_ELEMENT_CAMERA,
  334. UFBX_ELEMENT_BONE,
  335. UFBX_ELEMENT_EMPTY,
  336. UFBX_ELEMENT_LINE_CURVE,
  337. UFBX_ELEMENT_NURBS_CURVE,
  338. UFBX_ELEMENT_NURBS_SURFACE,
  339. UFBX_ELEMENT_NURBS_TRIM_SURFACE,
  340. UFBX_ELEMENT_NURBS_TRIM_BOUNDARY,
  341. UFBX_ELEMENT_PROCEDURAL_GEOMETRY,
  342. UFBX_ELEMENT_STEREO_CAMERA,
  343. UFBX_ELEMENT_CAMERA_SWITCHER,
  344. UFBX_ELEMENT_MARKER,
  345. UFBX_ELEMENT_LOD_GROUP,
  346. UFBX_ELEMENT_SKIN_DEFORMER,
  347. UFBX_ELEMENT_SKIN_CLUSTER,
  348. UFBX_ELEMENT_BLEND_DEFORMER,
  349. UFBX_ELEMENT_BLEND_CHANNEL,
  350. UFBX_ELEMENT_BLEND_SHAPE,
  351. UFBX_ELEMENT_CACHE_DEFORMER,
  352. UFBX_ELEMENT_CACHE_FILE,
  353. UFBX_ELEMENT_MATERIAL,
  354. UFBX_ELEMENT_TEXTURE,
  355. UFBX_ELEMENT_VIDEO,
  356. UFBX_ELEMENT_SHADER,
  357. UFBX_ELEMENT_SHADER_BINDING,
  358. UFBX_ELEMENT_ANIM_STACK,
  359. UFBX_ELEMENT_ANIM_LAYER,
  360. UFBX_ELEMENT_ANIM_VALUE,
  361. UFBX_ELEMENT_ANIM_CURVE,
  362. UFBX_ELEMENT_DISPLAY_LAYER,
  363. UFBX_ELEMENT_SELECTION_SET,
  364. UFBX_ELEMENT_SELECTION_NODE,
  365. UFBX_ELEMENT_CHARACTER,
  366. UFBX_ELEMENT_CONSTRAINT,
  367. UFBX_ELEMENT_POSE,
  368. UFBX_ELEMENT_METADATA_OBJECT,
  369. UFBX_ELEMENT_TYPE_COUNT,
  370. UFBX_ELEMENT_TYPE_FORCE_32BIT = 0x7fffffff,
  371. UFBX_ELEMENT_TYPE_FIRST_ATTRIB = UFBX_ELEMENT_MESH,
  372. UFBX_ELEMENT_TYPE_LAST_ATTRIB = UFBX_ELEMENT_LOD_GROUP,
  373. } ufbx_element_type;
  374. typedef struct ufbx_connection {
  375. ufbx_element *src;
  376. ufbx_element *dst;
  377. ufbx_string src_prop;
  378. ufbx_string dst_prop;
  379. } ufbx_connection;
  380. UFBX_LIST_TYPE(ufbx_connection_list, ufbx_connection);
  381. struct ufbx_element {
  382. ufbx_string name;
  383. ufbx_props props;
  384. uint32_t element_id;
  385. uint32_t typed_id;
  386. ufbx_node_list instances;
  387. ufbx_element_type type;
  388. ufbx_connection_list connections_src;
  389. ufbx_connection_list connections_dst;
  390. ufbx_nullable ufbx_dom_node *dom_node;
  391. ufbx_scene *scene;
  392. };
  393. struct ufbx_unknown {
  394. union { ufbx_element element; struct {
  395. ufbx_string name;
  396. ufbx_props props;
  397. uint32_t element_id;
  398. uint32_t typed_id;
  399. }; };
  400. ufbx_string type;
  401. ufbx_string super_type;
  402. ufbx_string sub_type;
  403. };
  404. typedef enum ufbx_inherit_type {
  405. UFBX_INHERIT_NO_SHEAR,
  406. UFBX_INHERIT_NORMAL,
  407. UFBX_INHERIT_NO_SCALE,
  408. UFBX_INHERIT_TYPE_COUNT,
  409. UFBX_INHERIT_TYPE_FORCE_32BIT = 0x7fffffff,
  410. } ufbx_inherit_type;
  411. struct ufbx_node {
  412. union { ufbx_element element; struct {
  413. ufbx_string name;
  414. ufbx_props props;
  415. uint32_t element_id;
  416. uint32_t typed_id;
  417. }; };
  418. ufbx_nullable ufbx_node *parent;
  419. ufbx_node_list children;
  420. ufbx_nullable ufbx_mesh *mesh;
  421. ufbx_nullable ufbx_light *light;
  422. ufbx_nullable ufbx_camera *camera;
  423. ufbx_nullable ufbx_bone *bone;
  424. ufbx_nullable ufbx_element *attrib;
  425. ufbx_element_type attrib_type;
  426. ufbx_element_list all_attribs;
  427. ufbx_inherit_type inherit_type;
  428. ufbx_transform local_transform;
  429. ufbx_transform geometry_transform;
  430. ufbx_rotation_order rotation_order;
  431. ufbx_vec3 euler_rotation;
  432. ufbx_transform world_transform;
  433. ufbx_matrix node_to_parent;
  434. ufbx_matrix node_to_world;
  435. ufbx_matrix geometry_to_node;
  436. ufbx_matrix geometry_to_world;
  437. ufbx_material_list materials;
  438. bool visible;
  439. bool is_root;
  440. uint32_t node_depth;
  441. };
  442. typedef struct ufbx_vertex_attrib {
  443. bool exists;
  444. ufbx_void_list values;
  445. ufbx_uint32_list indices;
  446. size_t value_reals;
  447. bool unique_per_vertex;
  448. } ufbx_vertex_attrib;
  449. typedef struct ufbx_vertex_real {
  450. bool exists;
  451. ufbx_real_list values;
  452. ufbx_uint32_list indices;
  453. size_t value_reals;
  454. bool unique_per_vertex;
  455. UFBX_VERTEX_ATTRIB_IMPL(ufbx_real)
  456. } ufbx_vertex_real;
  457. typedef struct ufbx_vertex_vec2 {
  458. bool exists;
  459. ufbx_vec2_list values;
  460. ufbx_uint32_list indices;
  461. size_t value_reals;
  462. bool unique_per_vertex;
  463. UFBX_VERTEX_ATTRIB_IMPL(ufbx_vec2)
  464. } ufbx_vertex_vec2;
  465. typedef struct ufbx_vertex_vec3 {
  466. bool exists;
  467. ufbx_vec3_list values;
  468. ufbx_uint32_list indices;
  469. size_t value_reals;
  470. bool unique_per_vertex;
  471. UFBX_VERTEX_ATTRIB_IMPL(ufbx_vec3)
  472. } ufbx_vertex_vec3;
  473. typedef struct ufbx_vertex_vec4 {
  474. bool exists;
  475. ufbx_vec4_list values;
  476. ufbx_uint32_list indices;
  477. size_t value_reals;
  478. bool unique_per_vertex;
  479. UFBX_VERTEX_ATTRIB_IMPL(ufbx_vec4)
  480. } ufbx_vertex_vec4;
  481. typedef struct ufbx_uv_set {
  482. ufbx_string name;
  483. uint32_t index;
  484. ufbx_vertex_vec2 vertex_uv;
  485. ufbx_vertex_vec3 vertex_tangent;
  486. ufbx_vertex_vec3 vertex_bitangent;
  487. } ufbx_uv_set;
  488. typedef struct ufbx_color_set {
  489. ufbx_string name;
  490. uint32_t index;
  491. ufbx_vertex_vec4 vertex_color;
  492. } ufbx_color_set;
  493. UFBX_LIST_TYPE(ufbx_uv_set_list, ufbx_uv_set);
  494. UFBX_LIST_TYPE(ufbx_color_set_list, ufbx_color_set);
  495. typedef struct ufbx_edge {
  496. union {
  497. struct { uint32_t a, b; };
  498. uint32_t indices[2];
  499. };
  500. } ufbx_edge;
  501. UFBX_LIST_TYPE(ufbx_edge_list, ufbx_edge);
  502. typedef struct ufbx_face {
  503. uint32_t index_begin;
  504. uint32_t num_indices;
  505. } ufbx_face;
  506. UFBX_LIST_TYPE(ufbx_face_list, ufbx_face);
  507. typedef struct ufbx_mesh_material {
  508. ufbx_nullable ufbx_material *material;
  509. size_t num_faces;
  510. size_t num_triangles;
  511. ufbx_uint32_list face_indices;
  512. } ufbx_mesh_material;
  513. UFBX_LIST_TYPE(ufbx_mesh_material_list, ufbx_mesh_material);
  514. typedef struct ufbx_subdivision_weight_range {
  515. uint32_t weight_begin;
  516. uint32_t num_weights;
  517. } ufbx_subdivision_weight_range;
  518. UFBX_LIST_TYPE(ufbx_subdivision_weight_range_list, ufbx_subdivision_weight_range);
  519. typedef struct ufbx_subdivision_weight {
  520. ufbx_real weight;
  521. uint32_t index;
  522. } ufbx_subdivision_weight;
  523. UFBX_LIST_TYPE(ufbx_subdivision_weight_list, ufbx_subdivision_weight);
  524. typedef struct ufbx_subdivision_result {
  525. size_t result_memory_used;
  526. size_t temp_memory_used;
  527. size_t result_allocs;
  528. size_t temp_allocs;
  529. ufbx_subdivision_weight_range_list source_vertex_ranges;
  530. ufbx_subdivision_weight_list source_vertex_weights;
  531. ufbx_subdivision_weight_range_list skin_cluster_ranges;
  532. ufbx_subdivision_weight_list skin_cluster_weights;
  533. } ufbx_subdivision_result;
  534. typedef enum ufbx_subdivision_display_mode {
  535. UFBX_SUBDIVISION_DISPLAY_DISABLED,
  536. UFBX_SUBDIVISION_DISPLAY_HULL,
  537. UFBX_SUBDIVISION_DISPLAY_HULL_AND_SMOOTH,
  538. UFBX_SUBDIVISION_DISPLAY_SMOOTH,
  539. UFBX_SUBDIVISION_DISPLAY_MODE_COUNT,
  540. UFBX_SUBDIVISION_DISPLAY_MODE_FORCE_32BIT = 0x7fffffff,
  541. } ufbx_subdivision_display_mode;
  542. typedef enum ufbx_subdivision_boundary {
  543. UFBX_SUBDIVISION_BOUNDARY_DEFAULT,
  544. UFBX_SUBDIVISION_BOUNDARY_LEGACY,
  545. UFBX_SUBDIVISION_BOUNDARY_SHARP_CORNERS,
  546. UFBX_SUBDIVISION_BOUNDARY_SHARP_NONE,
  547. UFBX_SUBDIVISION_BOUNDARY_SHARP_BOUNDARY,
  548. UFBX_SUBDIVISION_BOUNDARY_SHARP_INTERIOR,
  549. UFBX_SUBDIVISION_BOUNDARY_COUNT,
  550. UFBX_SUBDIVISION_BOUNDARY_FORCE_32BIT = 0x7fffffff,
  551. } ufbx_subdivision_boundary;
  552. struct ufbx_mesh {
  553. union { ufbx_element element; struct {
  554. ufbx_string name;
  555. ufbx_props props;
  556. uint32_t element_id;
  557. uint32_t typed_id;
  558. ufbx_node_list instances;
  559. }; };
  560. size_t num_vertices;
  561. size_t num_indices;
  562. size_t num_faces;
  563. size_t num_triangles;
  564. size_t num_edges;
  565. ufbx_face_list faces;
  566. ufbx_bool_list face_smoothing;
  567. ufbx_uint32_list face_material;
  568. ufbx_uint32_list face_group;
  569. ufbx_bool_list face_hole;
  570. size_t max_face_triangles;
  571. size_t num_bad_faces;
  572. ufbx_edge_list edges;
  573. ufbx_bool_list edge_smoothing;
  574. ufbx_real_list edge_crease;
  575. ufbx_bool_list edge_visibility;
  576. ufbx_uint32_list vertex_indices;
  577. ufbx_vec3_list vertices;
  578. ufbx_uint32_list vertex_first_index;
  579. ufbx_vertex_vec3 vertex_position;
  580. ufbx_vertex_vec3 vertex_normal;
  581. ufbx_vertex_vec2 vertex_uv;
  582. ufbx_vertex_vec3 vertex_tangent;
  583. ufbx_vertex_vec3 vertex_bitangent;
  584. ufbx_vertex_vec4 vertex_color;
  585. ufbx_vertex_real vertex_crease;
  586. ufbx_uv_set_list uv_sets;
  587. ufbx_color_set_list color_sets;
  588. ufbx_mesh_material_list materials;
  589. bool skinned_is_local;
  590. ufbx_vertex_vec3 skinned_position;
  591. ufbx_vertex_vec3 skinned_normal;
  592. ufbx_skin_deformer_list skin_deformers;
  593. ufbx_blend_deformer_list blend_deformers;
  594. ufbx_cache_deformer_list cache_deformers;
  595. ufbx_element_list all_deformers;
  596. uint32_t subdivision_preview_levels;
  597. uint32_t subdivision_render_levels;
  598. ufbx_subdivision_display_mode subdivision_display_mode;
  599. ufbx_subdivision_boundary subdivision_boundary;
  600. ufbx_subdivision_boundary subdivision_uv_boundary;
  601. bool subdivision_evaluated;
  602. ufbx_nullable ufbx_subdivision_result *subdivision_result;
  603. bool from_tessellated_nurbs;
  604. };
  605. typedef enum ufbx_light_type {
  606. UFBX_LIGHT_POINT,
  607. UFBX_LIGHT_DIRECTIONAL,
  608. UFBX_LIGHT_SPOT,
  609. UFBX_LIGHT_AREA,
  610. UFBX_LIGHT_VOLUME,
  611. UFBX_LIGHT_TYPE_COUNT,
  612. UFBX_LIGHT_TYPE_FORCE_32BIT = 0x7fffffff,
  613. } ufbx_light_type;
  614. typedef enum ufbx_light_decay {
  615. UFBX_LIGHT_DECAY_NONE,
  616. UFBX_LIGHT_DECAY_LINEAR,
  617. UFBX_LIGHT_DECAY_QUADRATIC,
  618. UFBX_LIGHT_DECAY_CUBIC,
  619. UFBX_LIGHT_DECAY_COUNT,
  620. UFBX_LIGHT_DECAY_FORCE_32BIT = 0x7fffffff,
  621. } ufbx_light_decay;
  622. typedef enum ufbx_light_area_shape {
  623. UFBX_LIGHT_AREA_SHAPE_RECTANGLE,
  624. UFBX_LIGHT_AREA_SHAPE_SPHERE,
  625. UFBX_LIGHT_AREA_SHAPE_COUNT,
  626. UFBX_LIGHT_AREA_SHAPE_FORCE_32BIT = 0x7fffffff,
  627. } ufbx_light_area_shape;
  628. struct ufbx_light {
  629. union { ufbx_element element; struct {
  630. ufbx_string name;
  631. ufbx_props props;
  632. uint32_t element_id;
  633. uint32_t typed_id;
  634. ufbx_node_list instances;
  635. }; };
  636. ufbx_vec3 color;
  637. ufbx_real intensity;
  638. ufbx_vec3 local_direction;
  639. ufbx_light_type type;
  640. ufbx_light_decay decay;
  641. ufbx_light_area_shape area_shape;
  642. ufbx_real inner_angle;
  643. ufbx_real outer_angle;
  644. bool cast_light;
  645. bool cast_shadows;
  646. };
  647. typedef enum ufbx_aspect_mode {
  648. UFBX_ASPECT_MODE_WINDOW_SIZE,
  649. UFBX_ASPECT_MODE_FIXED_RATIO,
  650. UFBX_ASPECT_MODE_FIXED_RESOLUTION,
  651. UFBX_ASPECT_MODE_FIXED_WIDTH,
  652. UFBX_ASPECT_MODE_FIXED_HEIGHT,
  653. UFBX_ASPECT_MODE_COUNT,
  654. UFBX_ASPECT_MODE_FORCE_32BIT = 0x7fffffff,
  655. } ufbx_aspect_mode;
  656. typedef enum ufbx_aperture_mode {
  657. UFBX_APERTURE_MODE_HORIZONTAL_AND_VERTICAL,
  658. UFBX_APERTURE_MODE_HORIZONTAL,
  659. UFBX_APERTURE_MODE_VERTICAL,
  660. UFBX_APERTURE_MODE_FOCAL_LENGTH,
  661. UFBX_APERTURE_MODE_COUNT,
  662. UFBX_APERTURE_MODE_FORCE_32BIT = 0x7fffffff,
  663. } ufbx_aperture_mode;
  664. typedef enum ufbx_gate_fit {
  665. UFBX_GATE_FIT_NONE,
  666. UFBX_GATE_FIT_VERTICAL,
  667. UFBX_GATE_FIT_HORIZONTAL,
  668. UFBX_GATE_FIT_FILL,
  669. UFBX_GATE_FIT_OVERSCAN,
  670. UFBX_GATE_FIT_STRETCH,
  671. UFBX_GATE_FIT_COUNT,
  672. UFBX_GATE_FIT_FORCE_32BIT = 0x7fffffff,
  673. } ufbx_gate_fit;
  674. typedef enum ufbx_aperture_format {
  675. UFBX_APERTURE_FORMAT_CUSTOM,
  676. UFBX_APERTURE_FORMAT_16MM_THEATRICAL,
  677. UFBX_APERTURE_FORMAT_SUPER_16MM,
  678. UFBX_APERTURE_FORMAT_35MM_ACADEMY,
  679. UFBX_APERTURE_FORMAT_35MM_TV_PROJECTION,
  680. UFBX_APERTURE_FORMAT_35MM_FULL_APERTURE,
  681. UFBX_APERTURE_FORMAT_35MM_185_PROJECTION,
  682. UFBX_APERTURE_FORMAT_35MM_ANAMORPHIC,
  683. UFBX_APERTURE_FORMAT_70MM_PROJECTION,
  684. UFBX_APERTURE_FORMAT_VISTAVISION,
  685. UFBX_APERTURE_FORMAT_DYNAVISION,
  686. UFBX_APERTURE_FORMAT_IMAX,
  687. UFBX_APERTURE_FORMAT_COUNT,
  688. UFBX_APERTURE_FORMAT_FORCE_32BIT = 0x7fffffff,
  689. } ufbx_aperture_format;
  690. struct ufbx_camera {
  691. union { ufbx_element element; struct {
  692. ufbx_string name;
  693. ufbx_props props;
  694. uint32_t element_id;
  695. uint32_t typed_id;
  696. ufbx_node_list instances;
  697. }; };
  698. bool resolution_is_pixels;
  699. ufbx_vec2 resolution;
  700. ufbx_vec2 field_of_view_deg;
  701. ufbx_vec2 field_of_view_tan;
  702. ufbx_aspect_mode aspect_mode;
  703. ufbx_aperture_mode aperture_mode;
  704. ufbx_gate_fit gate_fit;
  705. ufbx_aperture_format aperture_format;
  706. ufbx_real focal_length_mm;
  707. ufbx_vec2 film_size_inch;
  708. ufbx_vec2 aperture_size_inch;
  709. ufbx_real squeeze_ratio;
  710. };
  711. struct ufbx_bone {
  712. union { ufbx_element element; struct {
  713. ufbx_string name;
  714. ufbx_props props;
  715. uint32_t element_id;
  716. uint32_t typed_id;
  717. ufbx_node_list instances;
  718. }; };
  719. ufbx_real radius;
  720. ufbx_real relative_length;
  721. bool is_root;
  722. };
  723. struct ufbx_empty {
  724. union { ufbx_element element; struct {
  725. ufbx_string name;
  726. ufbx_props props;
  727. uint32_t element_id;
  728. uint32_t typed_id;
  729. ufbx_node_list instances;
  730. }; };
  731. };
  732. typedef struct ufbx_line_segment {
  733. uint32_t index_begin;
  734. uint32_t num_indices;
  735. } ufbx_line_segment;
  736. UFBX_LIST_TYPE(ufbx_line_segment_list, ufbx_line_segment);
  737. struct ufbx_line_curve {
  738. union { ufbx_element element; struct {
  739. ufbx_string name;
  740. ufbx_props props;
  741. uint32_t element_id;
  742. uint32_t typed_id;
  743. ufbx_node_list instances;
  744. }; };
  745. ufbx_vec3 color;
  746. ufbx_vec3_list control_points;
  747. ufbx_uint32_list point_indices;
  748. ufbx_line_segment_list segments;
  749. bool from_tessellated_nurbs;
  750. };
  751. typedef enum ufbx_nurbs_topology {
  752. UFBX_NURBS_TOPOLOGY_OPEN,
  753. UFBX_NURBS_TOPOLOGY_PERIODIC,
  754. UFBX_NURBS_TOPOLOGY_CLOSED,
  755. UFBX_NURBS_TOPOLOGY_COUNT,
  756. UFBX_NURBS_TOPOLOGY_FORCE_32BIT = 0x7fffffff,
  757. } ufbx_nurbs_topology;
  758. typedef struct ufbx_nurbs_basis {
  759. uint32_t order;
  760. ufbx_nurbs_topology topology;
  761. ufbx_real_list knot_vector;
  762. ufbx_real t_min;
  763. ufbx_real t_max;
  764. ufbx_real_list spans;
  765. bool is_2d;
  766. size_t num_wrap_control_points;
  767. bool valid;
  768. } ufbx_nurbs_basis;
  769. struct ufbx_nurbs_curve {
  770. union { ufbx_element element; struct {
  771. ufbx_string name;
  772. ufbx_props props;
  773. uint32_t element_id;
  774. uint32_t typed_id;
  775. ufbx_node_list instances;
  776. }; };
  777. ufbx_nurbs_basis basis;
  778. ufbx_vec4_list control_points;
  779. };
  780. struct ufbx_nurbs_surface {
  781. union { ufbx_element element; struct {
  782. ufbx_string name;
  783. ufbx_props props;
  784. uint32_t element_id;
  785. uint32_t typed_id;
  786. ufbx_node_list instances;
  787. }; };
  788. ufbx_nurbs_basis basis_u;
  789. ufbx_nurbs_basis basis_v;
  790. size_t num_control_points_u;
  791. size_t num_control_points_v;
  792. ufbx_vec4_list control_points;
  793. uint32_t span_subdivision_u;
  794. uint32_t span_subdivision_v;
  795. bool flip_normals;
  796. ufbx_nullable ufbx_material *material;
  797. };
  798. struct ufbx_nurbs_trim_surface {
  799. union { ufbx_element element; struct {
  800. ufbx_string name;
  801. ufbx_props props;
  802. uint32_t element_id;
  803. uint32_t typed_id;
  804. ufbx_node_list instances;
  805. }; };
  806. };
  807. struct ufbx_nurbs_trim_boundary {
  808. union { ufbx_element element; struct {
  809. ufbx_string name;
  810. ufbx_props props;
  811. uint32_t element_id;
  812. uint32_t typed_id;
  813. ufbx_node_list instances;
  814. }; };
  815. };
  816. struct ufbx_procedural_geometry {
  817. union { ufbx_element element; struct {
  818. ufbx_string name;
  819. ufbx_props props;
  820. uint32_t element_id;
  821. uint32_t typed_id;
  822. ufbx_node_list instances;
  823. }; };
  824. };
  825. struct ufbx_stereo_camera {
  826. union { ufbx_element element; struct {
  827. ufbx_string name;
  828. ufbx_props props;
  829. uint32_t element_id;
  830. uint32_t typed_id;
  831. ufbx_node_list instances;
  832. }; };
  833. ufbx_camera *left;
  834. ufbx_camera *right;
  835. };
  836. struct ufbx_camera_switcher {
  837. union { ufbx_element element; struct {
  838. ufbx_string name;
  839. ufbx_props props;
  840. uint32_t element_id;
  841. uint32_t typed_id;
  842. ufbx_node_list instances;
  843. }; };
  844. };
  845. typedef enum ufbx_marker_type {
  846. UFBX_MARKER_UNKNOWN,
  847. UFBX_MARKER_FK_EFFECTOR,
  848. UFBX_MARKER_IK_EFFECTOR,
  849. UFBX_MARKER_TYPE_COUNT,
  850. UFBX_MARKER_TYPE_FORCE_32BIT = 0x7fffffff,
  851. } ufbx_marker_type;
  852. struct ufbx_marker {
  853. union { ufbx_element element; struct {
  854. ufbx_string name;
  855. ufbx_props props;
  856. uint32_t element_id;
  857. uint32_t typed_id;
  858. ufbx_node_list instances;
  859. }; };
  860. ufbx_marker_type type;
  861. };
  862. typedef enum ufbx_lod_display {
  863. UFBX_LOD_DISPLAY_USE_LOD,
  864. UFBX_LOD_DISPLAY_SHOW,
  865. UFBX_LOD_DISPLAY_HIDE,
  866. UFBX_LOD_DISPLAY_COUNT,
  867. UFBX_LOD_DISPLAY_FORCE_32BIT = 0x7fffffff,
  868. } ufbx_lod_display;
  869. typedef struct ufbx_lod_level {
  870. ufbx_real distance;
  871. ufbx_lod_display display;
  872. } ufbx_lod_level;
  873. UFBX_LIST_TYPE(ufbx_lod_level_list, ufbx_lod_level);
  874. struct ufbx_lod_group {
  875. union { ufbx_element element; struct {
  876. ufbx_string name;
  877. ufbx_props props;
  878. uint32_t element_id;
  879. uint32_t typed_id;
  880. ufbx_node_list instances;
  881. }; };
  882. bool relative_distances;
  883. ufbx_lod_level_list lod_levels;
  884. bool ignore_parent_transform;
  885. bool use_distance_limit;
  886. ufbx_real distance_limit_min;
  887. ufbx_real distance_limit_max;
  888. };
  889. typedef enum ufbx_skinning_method {
  890. UFBX_SKINNING_METHOD_LINEAR,
  891. UFBX_SKINNING_METHOD_RIGID,
  892. UFBX_SKINNING_METHOD_DUAL_QUATERNION,
  893. UFBX_SKINNING_METHOD_BLENDED_DQ_LINEAR,
  894. UFBX_SKINNING_METHOD_COUNT,
  895. UFBX_SKINNING_METHOD_FORCE_32BIT = 0x7fffffff,
  896. } ufbx_skinning_method;
  897. typedef struct ufbx_skin_vertex {
  898. uint32_t weight_begin;
  899. uint32_t num_weights;
  900. ufbx_real dq_weight;
  901. } ufbx_skin_vertex;
  902. UFBX_LIST_TYPE(ufbx_skin_vertex_list, ufbx_skin_vertex);
  903. typedef struct ufbx_skin_weight {
  904. uint32_t cluster_index;
  905. ufbx_real weight;
  906. } ufbx_skin_weight;
  907. UFBX_LIST_TYPE(ufbx_skin_weight_list, ufbx_skin_weight);
  908. struct ufbx_skin_deformer {
  909. union { ufbx_element element; struct {
  910. ufbx_string name;
  911. ufbx_props props;
  912. uint32_t element_id;
  913. uint32_t typed_id;
  914. }; };
  915. ufbx_skinning_method skinning_method;
  916. ufbx_skin_cluster_list clusters;
  917. ufbx_skin_vertex_list vertices;
  918. ufbx_skin_weight_list weights;
  919. size_t max_weights_per_vertex;
  920. size_t num_dq_weights;
  921. ufbx_uint32_list dq_vertices;
  922. ufbx_real_list dq_weights;
  923. };
  924. struct ufbx_skin_cluster {
  925. union { ufbx_element element; struct {
  926. ufbx_string name;
  927. ufbx_props props;
  928. uint32_t element_id;
  929. uint32_t typed_id;
  930. }; };
  931. ufbx_nullable ufbx_node *bone_node;
  932. ufbx_matrix geometry_to_bone;
  933. ufbx_matrix mesh_node_to_bone;
  934. ufbx_matrix bind_to_world;
  935. ufbx_matrix geometry_to_world;
  936. ufbx_transform geometry_to_world_transform;
  937. size_t num_weights;
  938. ufbx_uint32_list vertices;
  939. ufbx_real_list weights;
  940. };
  941. struct ufbx_blend_deformer {
  942. union { ufbx_element element; struct {
  943. ufbx_string name;
  944. ufbx_props props;
  945. uint32_t element_id;
  946. uint32_t typed_id;
  947. }; };
  948. ufbx_blend_channel_list channels;
  949. };
  950. typedef struct ufbx_blend_keyframe {
  951. ufbx_blend_shape *shape;
  952. ufbx_real target_weight;
  953. ufbx_real effective_weight;
  954. } ufbx_blend_keyframe;
  955. UFBX_LIST_TYPE(ufbx_blend_keyframe_list, ufbx_blend_keyframe);
  956. struct ufbx_blend_channel {
  957. union { ufbx_element element; struct {
  958. ufbx_string name;
  959. ufbx_props props;
  960. uint32_t element_id;
  961. uint32_t typed_id;
  962. }; };
  963. ufbx_real weight;
  964. ufbx_blend_keyframe_list keyframes;
  965. };
  966. struct ufbx_blend_shape {
  967. union { ufbx_element element; struct {
  968. ufbx_string name;
  969. ufbx_props props;
  970. uint32_t element_id;
  971. uint32_t typed_id;
  972. }; };
  973. size_t num_offsets;
  974. ufbx_uint32_list offset_vertices;
  975. ufbx_vec3_list position_offsets;
  976. ufbx_vec3_list normal_offsets;
  977. };
  978. typedef enum ufbx_cache_file_format {
  979. UFBX_CACHE_FILE_FORMAT_UNKNOWN,
  980. UFBX_CACHE_FILE_FORMAT_PC2,
  981. UFBX_CACHE_FILE_FORMAT_MC,
  982. UFBX_CACHE_FILE_FORMAT_COUNT,
  983. UFBX_CACHE_FILE_FORMAT_FORCE_32BIT = 0x7fffffff,
  984. } ufbx_cache_file_format;
  985. typedef enum ufbx_cache_data_format {
  986. UFBX_CACHE_DATA_FORMAT_UNKNOWN,
  987. UFBX_CACHE_DATA_FORMAT_REAL_FLOAT,
  988. UFBX_CACHE_DATA_FORMAT_VEC3_FLOAT,
  989. UFBX_CACHE_DATA_FORMAT_REAL_DOUBLE,
  990. UFBX_CACHE_DATA_FORMAT_VEC3_DOUBLE,
  991. UFBX_CACHE_DATA_FORMAT_COUNT,
  992. UFBX_CACHE_DATA_FORMAT_FORCE_32BIT = 0x7fffffff,
  993. } ufbx_cache_data_format;
  994. typedef enum ufbx_cache_data_encoding {
  995. UFBX_CACHE_DATA_ENCODING_UNKNOWN,
  996. UFBX_CACHE_DATA_ENCODING_LITTLE_ENDIAN,
  997. UFBX_CACHE_DATA_ENCODING_BIG_ENDIAN,
  998. UFBX_CACHE_DATA_ENCODING_COUNT,
  999. UFBX_CACHE_DATA_ENCODING_FORCE_32BIT = 0x7fffffff,
  1000. } ufbx_cache_data_encoding;
  1001. typedef enum ufbx_cache_interpretation {
  1002. UFBX_CACHE_INTERPRETATION_UNKNOWN,
  1003. UFBX_CACHE_INTERPRETATION_POINTS,
  1004. UFBX_CACHE_INTERPRETATION_VERTEX_POSITION,
  1005. UFBX_CACHE_INTERPRETATION_VERTEX_NORMAL,
  1006. UFBX_CACHE_INTERPRETATION_COUNT,
  1007. UFBX_CACHE_INTERPRETATION_FORCE_32BIT = 0x7fffffff,
  1008. } ufbx_cache_interpretation;
  1009. typedef struct ufbx_cache_frame {
  1010. ufbx_string channel;
  1011. double time;
  1012. ufbx_string filename;
  1013. ufbx_cache_file_format file_format;
  1014. ufbx_cache_data_format data_format;
  1015. ufbx_cache_data_encoding data_encoding;
  1016. uint64_t data_offset;
  1017. uint32_t data_count;
  1018. uint32_t data_element_bytes;
  1019. uint64_t data_total_bytes;
  1020. } ufbx_cache_frame;
  1021. UFBX_LIST_TYPE(ufbx_cache_frame_list, ufbx_cache_frame);
  1022. typedef struct ufbx_cache_channel {
  1023. ufbx_string name;
  1024. ufbx_cache_interpretation interpretation;
  1025. ufbx_string interpretation_name;
  1026. ufbx_cache_frame_list frames;
  1027. } ufbx_cache_channel;
  1028. UFBX_LIST_TYPE(ufbx_cache_channel_list, ufbx_cache_channel);
  1029. typedef struct ufbx_geometry_cache {
  1030. ufbx_string root_filename;
  1031. ufbx_cache_channel_list channels;
  1032. ufbx_cache_frame_list frames;
  1033. ufbx_string_list extra_info;
  1034. } ufbx_geometry_cache;
  1035. struct ufbx_cache_deformer {
  1036. union { ufbx_element element; struct {
  1037. ufbx_string name;
  1038. ufbx_props props;
  1039. uint32_t element_id;
  1040. uint32_t typed_id;
  1041. }; };
  1042. ufbx_string channel;
  1043. ufbx_nullable ufbx_cache_file *file;
  1044. ufbx_nullable ufbx_geometry_cache *external_cache;
  1045. ufbx_nullable ufbx_cache_channel *external_channel;
  1046. };
  1047. struct ufbx_cache_file {
  1048. union { ufbx_element element; struct {
  1049. ufbx_string name;
  1050. ufbx_props props;
  1051. uint32_t element_id;
  1052. uint32_t typed_id;
  1053. }; };
  1054. ufbx_string filename;
  1055. ufbx_string absolute_filename;
  1056. ufbx_string relative_filename;
  1057. ufbx_blob raw_filename;
  1058. ufbx_blob raw_absolute_filename;
  1059. ufbx_blob raw_relative_filename;
  1060. ufbx_cache_file_format format;
  1061. ufbx_nullable ufbx_geometry_cache *external_cache;
  1062. };
  1063. typedef struct ufbx_material_map {
  1064. union {
  1065. ufbx_real value_real;
  1066. ufbx_vec2 value_vec2;
  1067. ufbx_vec3 value_vec3;
  1068. ufbx_vec4 value_vec4;
  1069. };
  1070. int64_t value_int;
  1071. ufbx_nullable ufbx_texture *texture;
  1072. bool has_value;
  1073. bool texture_enabled;
  1074. bool texture_inverted;
  1075. bool feature_disabled;
  1076. } ufbx_material_map;
  1077. typedef struct ufbx_material_feature_info {
  1078. bool enabled;
  1079. bool is_explicit;
  1080. } ufbx_material_feature_info;
  1081. typedef struct ufbx_material_texture {
  1082. ufbx_string material_prop;
  1083. ufbx_string shader_prop;
  1084. ufbx_texture *texture;
  1085. } ufbx_material_texture;
  1086. UFBX_LIST_TYPE(ufbx_material_texture_list, ufbx_material_texture);
  1087. typedef enum ufbx_shader_type {
  1088. UFBX_SHADER_UNKNOWN,
  1089. UFBX_SHADER_FBX_LAMBERT,
  1090. UFBX_SHADER_FBX_PHONG,
  1091. UFBX_SHADER_OSL_STANDARD_SURFACE,
  1092. UFBX_SHADER_ARNOLD_STANDARD_SURFACE,
  1093. UFBX_SHADER_3DS_MAX_PHYSICAL_MATERIAL,
  1094. UFBX_SHADER_3DS_MAX_PBR_METAL_ROUGH,
  1095. UFBX_SHADER_3DS_MAX_PBR_SPEC_GLOSS,
  1096. UFBX_SHADER_GLTF_MATERIAL,
  1097. UFBX_SHADER_SHADERFX_GRAPH,
  1098. UFBX_SHADER_BLENDER_PHONG,
  1099. UFBX_SHADER_TYPE_COUNT,
  1100. UFBX_SHADER_TYPE_FORCE_32BIT = 0x7fffffff,
  1101. } ufbx_shader_type;
  1102. typedef enum ufbx_material_fbx_map {
  1103. UFBX_MATERIAL_FBX_DIFFUSE_FACTOR,
  1104. UFBX_MATERIAL_FBX_DIFFUSE_COLOR,
  1105. UFBX_MATERIAL_FBX_SPECULAR_FACTOR,
  1106. UFBX_MATERIAL_FBX_SPECULAR_COLOR,
  1107. UFBX_MATERIAL_FBX_SPECULAR_EXPONENT,
  1108. UFBX_MATERIAL_FBX_REFLECTION_FACTOR,
  1109. UFBX_MATERIAL_FBX_REFLECTION_COLOR,
  1110. UFBX_MATERIAL_FBX_TRANSPARENCY_FACTOR,
  1111. UFBX_MATERIAL_FBX_TRANSPARENCY_COLOR,
  1112. UFBX_MATERIAL_FBX_EMISSION_FACTOR,
  1113. UFBX_MATERIAL_FBX_EMISSION_COLOR,
  1114. UFBX_MATERIAL_FBX_AMBIENT_FACTOR,
  1115. UFBX_MATERIAL_FBX_AMBIENT_COLOR,
  1116. UFBX_MATERIAL_FBX_NORMAL_MAP,
  1117. UFBX_MATERIAL_FBX_BUMP,
  1118. UFBX_MATERIAL_FBX_BUMP_FACTOR,
  1119. UFBX_MATERIAL_FBX_DISPLACEMENT_FACTOR,
  1120. UFBX_MATERIAL_FBX_DISPLACEMENT,
  1121. UFBX_MATERIAL_FBX_VECTOR_DISPLACEMENT_FACTOR,
  1122. UFBX_MATERIAL_FBX_VECTOR_DISPLACEMENT,
  1123. UFBX_MATERIAL_FBX_MAP_COUNT,
  1124. UFBX_MATERIAL_FBX_MAP_FORCE_32BIT = 0x7fffffff,
  1125. } ufbx_material_fbx_map;
  1126. typedef enum ufbx_material_pbr_map {
  1127. UFBX_MATERIAL_PBR_BASE_FACTOR,
  1128. UFBX_MATERIAL_PBR_BASE_COLOR,
  1129. UFBX_MATERIAL_PBR_ROUGHNESS,
  1130. UFBX_MATERIAL_PBR_METALNESS,
  1131. UFBX_MATERIAL_PBR_DIFFUSE_ROUGHNESS,
  1132. UFBX_MATERIAL_PBR_SPECULAR_FACTOR,
  1133. UFBX_MATERIAL_PBR_SPECULAR_COLOR,
  1134. UFBX_MATERIAL_PBR_SPECULAR_IOR,
  1135. UFBX_MATERIAL_PBR_SPECULAR_ANISOTROPY,
  1136. UFBX_MATERIAL_PBR_SPECULAR_ROTATION,
  1137. UFBX_MATERIAL_PBR_TRANSMISSION_FACTOR,
  1138. UFBX_MATERIAL_PBR_TRANSMISSION_COLOR,
  1139. UFBX_MATERIAL_PBR_TRANSMISSION_DEPTH,
  1140. UFBX_MATERIAL_PBR_TRANSMISSION_SCATTER,
  1141. UFBX_MATERIAL_PBR_TRANSMISSION_SCATTER_ANISOTROPY,
  1142. UFBX_MATERIAL_PBR_TRANSMISSION_DISPERSION,
  1143. UFBX_MATERIAL_PBR_TRANSMISSION_ROUGHNESS,
  1144. UFBX_MATERIAL_PBR_TRANSMISSION_EXTRA_ROUGHNESS,
  1145. UFBX_MATERIAL_PBR_TRANSMISSION_PRIORITY,
  1146. UFBX_MATERIAL_PBR_TRANSMISSION_ENABLE_IN_AOV,
  1147. UFBX_MATERIAL_PBR_SUBSURFACE_FACTOR,
  1148. UFBX_MATERIAL_PBR_SUBSURFACE_COLOR,
  1149. UFBX_MATERIAL_PBR_SUBSURFACE_RADIUS,
  1150. UFBX_MATERIAL_PBR_SUBSURFACE_SCALE,
  1151. UFBX_MATERIAL_PBR_SUBSURFACE_ANISOTROPY,
  1152. UFBX_MATERIAL_PBR_SUBSURFACE_TINT_COLOR,
  1153. UFBX_MATERIAL_PBR_SUBSURFACE_TYPE,
  1154. UFBX_MATERIAL_PBR_SHEEN_FACTOR,
  1155. UFBX_MATERIAL_PBR_SHEEN_COLOR,
  1156. UFBX_MATERIAL_PBR_SHEEN_ROUGHNESS,
  1157. UFBX_MATERIAL_PBR_COAT_FACTOR,
  1158. UFBX_MATERIAL_PBR_COAT_COLOR,
  1159. UFBX_MATERIAL_PBR_COAT_ROUGHNESS,
  1160. UFBX_MATERIAL_PBR_COAT_IOR,
  1161. UFBX_MATERIAL_PBR_COAT_ANISOTROPY,
  1162. UFBX_MATERIAL_PBR_COAT_ROTATION,
  1163. UFBX_MATERIAL_PBR_COAT_NORMAL,
  1164. UFBX_MATERIAL_PBR_COAT_AFFECT_BASE_COLOR,
  1165. UFBX_MATERIAL_PBR_COAT_AFFECT_BASE_ROUGHNESS,
  1166. UFBX_MATERIAL_PBR_THIN_FILM_THICKNESS,
  1167. UFBX_MATERIAL_PBR_THIN_FILM_IOR,
  1168. UFBX_MATERIAL_PBR_EMISSION_FACTOR,
  1169. UFBX_MATERIAL_PBR_EMISSION_COLOR,
  1170. UFBX_MATERIAL_PBR_OPACITY,
  1171. UFBX_MATERIAL_PBR_INDIRECT_DIFFUSE,
  1172. UFBX_MATERIAL_PBR_INDIRECT_SPECULAR,
  1173. UFBX_MATERIAL_PBR_NORMAL_MAP,
  1174. UFBX_MATERIAL_PBR_TANGENT_MAP,
  1175. UFBX_MATERIAL_PBR_DISPLACEMENT_MAP,
  1176. UFBX_MATERIAL_PBR_MATTE_FACTOR,
  1177. UFBX_MATERIAL_PBR_MATTE_COLOR,
  1178. UFBX_MATERIAL_PBR_AMBIENT_OCCLUSION,
  1179. UFBX_MATERIAL_PBR_MAP_COUNT,
  1180. UFBX_MATERIAL_PBR_MAP_FORCE_32BIT = 0x7fffffff,
  1181. } ufbx_material_pbr_map;
  1182. typedef enum ufbx_material_feature {
  1183. UFBX_MATERIAL_FEATURE_METALNESS,
  1184. UFBX_MATERIAL_FEATURE_DIFFUSE,
  1185. UFBX_MATERIAL_FEATURE_SPECULAR,
  1186. UFBX_MATERIAL_FEATURE_EMISSION,
  1187. UFBX_MATERIAL_FEATURE_TRANSMISSION,
  1188. UFBX_MATERIAL_FEATURE_COAT,
  1189. UFBX_MATERIAL_FEATURE_SHEEN,
  1190. UFBX_MATERIAL_FEATURE_OPACITY,
  1191. UFBX_MATERIAL_FEATURE_AMBIENT_OCCLUSION,
  1192. UFBX_MATERIAL_FEATURE_MATTE,
  1193. UFBX_MATERIAL_FEATURE_UNLIT,
  1194. UFBX_MATERIAL_FEATURE_IOR,
  1195. UFBX_MATERIAL_FEATURE_DIFFUSE_ROUGHNESS,
  1196. UFBX_MATERIAL_FEATURE_TRANSMISSION_ROUGHNESS,
  1197. UFBX_MATERIAL_FEATURE_THIN_WALLED,
  1198. UFBX_MATERIAL_FEATURE_CAUSTICS,
  1199. UFBX_MATERIAL_FEATURE_EXIT_TO_BACKGROUND,
  1200. UFBX_MATERIAL_FEATURE_INTERNAL_REFLECTIONS,
  1201. UFBX_MATERIAL_FEATURE_DOUBLE_SIDED,
  1202. UFBX_MATERIAL_FEATURE_COUNT,
  1203. UFBX_MATERIAL_FEATURE_FORCE_32BIT = 0x7fffffff,
  1204. } ufbx_material_feature;
  1205. typedef struct ufbx_material_fbx_maps {
  1206. union {
  1207. ufbx_material_map maps[UFBX_MATERIAL_FBX_MAP_COUNT];
  1208. struct {
  1209. ufbx_material_map diffuse_factor;
  1210. ufbx_material_map diffuse_color;
  1211. ufbx_material_map specular_factor;
  1212. ufbx_material_map specular_color;
  1213. ufbx_material_map specular_exponent;
  1214. ufbx_material_map reflection_factor;
  1215. ufbx_material_map reflection_color;
  1216. ufbx_material_map transparency_factor;
  1217. ufbx_material_map transparency_color;
  1218. ufbx_material_map emission_factor;
  1219. ufbx_material_map emission_color;
  1220. ufbx_material_map ambient_factor;
  1221. ufbx_material_map ambient_color;
  1222. ufbx_material_map normal_map;
  1223. ufbx_material_map bump;
  1224. ufbx_material_map bump_factor;
  1225. ufbx_material_map displacement_factor;
  1226. ufbx_material_map displacement;
  1227. ufbx_material_map vector_displacement_factor;
  1228. ufbx_material_map vector_displacement;
  1229. };
  1230. };
  1231. } ufbx_material_fbx_maps;
  1232. typedef struct ufbx_material_pbr_maps {
  1233. union {
  1234. ufbx_material_map maps[UFBX_MATERIAL_PBR_MAP_COUNT];
  1235. struct {
  1236. ufbx_material_map base_factor;
  1237. ufbx_material_map base_color;
  1238. ufbx_material_map roughness;
  1239. ufbx_material_map metalness;
  1240. ufbx_material_map diffuse_roughness;
  1241. ufbx_material_map specular_factor;
  1242. ufbx_material_map specular_color;
  1243. ufbx_material_map specular_ior;
  1244. ufbx_material_map specular_anisotropy;
  1245. ufbx_material_map specular_rotation;
  1246. ufbx_material_map transmission_factor;
  1247. ufbx_material_map transmission_color;
  1248. ufbx_material_map transmission_depth;
  1249. ufbx_material_map transmission_scatter;
  1250. ufbx_material_map transmission_scatter_anisotropy;
  1251. ufbx_material_map transmission_dispersion;
  1252. ufbx_material_map transmission_roughness;
  1253. ufbx_material_map transmission_extra_roughness;
  1254. ufbx_material_map transmission_priority;
  1255. ufbx_material_map transmission_enable_in_aov;
  1256. ufbx_material_map subsurface_factor;
  1257. ufbx_material_map subsurface_color;
  1258. ufbx_material_map subsurface_radius;
  1259. ufbx_material_map subsurface_scale;
  1260. ufbx_material_map subsurface_anisotropy;
  1261. ufbx_material_map subsurface_tint_color;
  1262. ufbx_material_map subsurface_type;
  1263. ufbx_material_map sheen_factor;
  1264. ufbx_material_map sheen_color;
  1265. ufbx_material_map sheen_roughness;
  1266. ufbx_material_map coat_factor;
  1267. ufbx_material_map coat_color;
  1268. ufbx_material_map coat_roughness;
  1269. ufbx_material_map coat_ior;
  1270. ufbx_material_map coat_anisotropy;
  1271. ufbx_material_map coat_rotation;
  1272. ufbx_material_map coat_normal;
  1273. ufbx_material_map coat_affect_base_color;
  1274. ufbx_material_map coat_affect_base_roughness;
  1275. ufbx_material_map thin_film_thickness;
  1276. ufbx_material_map thin_film_ior;
  1277. ufbx_material_map emission_factor;
  1278. ufbx_material_map emission_color;
  1279. ufbx_material_map opacity;
  1280. ufbx_material_map indirect_diffuse;
  1281. ufbx_material_map indirect_specular;
  1282. ufbx_material_map normal_map;
  1283. ufbx_material_map tangent_map;
  1284. ufbx_material_map displacement_map;
  1285. ufbx_material_map matte_factor;
  1286. ufbx_material_map matte_color;
  1287. ufbx_material_map ambient_occlusion;
  1288. };
  1289. };
  1290. } ufbx_material_pbr_maps;
  1291. typedef struct ufbx_material_features {
  1292. union {
  1293. ufbx_material_feature_info features[UFBX_MATERIAL_FEATURE_COUNT];
  1294. struct {
  1295. ufbx_material_feature_info metalness;
  1296. ufbx_material_feature_info diffuse;
  1297. ufbx_material_feature_info specular;
  1298. ufbx_material_feature_info emission;
  1299. ufbx_material_feature_info transmission;
  1300. ufbx_material_feature_info coat;
  1301. ufbx_material_feature_info sheen;
  1302. ufbx_material_feature_info opacity;
  1303. ufbx_material_feature_info ambient_occlusion;
  1304. ufbx_material_feature_info matte;
  1305. ufbx_material_feature_info unlit;
  1306. ufbx_material_feature_info ior;
  1307. ufbx_material_feature_info diffuse_roughness;
  1308. ufbx_material_feature_info transmission_roughness;
  1309. ufbx_material_feature_info thin_walled;
  1310. ufbx_material_feature_info caustics;
  1311. ufbx_material_feature_info exit_to_background;
  1312. ufbx_material_feature_info internal_reflections;
  1313. ufbx_material_feature_info double_sided;
  1314. };
  1315. };
  1316. } ufbx_material_features;
  1317. struct ufbx_material {
  1318. union { ufbx_element element; struct {
  1319. ufbx_string name;
  1320. ufbx_props props;
  1321. uint32_t element_id;
  1322. uint32_t typed_id;
  1323. }; };
  1324. ufbx_material_fbx_maps fbx;
  1325. ufbx_material_pbr_maps pbr;
  1326. ufbx_material_features features;
  1327. ufbx_shader_type shader_type;
  1328. ufbx_nullable ufbx_shader *shader;
  1329. ufbx_string shading_model_name;
  1330. ufbx_string shader_prop_prefix;
  1331. ufbx_material_texture_list textures;
  1332. };
  1333. typedef enum ufbx_texture_type {
  1334. UFBX_TEXTURE_FILE,
  1335. UFBX_TEXTURE_LAYERED,
  1336. UFBX_TEXTURE_PROCEDURAL,
  1337. UFBX_TEXTURE_SHADER,
  1338. UFBX_TEXTURE_TYPE_COUNT,
  1339. UFBX_TEXTURE_TYPE_FORCE_32BIT = 0x7fffffff,
  1340. } ufbx_texture_type;
  1341. typedef enum ufbx_blend_mode {
  1342. UFBX_BLEND_TRANSLUCENT,
  1343. UFBX_BLEND_ADDITIVE,
  1344. UFBX_BLEND_MULTIPLY,
  1345. UFBX_BLEND_MULTIPLY_2X,
  1346. UFBX_BLEND_OVER,
  1347. UFBX_BLEND_REPLACE,
  1348. UFBX_BLEND_DISSOLVE,
  1349. UFBX_BLEND_DARKEN,
  1350. UFBX_BLEND_COLOR_BURN,
  1351. UFBX_BLEND_LINEAR_BURN,
  1352. UFBX_BLEND_DARKER_COLOR,
  1353. UFBX_BLEND_LIGHTEN,
  1354. UFBX_BLEND_SCREEN,
  1355. UFBX_BLEND_COLOR_DODGE,
  1356. UFBX_BLEND_LINEAR_DODGE,
  1357. UFBX_BLEND_LIGHTER_COLOR,
  1358. UFBX_BLEND_SOFT_LIGHT,
  1359. UFBX_BLEND_HARD_LIGHT,
  1360. UFBX_BLEND_VIVID_LIGHT,
  1361. UFBX_BLEND_LINEAR_LIGHT,
  1362. UFBX_BLEND_PIN_LIGHT,
  1363. UFBX_BLEND_HARD_MIX,
  1364. UFBX_BLEND_DIFFERENCE,
  1365. UFBX_BLEND_EXCLUSION,
  1366. UFBX_BLEND_SUBTRACT,
  1367. UFBX_BLEND_DIVIDE,
  1368. UFBX_BLEND_HUE,
  1369. UFBX_BLEND_SATURATION,
  1370. UFBX_BLEND_COLOR,
  1371. UFBX_BLEND_LUMINOSITY,
  1372. UFBX_BLEND_OVERLAY,
  1373. UFBX_BLEND_MODE_COUNT,
  1374. UFBX_BLEND_MODE_FORCE_32BIT = 0x7fffffff,
  1375. } ufbx_blend_mode;
  1376. typedef enum ufbx_wrap_mode {
  1377. UFBX_WRAP_REPEAT,
  1378. UFBX_WRAP_CLAMP,
  1379. UFBX_WRAP_MODE_COUNT,
  1380. UFBX_WRAP_MODE_FORCE_32BIT = 0x7fffffff,
  1381. } ufbx_wrap_mode;
  1382. typedef struct ufbx_texture_layer {
  1383. ufbx_texture *texture;
  1384. ufbx_blend_mode blend_mode;
  1385. ufbx_real alpha;
  1386. } ufbx_texture_layer;
  1387. UFBX_LIST_TYPE(ufbx_texture_layer_list, ufbx_texture_layer);
  1388. typedef enum ufbx_shader_texture_type {
  1389. UFBX_SHADER_TEXTURE_UNKNOWN,
  1390. UFBX_SHADER_TEXTURE_SELECT_OUTPUT,
  1391. UFBX_SHADER_TEXTURE_OSL,
  1392. UFBX_SHADER_TEXTURE_TYPE_COUNT,
  1393. UFBX_SHADER_TEXTURE_TYPE_FORCE_32BIT = 0x7fffffff,
  1394. } ufbx_shader_texture_type;
  1395. typedef struct ufbx_shader_texture_input {
  1396. ufbx_string name;
  1397. union {
  1398. ufbx_real value_real;
  1399. ufbx_vec2 value_vec2;
  1400. ufbx_vec3 value_vec3;
  1401. ufbx_vec4 value_vec4;
  1402. };
  1403. int64_t value_int;
  1404. ufbx_string value_str;
  1405. ufbx_blob value_blob;
  1406. ufbx_nullable ufbx_texture *texture;
  1407. int64_t texture_output_index;
  1408. bool texture_enabled;
  1409. ufbx_prop *prop;
  1410. ufbx_nullable ufbx_prop *texture_prop;
  1411. ufbx_nullable ufbx_prop *texture_enabled_prop;
  1412. } ufbx_shader_texture_input;
  1413. UFBX_LIST_TYPE(ufbx_shader_texture_input_list, ufbx_shader_texture_input);
  1414. typedef struct ufbx_shader_texture {
  1415. ufbx_shader_texture_type type;
  1416. ufbx_string shader_name;
  1417. uint64_t shader_type_id;
  1418. ufbx_shader_texture_input_list inputs;
  1419. ufbx_string shader_source;
  1420. ufbx_blob raw_shader_source;
  1421. ufbx_texture *main_texture;
  1422. int64_t main_texture_output_index;
  1423. ufbx_string prop_prefix;
  1424. } ufbx_shader_texture;
  1425. struct ufbx_texture {
  1426. union { ufbx_element element; struct {
  1427. ufbx_string name;
  1428. ufbx_props props;
  1429. uint32_t element_id;
  1430. uint32_t typed_id;
  1431. }; };
  1432. ufbx_texture_type type;
  1433. ufbx_string filename;
  1434. ufbx_string absolute_filename;
  1435. ufbx_string relative_filename;
  1436. ufbx_blob raw_filename;
  1437. ufbx_blob raw_absolute_filename;
  1438. ufbx_blob raw_relative_filename;
  1439. ufbx_blob content;
  1440. ufbx_nullable ufbx_video *video;
  1441. ufbx_texture_layer_list layers;
  1442. ufbx_nullable ufbx_shader_texture *shader;
  1443. ufbx_texture_list file_textures;
  1444. ufbx_string uv_set;
  1445. ufbx_wrap_mode wrap_u;
  1446. ufbx_wrap_mode wrap_v;
  1447. ufbx_transform transform;
  1448. ufbx_matrix texture_to_uv;
  1449. ufbx_matrix uv_to_texture;
  1450. };
  1451. struct ufbx_video {
  1452. union { ufbx_element element; struct {
  1453. ufbx_string name;
  1454. ufbx_props props;
  1455. uint32_t element_id;
  1456. uint32_t typed_id;
  1457. }; };
  1458. ufbx_string filename;
  1459. ufbx_string absolute_filename;
  1460. ufbx_string relative_filename;
  1461. ufbx_blob raw_filename;
  1462. ufbx_blob raw_absolute_filename;
  1463. ufbx_blob raw_relative_filename;
  1464. ufbx_blob content;
  1465. };
  1466. struct ufbx_shader {
  1467. union { ufbx_element element; struct {
  1468. ufbx_string name;
  1469. ufbx_props props;
  1470. uint32_t element_id;
  1471. uint32_t typed_id;
  1472. }; };
  1473. ufbx_shader_type type;
  1474. ufbx_shader_binding_list bindings;
  1475. };
  1476. typedef struct ufbx_shader_prop_binding {
  1477. ufbx_string shader_prop;
  1478. ufbx_string material_prop;
  1479. } ufbx_shader_prop_binding;
  1480. UFBX_LIST_TYPE(ufbx_shader_prop_binding_list, ufbx_shader_prop_binding);
  1481. struct ufbx_shader_binding {
  1482. union { ufbx_element element; struct {
  1483. ufbx_string name;
  1484. ufbx_props props;
  1485. uint32_t element_id;
  1486. uint32_t typed_id;
  1487. }; };
  1488. ufbx_shader_prop_binding_list prop_bindings;
  1489. };
  1490. typedef struct ufbx_anim_layer_desc {
  1491. ufbx_anim_layer *layer;
  1492. ufbx_real weight;
  1493. } ufbx_anim_layer_desc;
  1494. UFBX_LIST_TYPE(ufbx_const_anim_layer_desc_list, const ufbx_anim_layer_desc);
  1495. typedef struct ufbx_prop_override {
  1496. uint32_t element_id;
  1497. const char *prop_name;
  1498. ufbx_vec3 value;
  1499. const char *value_str;
  1500. int64_t value_int;
  1501. uint32_t _internal_key;
  1502. } ufbx_prop_override;
  1503. UFBX_LIST_TYPE(ufbx_const_prop_override_list, const ufbx_prop_override);
  1504. typedef struct ufbx_anim {
  1505. ufbx_const_anim_layer_desc_list layers;
  1506. ufbx_const_prop_override_list prop_overrides;
  1507. bool ignore_connections;
  1508. double time_begin;
  1509. double time_end;
  1510. } ufbx_anim;
  1511. struct ufbx_anim_stack {
  1512. union { ufbx_element element; struct {
  1513. ufbx_string name;
  1514. ufbx_props props;
  1515. uint32_t element_id;
  1516. uint32_t typed_id;
  1517. }; };
  1518. double time_begin;
  1519. double time_end;
  1520. ufbx_anim_layer_list layers;
  1521. ufbx_anim anim;
  1522. };
  1523. typedef struct ufbx_anim_prop {
  1524. ufbx_element *element;
  1525. uint32_t _internal_key;
  1526. ufbx_string prop_name;
  1527. ufbx_anim_value *anim_value;
  1528. } ufbx_anim_prop;
  1529. UFBX_LIST_TYPE(ufbx_anim_prop_list, ufbx_anim_prop);
  1530. struct ufbx_anim_layer {
  1531. union { ufbx_element element; struct {
  1532. ufbx_string name;
  1533. ufbx_props props;
  1534. uint32_t element_id;
  1535. uint32_t typed_id;
  1536. }; };
  1537. ufbx_real weight;
  1538. bool weight_is_animated;
  1539. bool blended;
  1540. bool additive;
  1541. bool compose_rotation;
  1542. bool compose_scale;
  1543. ufbx_anim_value_list anim_values;
  1544. ufbx_anim_prop_list anim_props;
  1545. ufbx_anim anim;
  1546. uint32_t _min_element_id;
  1547. uint32_t _max_element_id;
  1548. uint32_t _element_id_bitmask[4];
  1549. };
  1550. struct ufbx_anim_value {
  1551. union { ufbx_element element; struct { ufbx_string name; ufbx_props props; }; };
  1552. ufbx_vec3 default_value;
  1553. ufbx_nullable ufbx_anim_curve *curves[3];
  1554. };
  1555. typedef enum ufbx_interpolation {
  1556. UFBX_INTERPOLATION_CONSTANT_PREV,
  1557. UFBX_INTERPOLATION_CONSTANT_NEXT,
  1558. UFBX_INTERPOLATION_LINEAR,
  1559. UFBX_INTERPOLATION_CUBIC,
  1560. UFBX_INTERPOLATION_COUNT,
  1561. UFBX_INTERPOLATION_FORCE_32BIT = 0x7fffffff,
  1562. } ufbx_interpolation;
  1563. typedef struct ufbx_tangent {
  1564. float dx;
  1565. float dy;
  1566. } ufbx_tangent;
  1567. typedef struct ufbx_keyframe {
  1568. double time;
  1569. ufbx_real value;
  1570. ufbx_interpolation interpolation;
  1571. ufbx_tangent left;
  1572. ufbx_tangent right;
  1573. } ufbx_keyframe;
  1574. UFBX_LIST_TYPE(ufbx_keyframe_list, ufbx_keyframe);
  1575. struct ufbx_anim_curve {
  1576. union { ufbx_element element; struct {
  1577. ufbx_string name;
  1578. ufbx_props props;
  1579. uint32_t element_id;
  1580. uint32_t typed_id;
  1581. }; };
  1582. ufbx_keyframe_list keyframes;
  1583. };
  1584. struct ufbx_display_layer {
  1585. union { ufbx_element element; struct {
  1586. ufbx_string name;
  1587. ufbx_props props;
  1588. uint32_t element_id;
  1589. uint32_t typed_id;
  1590. }; };
  1591. ufbx_node_list nodes;
  1592. bool visible;
  1593. bool frozen;
  1594. ufbx_vec3 ui_color;
  1595. };
  1596. struct ufbx_selection_set {
  1597. union { ufbx_element element; struct {
  1598. ufbx_string name;
  1599. ufbx_props props;
  1600. uint32_t element_id;
  1601. uint32_t typed_id;
  1602. }; };
  1603. ufbx_selection_node_list nodes;
  1604. };
  1605. struct ufbx_selection_node {
  1606. union { ufbx_element element; struct {
  1607. ufbx_string name;
  1608. ufbx_props props;
  1609. uint32_t element_id;
  1610. uint32_t typed_id;
  1611. }; };
  1612. ufbx_nullable ufbx_node *target_node;
  1613. ufbx_nullable ufbx_mesh *target_mesh;
  1614. bool include_node;
  1615. ufbx_uint32_list vertices;
  1616. ufbx_uint32_list edges;
  1617. ufbx_uint32_list faces;
  1618. };
  1619. struct ufbx_character {
  1620. union { ufbx_element element; struct {
  1621. ufbx_string name;
  1622. ufbx_props props;
  1623. uint32_t element_id;
  1624. uint32_t typed_id;
  1625. }; };
  1626. };
  1627. typedef enum ufbx_constraint_type {
  1628. UFBX_CONSTRAINT_UNKNOWN,
  1629. UFBX_CONSTRAINT_AIM,
  1630. UFBX_CONSTRAINT_PARENT,
  1631. UFBX_CONSTRAINT_POSITION,
  1632. UFBX_CONSTRAINT_ROTATION,
  1633. UFBX_CONSTRAINT_SCALE,
  1634. UFBX_CONSTRAINT_SINGLE_CHAIN_IK,
  1635. UFBX_CONSTRAINT_TYPE_COUNT,
  1636. UFBX_CONSTRAINT_TYPE_FORCE_32BIT = 0x7fffffff,
  1637. } ufbx_constraint_type;
  1638. typedef struct ufbx_constraint_target {
  1639. ufbx_node *node;
  1640. ufbx_real weight;
  1641. ufbx_transform transform;
  1642. } ufbx_constraint_target;
  1643. UFBX_LIST_TYPE(ufbx_constraint_target_list, ufbx_constraint_target);
  1644. typedef enum ufbx_constraint_aim_up_type {
  1645. UFBX_CONSTRAINT_AIM_UP_SCENE,
  1646. UFBX_CONSTRAINT_AIM_UP_TO_NODE,
  1647. UFBX_CONSTRAINT_AIM_UP_ALIGN_NODE,
  1648. UFBX_CONSTRAINT_AIM_UP_VECTOR,
  1649. UFBX_CONSTRAINT_AIM_UP_NONE,
  1650. UFBX_CONSTRAINT_AIM_UP_TYPE_COUNT,
  1651. UFBX_CONSTRAINT_AIM_UP_TYPE_FORCE_32BIT = 0x7fffffff,
  1652. } ufbx_constraint_aim_up_type;
  1653. typedef enum ufbx_constraint_ik_pole_type {
  1654. UFBX_CONSTRAINT_IK_POLE_VECTOR,
  1655. UFBX_CONSTRAINT_IK_POLE_NODE,
  1656. UFBX_CONSTRAINT_IK_POLE_TYPE_COUNT,
  1657. UFBX_CONSTRAINT_IK_POLE_TYPE_FORCE_32BIT = 0x7fffffff,
  1658. } ufbx_constraint_ik_pole_type;
  1659. struct ufbx_constraint {
  1660. union { ufbx_element element; struct {
  1661. ufbx_string name;
  1662. ufbx_props props;
  1663. uint32_t element_id;
  1664. uint32_t typed_id;
  1665. }; };
  1666. ufbx_constraint_type type;
  1667. ufbx_string type_name;
  1668. ufbx_nullable ufbx_node *node;
  1669. ufbx_constraint_target_list targets;
  1670. ufbx_real weight;
  1671. bool active;
  1672. bool constrain_translation[3];
  1673. bool constrain_rotation[3];
  1674. bool constrain_scale[3];
  1675. ufbx_transform transform_offset;
  1676. ufbx_vec3 aim_vector;
  1677. ufbx_constraint_aim_up_type aim_up_type;
  1678. ufbx_nullable ufbx_node *aim_up_node;
  1679. ufbx_vec3 aim_up_vector;
  1680. ufbx_nullable ufbx_node *ik_effector;
  1681. ufbx_nullable ufbx_node *ik_end_node;
  1682. ufbx_vec3 ik_pole_vector;
  1683. };
  1684. typedef struct ufbx_bone_pose {
  1685. ufbx_node *bone_node;
  1686. ufbx_matrix bone_to_world;
  1687. } ufbx_bone_pose;
  1688. UFBX_LIST_TYPE(ufbx_bone_pose_list, ufbx_bone_pose);
  1689. struct ufbx_pose {
  1690. union { ufbx_element element; struct {
  1691. ufbx_string name;
  1692. ufbx_props props;
  1693. uint32_t element_id;
  1694. uint32_t typed_id;
  1695. }; };
  1696. bool bind_pose;
  1697. ufbx_bone_pose_list bone_poses;
  1698. };
  1699. struct ufbx_metadata_object {
  1700. union { ufbx_element element; struct {
  1701. ufbx_string name;
  1702. ufbx_props props;
  1703. uint32_t element_id;
  1704. uint32_t typed_id;
  1705. }; };
  1706. };
  1707. typedef struct ufbx_name_element {
  1708. ufbx_string name;
  1709. ufbx_element_type type;
  1710. uint32_t _internal_key;
  1711. ufbx_element *element;
  1712. } ufbx_name_element;
  1713. UFBX_LIST_TYPE(ufbx_name_element_list, ufbx_name_element);
  1714. typedef enum ufbx_exporter {
  1715. UFBX_EXPORTER_UNKNOWN,
  1716. UFBX_EXPORTER_FBX_SDK,
  1717. UFBX_EXPORTER_BLENDER_BINARY,
  1718. UFBX_EXPORTER_BLENDER_ASCII,
  1719. UFBX_EXPORTER_MOTION_BUILDER,
  1720. UFBX_EXPORTER_BC_UNITY_EXPORTER,
  1721. UFBX_EXPORTER_COUNT,
  1722. UFBX_EXPORTER_FORCE_32BIT = 0x7fffffff,
  1723. } ufbx_exporter;
  1724. typedef struct ufbx_application {
  1725. ufbx_string vendor;
  1726. ufbx_string name;
  1727. ufbx_string version;
  1728. } ufbx_application;
  1729. typedef struct ufbx_metadata {
  1730. bool ascii;
  1731. uint32_t version;
  1732. bool may_contain_no_index;
  1733. bool unsafe;
  1734. ufbx_string creator;
  1735. bool big_endian;
  1736. ufbx_string filename;
  1737. ufbx_string relative_root;
  1738. ufbx_blob raw_filename;
  1739. ufbx_blob raw_relative_root;
  1740. ufbx_exporter exporter;
  1741. uint32_t exporter_version;
  1742. ufbx_props scene_props;
  1743. ufbx_application original_application;
  1744. ufbx_application latest_application;
  1745. bool geometry_ignored;
  1746. bool animation_ignored;
  1747. bool embedded_ignored;
  1748. size_t max_face_triangles;
  1749. size_t result_memory_used;
  1750. size_t temp_memory_used;
  1751. size_t result_allocs;
  1752. size_t temp_allocs;
  1753. size_t element_buffer_size;
  1754. size_t num_shader_textures;
  1755. ufbx_real bone_prop_size_unit;
  1756. bool bone_prop_limb_length_relative;
  1757. double ktime_to_sec;
  1758. ufbx_string original_file_path;
  1759. ufbx_blob raw_original_file_path;
  1760. } ufbx_metadata;
  1761. typedef enum ufbx_coordinate_axis {
  1762. UFBX_COORDINATE_AXIS_POSITIVE_X,
  1763. UFBX_COORDINATE_AXIS_NEGATIVE_X,
  1764. UFBX_COORDINATE_AXIS_POSITIVE_Y,
  1765. UFBX_COORDINATE_AXIS_NEGATIVE_Y,
  1766. UFBX_COORDINATE_AXIS_POSITIVE_Z,
  1767. UFBX_COORDINATE_AXIS_NEGATIVE_Z,
  1768. UFBX_COORDINATE_AXIS_UNKNOWN,
  1769. UFBX_COORDINATE_AXIS_COUNT,
  1770. UFBX_COORDINATE_AXIS_FORCE_32BIT = 0x7fffffff,
  1771. } ufbx_coordinate_axis;
  1772. typedef struct ufbx_coordinate_axes {
  1773. ufbx_coordinate_axis right;
  1774. ufbx_coordinate_axis up;
  1775. ufbx_coordinate_axis front;
  1776. } ufbx_coordinate_axes;
  1777. typedef enum ufbx_time_mode {
  1778. UFBX_TIME_MODE_DEFAULT,
  1779. UFBX_TIME_MODE_120_FPS,
  1780. UFBX_TIME_MODE_100_FPS,
  1781. UFBX_TIME_MODE_60_FPS,
  1782. UFBX_TIME_MODE_50_FPS,
  1783. UFBX_TIME_MODE_48_FPS,
  1784. UFBX_TIME_MODE_30_FPS,
  1785. UFBX_TIME_MODE_30_FPS_DROP,
  1786. UFBX_TIME_MODE_NTSC_DROP_FRAME,
  1787. UFBX_TIME_MODE_NTSC_FULL_FRAME,
  1788. UFBX_TIME_MODE_PAL,
  1789. UFBX_TIME_MODE_24_FPS,
  1790. UFBX_TIME_MODE_1000_FPS,
  1791. UFBX_TIME_MODE_FILM_FULL_FRAME,
  1792. UFBX_TIME_MODE_CUSTOM,
  1793. UFBX_TIME_MODE_96_FPS,
  1794. UFBX_TIME_MODE_72_FPS,
  1795. UFBX_TIME_MODE_59_94_FPS,
  1796. UFBX_TIME_MODE_COUNT,
  1797. UFBX_TIME_MODE_FORCE_32BIT = 0x7fffffff,
  1798. } ufbx_time_mode;
  1799. typedef enum ufbx_time_protocol {
  1800. UFBX_TIME_PROTOCOL_SMPTE,
  1801. UFBX_TIME_PROTOCOL_FRAME_COUNT,
  1802. UFBX_TIME_PROTOCOL_DEFAULT,
  1803. UFBX_TIME_PROTOCOL_COUNT,
  1804. UFBX_TIME_PROTOCOL_FORCE_32BIT = 0x7fffffff,
  1805. } ufbx_time_protocol;
  1806. typedef enum ufbx_snap_mode {
  1807. UFBX_SNAP_MODE_NONE,
  1808. UFBX_SNAP_MODE_SNAP,
  1809. UFBX_SNAP_MODE_PLAY,
  1810. UFBX_SNAP_MODE_SNAP_AND_PLAY,
  1811. UFBX_SNAP_MODE_COUNT,
  1812. UFBX_SNAP_MODE_FORCE_32BIT = 0x7fffffff,
  1813. } ufbx_snap_mode;
  1814. typedef struct ufbx_scene_settings {
  1815. ufbx_props props;
  1816. ufbx_coordinate_axes axes;
  1817. ufbx_real unit_meters;
  1818. double frames_per_second;
  1819. ufbx_vec3 ambient_color;
  1820. ufbx_string default_camera;
  1821. ufbx_time_mode time_mode;
  1822. ufbx_time_protocol time_protocol;
  1823. ufbx_snap_mode snap_mode;
  1824. ufbx_coordinate_axis original_axis_up;
  1825. ufbx_real original_unit_meters;
  1826. } ufbx_scene_settings;
  1827. struct ufbx_scene {
  1828. ufbx_metadata metadata;
  1829. ufbx_scene_settings settings;
  1830. ufbx_node *root_node;
  1831. ufbx_anim anim;
  1832. ufbx_anim combined_anim;
  1833. union {
  1834. struct {
  1835. ufbx_unknown_list unknowns;
  1836. ufbx_node_list nodes;
  1837. ufbx_mesh_list meshes;
  1838. ufbx_light_list lights;
  1839. ufbx_camera_list cameras;
  1840. ufbx_bone_list bones;
  1841. ufbx_empty_list empties;
  1842. ufbx_line_curve_list line_curves;
  1843. ufbx_nurbs_curve_list nurbs_curves;
  1844. ufbx_nurbs_surface_list nurbs_surfaces;
  1845. ufbx_nurbs_trim_surface_list nurbs_trim_surfaces;
  1846. ufbx_nurbs_trim_boundary_list nurbs_trim_boundaries;
  1847. ufbx_procedural_geometry_list procedural_geometries;
  1848. ufbx_stereo_camera_list stereo_cameras;
  1849. ufbx_camera_switcher_list camera_switchers;
  1850. ufbx_marker_list markers;
  1851. ufbx_lod_group_list lod_groups;
  1852. ufbx_skin_deformer_list skin_deformers;
  1853. ufbx_skin_cluster_list skin_clusters;
  1854. ufbx_blend_deformer_list blend_deformers;
  1855. ufbx_blend_channel_list blend_channels;
  1856. ufbx_blend_shape_list blend_shapes;
  1857. ufbx_cache_deformer_list cache_deformers;
  1858. ufbx_cache_file_list cache_files;
  1859. ufbx_material_list materials;
  1860. ufbx_texture_list textures;
  1861. ufbx_video_list videos;
  1862. ufbx_shader_list shaders;
  1863. ufbx_shader_binding_list shader_bindings;
  1864. ufbx_anim_stack_list anim_stacks;
  1865. ufbx_anim_layer_list anim_layers;
  1866. ufbx_anim_value_list anim_values;
  1867. ufbx_anim_curve_list anim_curves;
  1868. ufbx_display_layer_list display_layers;
  1869. ufbx_selection_set_list selection_sets;
  1870. ufbx_selection_node_list selection_nodes;
  1871. ufbx_character_list characters;
  1872. ufbx_constraint_list constraints;
  1873. ufbx_pose_list poses;
  1874. ufbx_metadata_object_list metadata_objects;
  1875. };
  1876. ufbx_element_list elements_by_type[UFBX_ELEMENT_TYPE_COUNT];
  1877. };
  1878. ufbx_element_list elements;
  1879. ufbx_connection_list connections_src;
  1880. ufbx_connection_list connections_dst;
  1881. ufbx_name_element_list elements_by_name;
  1882. ufbx_nullable ufbx_dom_node *dom_root;
  1883. };
  1884. typedef struct ufbx_curve_point {
  1885. bool valid;
  1886. ufbx_vec3 position;
  1887. ufbx_vec3 derivative;
  1888. } ufbx_curve_point;
  1889. typedef struct ufbx_surface_point {
  1890. bool valid;
  1891. ufbx_vec3 position;
  1892. ufbx_vec3 derivative_u;
  1893. ufbx_vec3 derivative_v;
  1894. } ufbx_surface_point;
  1895. typedef enum ufbx_topo_flags {
  1896. UFBX_TOPO_NON_MANIFOLD = 0x1,
  1897. UFBX_TOPO_FLAGS_FORCE_32BIT = 0x7fffffff,
  1898. } ufbx_topo_flags;
  1899. typedef struct ufbx_topo_edge {
  1900. uint32_t index;
  1901. uint32_t next;
  1902. uint32_t prev;
  1903. uint32_t twin;
  1904. uint32_t face;
  1905. uint32_t edge;
  1906. ufbx_topo_flags flags;
  1907. } ufbx_topo_edge;
  1908. typedef struct ufbx_vertex_stream {
  1909. const void *data;
  1910. size_t vertex_size;
  1911. } ufbx_vertex_stream;
  1912. typedef void *ufbx_alloc_fn(void *user, size_t size);
  1913. typedef void *ufbx_realloc_fn(void *user, void *old_ptr, size_t old_size, size_t new_size);
  1914. typedef void ufbx_free_fn(void *user, void *ptr, size_t size);
  1915. typedef void ufbx_free_allocator_fn(void *user);
  1916. typedef struct ufbx_allocator {
  1917. ufbx_alloc_fn *alloc_fn;
  1918. ufbx_realloc_fn *realloc_fn;
  1919. ufbx_free_fn *free_fn;
  1920. ufbx_free_allocator_fn *free_allocator_fn;
  1921. void *user;
  1922. } ufbx_allocator;
  1923. typedef struct ufbx_allocator_opts {
  1924. ufbx_allocator allocator;
  1925. size_t memory_limit;
  1926. size_t allocation_limit;
  1927. size_t huge_threshold;
  1928. size_t max_chunk_size;
  1929. } ufbx_allocator_opts;
  1930. typedef size_t ufbx_read_fn(void *user, void *data, size_t size);
  1931. typedef bool ufbx_skip_fn(void *user, size_t size);
  1932. typedef void ufbx_close_fn(void *user);
  1933. typedef struct ufbx_stream {
  1934. ufbx_read_fn *read_fn;
  1935. ufbx_skip_fn *skip_fn;
  1936. ufbx_close_fn *close_fn;
  1937. void *user;
  1938. } ufbx_stream;
  1939. typedef bool ufbx_open_file_fn(void *user, ufbx_stream *stream, const char *path, size_t path_len);
  1940. typedef struct ufbx_open_file_cb {
  1941. ufbx_open_file_fn *fn;
  1942. void *user;
  1943. UFBX_CALLBACK_IMPL(ufbx_open_file_cb, ufbx_open_file_fn,
  1944. (void *user, ufbx_stream *stream, const char *path, size_t path_len),
  1945. (stream, path, path_len))
  1946. } ufbx_open_file_cb;
  1947. typedef struct ufbx_error_frame {
  1948. uint32_t source_line;
  1949. ufbx_string function;
  1950. ufbx_string description;
  1951. } ufbx_error_frame;
  1952. typedef enum ufbx_error_type {
  1953. UFBX_ERROR_NONE,
  1954. UFBX_ERROR_UNKNOWN,
  1955. UFBX_ERROR_FILE_NOT_FOUND,
  1956. UFBX_ERROR_OUT_OF_MEMORY,
  1957. UFBX_ERROR_MEMORY_LIMIT,
  1958. UFBX_ERROR_ALLOCATION_LIMIT,
  1959. UFBX_ERROR_TRUNCATED_FILE,
  1960. UFBX_ERROR_IO,
  1961. UFBX_ERROR_CANCELLED,
  1962. UFBX_ERROR_NOT_FBX,
  1963. UFBX_ERROR_UNINITIALIZED_OPTIONS,
  1964. UFBX_ERROR_ZERO_VERTEX_SIZE,
  1965. UFBX_ERROR_INVALID_UTF8,
  1966. UFBX_ERROR_FEATURE_DISABLED,
  1967. UFBX_ERROR_BAD_NURBS,
  1968. UFBX_ERROR_BAD_INDEX,
  1969. UFBX_ERROR_UNSAFE_OPTIONS,
  1970. UFBX_ERROR_TYPE_COUNT,
  1971. UFBX_ERROR_TYPE_FORCE_32BIT = 0x7fffffff,
  1972. } ufbx_error_type;
  1973. typedef struct ufbx_error {
  1974. ufbx_error_type type;
  1975. ufbx_string description;
  1976. uint32_t stack_size;
  1977. ufbx_error_frame stack[UFBX_ERROR_STACK_MAX_DEPTH];
  1978. } ufbx_error;
  1979. typedef struct ufbx_progress {
  1980. uint64_t bytes_read;
  1981. uint64_t bytes_total;
  1982. } ufbx_progress;
  1983. typedef enum ufbx_progress_result {
  1984. UFBX_PROGRESS_CONTINUE = 0x100,
  1985. UFBX_PROGRESS_CANCEL = 0x200,
  1986. UFBX_PROGRESS_FORCE_32BIT = 0x7fffffff,
  1987. } ufbx_progress_result;
  1988. typedef ufbx_progress_result ufbx_progress_fn(void *user, const ufbx_progress *progress);
  1989. typedef struct ufbx_progress_cb {
  1990. ufbx_progress_fn *fn;
  1991. void *user;
  1992. UFBX_CALLBACK_IMPL(ufbx_progress_cb, ufbx_progress_fn,
  1993. (void *user, const ufbx_progress *progress),
  1994. (progress))
  1995. } ufbx_progress_cb;
  1996. typedef struct ufbx_inflate_input ufbx_inflate_input;
  1997. typedef struct ufbx_inflate_retain ufbx_inflate_retain;
  1998. struct ufbx_inflate_input {
  1999. size_t total_size;
  2000. const void *data;
  2001. size_t data_size;
  2002. void *buffer;
  2003. size_t buffer_size;
  2004. ufbx_read_fn *read_fn;
  2005. void *read_user;
  2006. ufbx_progress_cb progress_cb;
  2007. uint64_t progress_interval_hint;
  2008. uint64_t progress_size_before;
  2009. uint64_t progress_size_after;
  2010. bool no_header;
  2011. bool no_checksum;
  2012. };
  2013. struct ufbx_inflate_retain {
  2014. bool initialized;
  2015. uint64_t data[512];
  2016. };
  2017. typedef enum ufbx_index_error_handling {
  2018. UFBX_INDEX_ERROR_HANDLING_CLAMP,
  2019. UFBX_INDEX_ERROR_HANDLING_NO_INDEX,
  2020. UFBX_INDEX_ERROR_HANDLING_ABORT_LOADING,
  2021. UFBX_INDEX_ERROR_HANDLING_UNSAFE_IGNORE,
  2022. UFBX_INDEX_ERROR_HANDLING_COUNT,
  2023. UFBX_INDEX_ERROR_HANDLING_FORCE_32BIT = 0x7fffffff,
  2024. } ufbx_index_error_handling;
  2025. typedef enum ufbx_unicode_error_handling {
  2026. UFBX_UNICODE_ERROR_HANDLING_REPLACEMENT_CHARACTER,
  2027. UFBX_UNICODE_ERROR_HANDLING_UNDERSCORE,
  2028. UFBX_UNICODE_ERROR_HANDLING_QUESTION_MARK,
  2029. UFBX_UNICODE_ERROR_HANDLING_REMOVE,
  2030. UFBX_UNICODE_ERROR_HANDLING_ABORT_LOADING,
  2031. UFBX_UNICODE_ERROR_HANDLING_UNSAFE_IGNORE,
  2032. UFBX_UNICODE_ERROR_HANDLING_COUNT,
  2033. UFBX_UNICODE_ERROR_HANDLING_FORCE_32BIT = 0x7fffffff,
  2034. } ufbx_unicode_error_handling;
  2035. typedef struct ufbx_load_opts {
  2036. uint32_t _begin_zero;
  2037. ufbx_allocator_opts temp_allocator;
  2038. ufbx_allocator_opts result_allocator;
  2039. bool ignore_geometry;
  2040. bool ignore_animation;
  2041. bool ignore_embedded;
  2042. bool evaluate_skinning;
  2043. bool evaluate_caches;
  2044. bool load_external_files;
  2045. bool skip_skin_vertices;
  2046. bool disable_quirks;
  2047. bool strict;
  2048. ufbx_unsafe bool allow_unsafe;
  2049. ufbx_index_error_handling index_error_handling;
  2050. bool connect_broken_elements;
  2051. bool allow_nodes_out_of_root;
  2052. bool allow_null_material;
  2053. bool generate_missing_normals;
  2054. char path_separator;
  2055. uint64_t file_size_estimate;
  2056. size_t read_buffer_size;
  2057. ufbx_string filename;
  2058. ufbx_blob raw_filename;
  2059. ufbx_progress_cb progress_cb;
  2060. uint64_t progress_interval_hint;
  2061. ufbx_open_file_cb open_file_cb;
  2062. ufbx_coordinate_axes target_axes;
  2063. ufbx_real target_unit_meters;
  2064. bool no_prop_unit_scaling;
  2065. bool no_anim_curve_unit_scaling;
  2066. bool use_root_transform;
  2067. ufbx_transform root_transform;
  2068. ufbx_unicode_error_handling unicode_error_handling;
  2069. bool retain_dom;
  2070. uint32_t _end_zero;
  2071. } ufbx_load_opts;
  2072. typedef struct ufbx_evaluate_opts {
  2073. uint32_t _begin_zero;
  2074. ufbx_allocator_opts temp_allocator;
  2075. ufbx_allocator_opts result_allocator;
  2076. bool evaluate_skinning;
  2077. bool evaluate_caches;
  2078. bool load_external_files;
  2079. ufbx_open_file_cb open_file_cb;
  2080. uint32_t _end_zero;
  2081. } ufbx_evaluate_opts;
  2082. typedef struct ufbx_tessellate_curve_opts {
  2083. uint32_t _begin_zero;
  2084. ufbx_allocator_opts temp_allocator;
  2085. ufbx_allocator_opts result_allocator;
  2086. uint32_t span_subdivision;
  2087. uint32_t _end_zero;
  2088. } ufbx_tessellate_curve_opts;
  2089. typedef struct ufbx_tessellate_surface_opts {
  2090. uint32_t _begin_zero;
  2091. ufbx_allocator_opts temp_allocator;
  2092. ufbx_allocator_opts result_allocator;
  2093. uint32_t span_subdivision_u;
  2094. uint32_t span_subdivision_v;
  2095. uint32_t _end_zero;
  2096. } ufbx_tessellate_surface_opts;
  2097. typedef struct ufbx_subdivide_opts {
  2098. uint32_t _begin_zero;
  2099. ufbx_allocator_opts temp_allocator;
  2100. ufbx_allocator_opts result_allocator;
  2101. ufbx_subdivision_boundary boundary;
  2102. ufbx_subdivision_boundary uv_boundary;
  2103. bool ignore_normals;
  2104. bool interpolate_normals;
  2105. bool interpolate_tangents;
  2106. bool evaluate_source_vertices;
  2107. size_t max_source_vertices;
  2108. bool evaluate_skin_weights;
  2109. size_t max_skin_weights;
  2110. size_t skin_deformer_index;
  2111. uint32_t _end_zero;
  2112. } ufbx_subdivide_opts;
  2113. typedef struct ufbx_geometry_cache_opts {
  2114. uint32_t _begin_zero;
  2115. ufbx_allocator_opts temp_allocator;
  2116. ufbx_allocator_opts result_allocator;
  2117. ufbx_open_file_cb open_file_cb;
  2118. double frames_per_second;
  2119. uint32_t _end_zero;
  2120. } ufbx_geometry_cache_opts;
  2121. typedef struct ufbx_geometry_cache_data_opts {
  2122. uint32_t _begin_zero;
  2123. ufbx_open_file_cb open_file_cb;
  2124. bool additive;
  2125. bool use_weight;
  2126. ufbx_real weight;
  2127. uint32_t _end_zero;
  2128. } ufbx_geometry_cache_data_opts;
  2129. typedef struct ufbx_panic {
  2130. bool did_panic;
  2131. size_t message_length;
  2132. char message[UFBX_PANIC_MESSAGE_LENGTH];
  2133. } ufbx_panic;
  2134. #ifdef __cplusplus
  2135. extern "C" {
  2136. #endif
  2137. extern const ufbx_string ufbx_empty_string;
  2138. extern const ufbx_blob ufbx_empty_blob;
  2139. extern const ufbx_matrix ufbx_identity_matrix;
  2140. extern const ufbx_transform ufbx_identity_transform;
  2141. extern const ufbx_vec2 ufbx_zero_vec2;
  2142. extern const ufbx_vec3 ufbx_zero_vec3;
  2143. extern const ufbx_vec4 ufbx_zero_vec4;
  2144. extern const ufbx_quat ufbx_identity_quat;
  2145. extern const ufbx_coordinate_axes ufbx_axes_right_handed_y_up;
  2146. extern const ufbx_coordinate_axes ufbx_axes_right_handed_z_up;
  2147. extern const ufbx_coordinate_axes ufbx_axes_left_handed_y_up;
  2148. extern const ufbx_coordinate_axes ufbx_axes_left_handed_z_up;
  2149. extern const size_t ufbx_element_type_size[UFBX_ELEMENT_TYPE_COUNT];
  2150. extern const uint32_t ufbx_source_version;
  2151. ufbx_abi bool ufbx_is_thread_safe(void);
  2152. ufbx_abi ufbx_scene *ufbx_load_memory(
  2153. const void *data, size_t data_size,
  2154. const ufbx_load_opts *opts, ufbx_error *error);
  2155. ufbx_abi ufbx_scene *ufbx_load_file(
  2156. const char *filename,
  2157. const ufbx_load_opts *opts, ufbx_error *error);
  2158. ufbx_abi ufbx_scene *ufbx_load_file_len(
  2159. const char *filename, size_t filename_len,
  2160. const ufbx_load_opts *opts, ufbx_error *error);
  2161. ufbx_abi ufbx_scene *ufbx_load_stdio(
  2162. void *file,
  2163. const ufbx_load_opts *opts, ufbx_error *error);
  2164. ufbx_abi ufbx_scene *ufbx_load_stdio_prefix(
  2165. void *file,
  2166. const void *prefix, size_t prefix_size,
  2167. const ufbx_load_opts *opts, ufbx_error *error);
  2168. ufbx_abi ufbx_scene *ufbx_load_stream(
  2169. const ufbx_stream *stream,
  2170. const ufbx_load_opts *opts, ufbx_error *error);
  2171. ufbx_abi ufbx_scene *ufbx_load_stream_prefix(
  2172. const ufbx_stream *stream,
  2173. const void *prefix, size_t prefix_size,
  2174. const ufbx_load_opts *opts, ufbx_error *error);
  2175. ufbx_abi void ufbx_free_scene(ufbx_scene *scene);
  2176. ufbx_abi void ufbx_retain_scene(ufbx_scene *scene);
  2177. ufbx_abi size_t ufbx_format_error(char *dst, size_t dst_size, const ufbx_error *error);
  2178. ufbx_abi ufbx_prop *ufbx_find_prop_len(const ufbx_props *props, const char *name, size_t name_len);
  2179. ufbx_inline ufbx_prop *ufbx_find_prop(const ufbx_props *props, const char *name) { return ufbx_find_prop_len(props, name, strlen(name));}
  2180. ufbx_abi ufbx_real ufbx_find_real_len(const ufbx_props *props, const char *name, size_t name_len, ufbx_real def);
  2181. ufbx_inline ufbx_real ufbx_find_real(const ufbx_props *props, const char *name, ufbx_real def) { return ufbx_find_real_len(props, name, strlen(name), def); }
  2182. ufbx_abi ufbx_vec3 ufbx_find_vec3_len(const ufbx_props *props, const char *name, size_t name_len, ufbx_vec3 def);
  2183. ufbx_inline ufbx_vec3 ufbx_find_vec3(const ufbx_props *props, const char *name, ufbx_vec3 def) { return ufbx_find_vec3_len(props, name, strlen(name), def); }
  2184. ufbx_abi int64_t ufbx_find_int_len(const ufbx_props *props, const char *name, size_t name_len, int64_t def);
  2185. ufbx_inline int64_t ufbx_find_int(const ufbx_props *props, const char *name, int64_t def) { return ufbx_find_int_len(props, name, strlen(name), def); }
  2186. ufbx_abi bool ufbx_find_bool_len(const ufbx_props *props, const char *name, size_t name_len, bool def);
  2187. ufbx_inline bool ufbx_find_bool(const ufbx_props *props, const char *name, bool def) { return ufbx_find_bool_len(props, name, strlen(name), def); }
  2188. ufbx_abi ufbx_string ufbx_find_string_len(const ufbx_props *props, const char *name, size_t name_len, ufbx_string def);
  2189. ufbx_inline ufbx_string ufbx_find_string(const ufbx_props *props, const char *name, ufbx_string def) { return ufbx_find_string_len(props, name, strlen(name), def); }
  2190. ufbx_abi ufbx_blob ufbx_find_blob_len(const ufbx_props *props, const char *name, size_t name_len, ufbx_blob def);
  2191. ufbx_inline ufbx_blob ufbx_find_blob(const ufbx_props *props, const char *name, ufbx_blob def) { return ufbx_find_blob_len(props, name, strlen(name), def); }
  2192. ufbx_abi ufbx_element *ufbx_get_prop_element(const ufbx_element *element, const ufbx_prop *prop, ufbx_element_type type);
  2193. ufbx_abi ufbx_element *ufbx_find_element_len(const ufbx_scene *scene, ufbx_element_type type, const char *name, size_t name_len);
  2194. ufbx_inline ufbx_element *ufbx_find_element(const ufbx_scene *scene, ufbx_element_type type, const char *name) { return ufbx_find_element_len(scene, type, name, strlen(name)); }
  2195. ufbx_abi ufbx_node *ufbx_find_node_len(const ufbx_scene *scene, const char *name, size_t name_len);
  2196. ufbx_inline ufbx_node *ufbx_find_node(const ufbx_scene *scene, const char *name) { return ufbx_find_node_len(scene, name, strlen(name)); }
  2197. ufbx_abi ufbx_anim_stack *ufbx_find_anim_stack_len(const ufbx_scene *scene, const char *name, size_t name_len);
  2198. ufbx_inline ufbx_anim_stack *ufbx_find_anim_stack(const ufbx_scene *scene, const char *name) { return ufbx_find_anim_stack_len(scene, name, strlen(name)); }
  2199. ufbx_abi ufbx_anim_prop *ufbx_find_anim_prop_len(const ufbx_anim_layer *layer, const ufbx_element *element, const char *prop, size_t prop_len);
  2200. ufbx_inline ufbx_anim_prop *ufbx_find_anim_prop(const ufbx_anim_layer *layer, const ufbx_element *element, const char *prop) { return ufbx_find_anim_prop_len(layer, element, prop, strlen(prop)); }
  2201. ufbx_abi ufbx_anim_prop_list ufbx_find_anim_props(const ufbx_anim_layer *layer, const ufbx_element *element);
  2202. ufbx_abi ufbx_matrix ufbx_get_compatible_matrix_for_normals(const ufbx_node *node);
  2203. ufbx_abi ptrdiff_t ufbx_inflate(void *dst, size_t dst_size, const ufbx_inflate_input *input, ufbx_inflate_retain *retain);
  2204. ufbx_abi bool ufbx_open_file(void *user, ufbx_stream *stream, const char *path, size_t path_len);
  2205. ufbx_abi ufbx_real ufbx_evaluate_curve(const ufbx_anim_curve *curve, double time, ufbx_real default_value);
  2206. ufbx_abi ufbx_real ufbx_evaluate_anim_value_real(const ufbx_anim_value *anim_value, double time);
  2207. ufbx_abi ufbx_vec2 ufbx_evaluate_anim_value_vec2(const ufbx_anim_value *anim_value, double time);
  2208. ufbx_abi ufbx_vec3 ufbx_evaluate_anim_value_vec3(const ufbx_anim_value *anim_value, double time);
  2209. ufbx_abi ufbx_prop ufbx_evaluate_prop_len(const ufbx_anim *anim, const ufbx_element *element, const char *name, size_t name_len, double time);
  2210. ufbx_inline ufbx_prop ufbx_evaluate_prop(const ufbx_anim *anim, const ufbx_element *element, const char *name, double time) {
  2211. return ufbx_evaluate_prop_len(anim, element, name, strlen(name), time);
  2212. }
  2213. ufbx_abi ufbx_props ufbx_evaluate_props(const ufbx_anim *anim, const ufbx_element *element, double time, ufbx_prop *buffer, size_t buffer_size);
  2214. ufbx_abi ufbx_transform ufbx_evaluate_transform(const ufbx_anim *anim, const ufbx_node *node, double time);
  2215. ufbx_abi ufbx_real ufbx_evaluate_blend_weight(const ufbx_anim *anim, const ufbx_blend_channel *channel, double time);
  2216. ufbx_abi ufbx_const_prop_override_list ufbx_prepare_prop_overrides(ufbx_prop_override *overrides, size_t num_overrides);
  2217. ufbx_abi ufbx_scene *ufbx_evaluate_scene(const ufbx_scene *scene, const ufbx_anim *anim, double time, const ufbx_evaluate_opts *opts, ufbx_error *error);
  2218. ufbx_abi ufbx_texture *ufbx_find_prop_texture_len(const ufbx_material *material, const char *name, size_t name_len);
  2219. ufbx_inline ufbx_texture *ufbx_find_prop_texture(const ufbx_material *material, const char *name) {
  2220. return ufbx_find_prop_texture_len(material, name, strlen(name));
  2221. }
  2222. ufbx_abi ufbx_string ufbx_find_shader_prop_len(const ufbx_shader *shader, const char *name, size_t name_len);
  2223. ufbx_inline ufbx_string ufbx_find_shader_prop(const ufbx_shader *shader, const char *name) {
  2224. return ufbx_find_shader_prop_len(shader, name, strlen(name));
  2225. }
  2226. ufbx_abi ufbx_shader_prop_binding_list ufbx_find_shader_prop_bindings_len(const ufbx_shader *shader, const char *name, size_t name_len);
  2227. ufbx_inline ufbx_shader_prop_binding_list ufbx_find_shader_prop_bindings(const ufbx_shader *shader, const char *name) {
  2228. return ufbx_find_shader_prop_bindings_len(shader, name, strlen(name));
  2229. }
  2230. ufbx_abi ufbx_shader_texture_input *ufbx_find_shader_texture_input_len(const ufbx_shader_texture *shader, const char *name, size_t name_len);
  2231. ufbx_inline ufbx_shader_texture_input *ufbx_find_shader_texture_input(const ufbx_shader_texture *shader, const char *name) {
  2232. return ufbx_find_shader_texture_input_len(shader, name, strlen(name));
  2233. }
  2234. ufbx_abi bool ufbx_coordinate_axes_valid(ufbx_coordinate_axes axes);
  2235. ufbx_abi ufbx_real ufbx_quat_dot(ufbx_quat a, ufbx_quat b);
  2236. ufbx_abi ufbx_quat ufbx_quat_mul(ufbx_quat a, ufbx_quat b);
  2237. ufbx_abi ufbx_quat ufbx_quat_normalize(ufbx_quat q);
  2238. ufbx_abi ufbx_quat ufbx_quat_fix_antipodal(ufbx_quat q, ufbx_quat reference);
  2239. ufbx_abi ufbx_quat ufbx_quat_slerp(ufbx_quat a, ufbx_quat b, ufbx_real t);
  2240. ufbx_abi ufbx_vec3 ufbx_quat_rotate_vec3(ufbx_quat q, ufbx_vec3 v);
  2241. ufbx_abi ufbx_vec3 ufbx_quat_to_euler(ufbx_quat q, ufbx_rotation_order order);
  2242. ufbx_abi ufbx_quat ufbx_euler_to_quat(ufbx_vec3 v, ufbx_rotation_order order);
  2243. ufbx_abi ufbx_matrix ufbx_matrix_mul(const ufbx_matrix *a, const ufbx_matrix *b);
  2244. ufbx_abi ufbx_real ufbx_matrix_determinant(const ufbx_matrix *m);
  2245. ufbx_abi ufbx_matrix ufbx_matrix_invert(const ufbx_matrix *m);
  2246. ufbx_abi ufbx_matrix ufbx_matrix_for_normals(const ufbx_matrix *m);
  2247. ufbx_abi ufbx_vec3 ufbx_transform_position(const ufbx_matrix *m, ufbx_vec3 v);
  2248. ufbx_abi ufbx_vec3 ufbx_transform_direction(const ufbx_matrix *m, ufbx_vec3 v);
  2249. ufbx_abi ufbx_matrix ufbx_transform_to_matrix(const ufbx_transform *t);
  2250. ufbx_abi ufbx_transform ufbx_matrix_to_transform(const ufbx_matrix *m);
  2251. ufbx_abi ufbx_matrix ufbx_catch_get_skin_vertex_matrix(ufbx_panic *panic, const ufbx_skin_deformer *skin, size_t vertex, const ufbx_matrix *fallback);
  2252. ufbx_inline ufbx_matrix ufbx_get_skin_vertex_matrix(const ufbx_skin_deformer *skin, size_t vertex, const ufbx_matrix *fallback) {
  2253. return ufbx_catch_get_skin_vertex_matrix(NULL, skin, vertex, fallback);
  2254. }
  2255. ufbx_abi ufbx_vec3 ufbx_get_blend_shape_vertex_offset(const ufbx_blend_shape *shape, size_t vertex);
  2256. ufbx_abi ufbx_vec3 ufbx_get_blend_vertex_offset(const ufbx_blend_deformer *blend, size_t vertex);
  2257. ufbx_abi void ufbx_add_blend_shape_vertex_offsets(const ufbx_blend_shape *shape, ufbx_vec3 *vertices, size_t num_vertices, ufbx_real weight);
  2258. ufbx_abi void ufbx_add_blend_vertex_offsets(const ufbx_blend_deformer *blend, ufbx_vec3 *vertices, size_t num_vertices, ufbx_real weight);
  2259. ufbx_abi size_t ufbx_evaluate_nurbs_basis(const ufbx_nurbs_basis *basis, ufbx_real u, ufbx_real *weights, size_t num_weights, ufbx_real *derivatives, size_t num_derivatives);
  2260. ufbx_abi ufbx_curve_point ufbx_evaluate_nurbs_curve(const ufbx_nurbs_curve *curve, ufbx_real u);
  2261. ufbx_abi ufbx_surface_point ufbx_evaluate_nurbs_surface(const ufbx_nurbs_surface *surface, ufbx_real u, ufbx_real v);
  2262. ufbx_abi ufbx_line_curve *ufbx_tessellate_nurbs_curve(const ufbx_nurbs_curve *curve, const ufbx_tessellate_curve_opts *opts, ufbx_error *error);
  2263. ufbx_abi ufbx_mesh *ufbx_tessellate_nurbs_surface(const ufbx_nurbs_surface *surface, const ufbx_tessellate_surface_opts *opts, ufbx_error *error);
  2264. ufbx_abi void ufbx_free_line_curve(ufbx_line_curve *curve);
  2265. ufbx_abi void ufbx_retain_line_curve(ufbx_line_curve *curve);
  2266. ufbx_abi uint32_t ufbx_catch_triangulate_face(ufbx_panic *panic, uint32_t *indices, size_t num_indices, const ufbx_mesh *mesh, ufbx_face face);
  2267. ufbx_inline uint32_t ufbx_triangulate_face(uint32_t *indices, size_t num_indices, const ufbx_mesh *mesh, ufbx_face face) {
  2268. return ufbx_catch_triangulate_face(NULL, indices, num_indices, mesh, face);
  2269. }
  2270. ufbx_abi void ufbx_catch_compute_topology(ufbx_panic *panic, const ufbx_mesh *mesh, ufbx_topo_edge *topo, size_t num_topo);
  2271. ufbx_inline void ufbx_compute_topology(const ufbx_mesh *mesh, ufbx_topo_edge *topo, size_t num_topo) {
  2272. ufbx_catch_compute_topology(NULL, mesh, topo, num_topo);
  2273. }
  2274. ufbx_abi uint32_t ufbx_catch_topo_next_vertex_edge(ufbx_panic *panic, const ufbx_topo_edge *topo, size_t num_topo, uint32_t index);
  2275. ufbx_inline uint32_t ufbx_topo_next_vertex_edge(const ufbx_topo_edge *topo, size_t num_topo, uint32_t index) {
  2276. return ufbx_catch_topo_next_vertex_edge(NULL, topo, num_topo, index);
  2277. }
  2278. ufbx_abi uint32_t ufbx_catch_topo_prev_vertex_edge(ufbx_panic *panic, const ufbx_topo_edge *topo, size_t num_topo, uint32_t index);
  2279. ufbx_inline uint32_t ufbx_topo_prev_vertex_edge(const ufbx_topo_edge *topo, size_t num_topo, uint32_t index) {
  2280. return ufbx_catch_topo_prev_vertex_edge(NULL, topo, num_topo, index);
  2281. }
  2282. ufbx_abi ufbx_vec3 ufbx_catch_get_weighted_face_normal(ufbx_panic *panic, const ufbx_vertex_vec3 *positions, ufbx_face face);
  2283. ufbx_inline ufbx_vec3 ufbx_get_weighted_face_normal(const ufbx_vertex_vec3 *positions, ufbx_face face) {
  2284. return ufbx_catch_get_weighted_face_normal(NULL, positions, face);
  2285. }
  2286. ufbx_abi size_t ufbx_catch_generate_normal_mapping(ufbx_panic *panic, const ufbx_mesh *mesh,
  2287. const ufbx_topo_edge *topo, size_t num_topo,
  2288. uint32_t *normal_indices, size_t num_normal_indices, bool assume_smooth);
  2289. ufbx_abi size_t ufbx_generate_normal_mapping(const ufbx_mesh *mesh,
  2290. const ufbx_topo_edge *topo, size_t num_topo,
  2291. uint32_t *normal_indices, size_t num_normal_indices, bool assume_smooth);
  2292. ufbx_abi void ufbx_catch_compute_normals(ufbx_panic *panic, const ufbx_mesh *mesh, const ufbx_vertex_vec3 *positions,
  2293. const uint32_t *normal_indices, size_t num_normal_indices,
  2294. ufbx_vec3 *normals, size_t num_normals);
  2295. ufbx_abi void ufbx_compute_normals(const ufbx_mesh *mesh, const ufbx_vertex_vec3 *positions,
  2296. const uint32_t *normal_indices, size_t num_normal_indices,
  2297. ufbx_vec3 *normals, size_t num_normals);
  2298. ufbx_abi ufbx_mesh *ufbx_subdivide_mesh(const ufbx_mesh *mesh, size_t level, const ufbx_subdivide_opts *opts, ufbx_error *error);
  2299. ufbx_abi void ufbx_free_mesh(ufbx_mesh *mesh);
  2300. ufbx_abi void ufbx_retain_mesh(ufbx_mesh *mesh);
  2301. ufbx_abi ufbx_geometry_cache *ufbx_load_geometry_cache(
  2302. const char *filename,
  2303. const ufbx_geometry_cache_opts *opts, ufbx_error *error);
  2304. ufbx_abi ufbx_geometry_cache *ufbx_load_geometry_cache_len(
  2305. const char *filename, size_t filename_len,
  2306. const ufbx_geometry_cache_opts *opts, ufbx_error *error);
  2307. ufbx_abi void ufbx_free_geometry_cache(ufbx_geometry_cache *cache);
  2308. ufbx_abi void ufbx_retain_geometry_cache(ufbx_geometry_cache *cache);
  2309. ufbx_abi size_t ufbx_get_read_geometry_cache_real_num_data(const ufbx_cache_frame *frame);
  2310. ufbx_abi size_t ufbx_get_sample_geometry_cache_real_num_data(const ufbx_cache_channel *channel, double time);
  2311. ufbx_abi size_t ufbx_get_read_geometry_cache_vec3_num_data(const ufbx_cache_frame *frame);
  2312. ufbx_abi size_t ufbx_get_sample_geometry_cache_vec3_num_data(const ufbx_cache_channel *channel, double time);
  2313. ufbx_abi size_t ufbx_read_geometry_cache_real(const ufbx_cache_frame *frame, ufbx_real *data, size_t num_data, const ufbx_geometry_cache_data_opts *opts);
  2314. ufbx_abi size_t ufbx_sample_geometry_cache_real(const ufbx_cache_channel *channel, double time, ufbx_real *data, size_t num_data, const ufbx_geometry_cache_data_opts *opts);
  2315. ufbx_abi size_t ufbx_read_geometry_cache_vec3(const ufbx_cache_frame *frame, ufbx_vec3 *data, size_t num_data, const ufbx_geometry_cache_data_opts *opts);
  2316. ufbx_abi size_t ufbx_sample_geometry_cache_vec3(const ufbx_cache_channel *channel, double time, ufbx_vec3 *data, size_t num_data, const ufbx_geometry_cache_data_opts *opts);
  2317. ufbx_abi ufbx_dom_node *ufbx_dom_find_len(const ufbx_dom_node *parent, const char *name, size_t name_len);
  2318. ufbx_inline ufbx_dom_node *ufbx_dom_find(const ufbx_dom_node *parent, const char *name) { return ufbx_dom_find_len(parent, name, strlen(name)); }
  2319. ufbx_abi size_t ufbx_generate_indices(const ufbx_vertex_stream *streams, size_t num_streams, uint32_t *indices, size_t num_indices, const ufbx_allocator_opts *allocator, ufbx_error *error);
  2320. ufbx_abi ufbx_real ufbx_catch_get_vertex_real(ufbx_panic *panic, const ufbx_vertex_real *v, size_t index);
  2321. ufbx_abi ufbx_vec2 ufbx_catch_get_vertex_vec2(ufbx_panic *panic, const ufbx_vertex_vec2 *v, size_t index);
  2322. ufbx_abi ufbx_vec3 ufbx_catch_get_vertex_vec3(ufbx_panic *panic, const ufbx_vertex_vec3 *v, size_t index);
  2323. ufbx_abi ufbx_vec4 ufbx_catch_get_vertex_vec4(ufbx_panic *panic, const ufbx_vertex_vec4 *v, size_t index);
  2324. ufbx_inline ufbx_real ufbx_get_vertex_real(const ufbx_vertex_real *v, size_t index) { ufbx_assert(index < v->indices.count); return v->values.data[(int32_t)v->indices.data[index]]; }
  2325. ufbx_inline ufbx_vec2 ufbx_get_vertex_vec2(const ufbx_vertex_vec2 *v, size_t index) { ufbx_assert(index < v->indices.count); return v->values.data[(int32_t)v->indices.data[index]]; }
  2326. ufbx_inline ufbx_vec3 ufbx_get_vertex_vec3(const ufbx_vertex_vec3 *v, size_t index) { ufbx_assert(index < v->indices.count); return v->values.data[(int32_t)v->indices.data[index]]; }
  2327. ufbx_inline ufbx_vec4 ufbx_get_vertex_vec4(const ufbx_vertex_vec4 *v, size_t index) { ufbx_assert(index < v->indices.count); return v->values.data[(int32_t)v->indices.data[index]]; }
  2328. ufbx_abi size_t ufbx_get_triangulate_face_num_indices(ufbx_face face);
  2329. ufbx_abi ufbx_unknown *ufbx_as_unknown(const ufbx_element *element);
  2330. ufbx_abi ufbx_node *ufbx_as_node(const ufbx_element *element);
  2331. ufbx_abi ufbx_mesh *ufbx_as_mesh(const ufbx_element *element);
  2332. ufbx_abi ufbx_light *ufbx_as_light(const ufbx_element *element);
  2333. ufbx_abi ufbx_camera *ufbx_as_camera(const ufbx_element *element);
  2334. ufbx_abi ufbx_bone *ufbx_as_bone(const ufbx_element *element);
  2335. ufbx_abi ufbx_empty *ufbx_as_empty(const ufbx_element *element);
  2336. ufbx_abi ufbx_line_curve *ufbx_as_line_curve(const ufbx_element *element);
  2337. ufbx_abi ufbx_nurbs_curve *ufbx_as_nurbs_curve(const ufbx_element *element);
  2338. ufbx_abi ufbx_nurbs_surface *ufbx_as_nurbs_surface(const ufbx_element *element);
  2339. ufbx_abi ufbx_nurbs_trim_surface *ufbx_as_nurbs_trim_surface(const ufbx_element *element);
  2340. ufbx_abi ufbx_nurbs_trim_boundary *ufbx_as_nurbs_trim_boundary(const ufbx_element *element);
  2341. ufbx_abi ufbx_procedural_geometry *ufbx_as_procedural_geometry(const ufbx_element *element);
  2342. ufbx_abi ufbx_stereo_camera *ufbx_as_stereo_camera(const ufbx_element *element);
  2343. ufbx_abi ufbx_camera_switcher *ufbx_as_camera_switcher(const ufbx_element *element);
  2344. ufbx_abi ufbx_marker *ufbx_as_marker(const ufbx_element *element);
  2345. ufbx_abi ufbx_lod_group *ufbx_as_lod_group(const ufbx_element *element);
  2346. ufbx_abi ufbx_skin_deformer *ufbx_as_skin_deformer(const ufbx_element *element);
  2347. ufbx_abi ufbx_skin_cluster *ufbx_as_skin_cluster(const ufbx_element *element);
  2348. ufbx_abi ufbx_blend_deformer *ufbx_as_blend_deformer(const ufbx_element *element);
  2349. ufbx_abi ufbx_blend_channel *ufbx_as_blend_channel(const ufbx_element *element);
  2350. ufbx_abi ufbx_blend_shape *ufbx_as_blend_shape(const ufbx_element *element);
  2351. ufbx_abi ufbx_cache_deformer *ufbx_as_cache_deformer(const ufbx_element *element);
  2352. ufbx_abi ufbx_cache_file *ufbx_as_cache_file(const ufbx_element *element);
  2353. ufbx_abi ufbx_material *ufbx_as_material(const ufbx_element *element);
  2354. ufbx_abi ufbx_texture *ufbx_as_texture(const ufbx_element *element);
  2355. ufbx_abi ufbx_video *ufbx_as_video(const ufbx_element *element);
  2356. ufbx_abi ufbx_shader *ufbx_as_shader(const ufbx_element *element);
  2357. ufbx_abi ufbx_shader_binding *ufbx_as_shader_binding(const ufbx_element *element);
  2358. ufbx_abi ufbx_anim_stack *ufbx_as_anim_stack(const ufbx_element *element);
  2359. ufbx_abi ufbx_anim_layer *ufbx_as_anim_layer(const ufbx_element *element);
  2360. ufbx_abi ufbx_anim_value *ufbx_as_anim_value(const ufbx_element *element);
  2361. ufbx_abi ufbx_anim_curve *ufbx_as_anim_curve(const ufbx_element *element);
  2362. ufbx_abi ufbx_display_layer *ufbx_as_display_layer(const ufbx_element *element);
  2363. ufbx_abi ufbx_selection_set *ufbx_as_selection_set(const ufbx_element *element);
  2364. ufbx_abi ufbx_selection_node *ufbx_as_selection_node(const ufbx_element *element);
  2365. ufbx_abi ufbx_character *ufbx_as_character(const ufbx_element *element);
  2366. ufbx_abi ufbx_constraint *ufbx_as_constraint(const ufbx_element *element);
  2367. ufbx_abi ufbx_pose *ufbx_as_pose(const ufbx_element *element);
  2368. ufbx_abi ufbx_metadata_object *ufbx_as_metadata_object(const ufbx_element *element);
  2369. ufbx_abi void ufbx_ffi_find_int_len(int64_t *retval, const ufbx_props *props, const char *name, size_t name_len, const int64_t *def);
  2370. ufbx_abi void ufbx_ffi_find_vec3_len(ufbx_vec3 *retval, const ufbx_props *props, const char *name, size_t name_len, const ufbx_vec3 *def);
  2371. ufbx_abi void ufbx_ffi_find_string_len(ufbx_string *retval, const ufbx_props *props, const char *name, size_t name_len, const ufbx_string *def);
  2372. ufbx_abi void ufbx_ffi_find_anim_props(ufbx_anim_prop_list *retval, const ufbx_anim_layer *layer, const ufbx_element *element);
  2373. ufbx_abi void ufbx_ffi_get_compatible_matrix_for_normals(ufbx_matrix *retval, const ufbx_node *node);
  2374. ufbx_abi void ufbx_ffi_evaluate_anim_value_vec2(ufbx_vec2 *retval, const ufbx_anim_value *anim_value, double time);
  2375. ufbx_abi void ufbx_ffi_evaluate_anim_value_vec3(ufbx_vec3 *retval, const ufbx_anim_value *anim_value, double time);
  2376. ufbx_abi void ufbx_ffi_evaluate_prop_len(ufbx_prop *retval, const ufbx_anim *anim, const ufbx_element *element, const char *name, size_t name_len, double time);
  2377. ufbx_abi void ufbx_ffi_evaluate_props(ufbx_props *retval, const ufbx_anim *anim, ufbx_element *element, double time, ufbx_prop *buffer, size_t buffer_size);
  2378. ufbx_abi void ufbx_ffi_evaluate_transform(ufbx_transform *retval, const ufbx_anim *anim, const ufbx_node *node, double time);
  2379. ufbx_abi ufbx_real ufbx_ffi_evaluate_blend_weight(const ufbx_anim *anim, const ufbx_blend_channel *channel, double time);
  2380. ufbx_abi void ufbx_ffi_prepare_prop_overrides(ufbx_const_prop_override_list *retval, ufbx_prop_override *overrides, size_t num_overrides);
  2381. ufbx_abi void ufbx_ffi_quat_mul(ufbx_quat *retval, const ufbx_quat *a, const ufbx_quat *b);
  2382. ufbx_abi void ufbx_ffi_quat_normalize(ufbx_quat *retval, const ufbx_quat *q);
  2383. ufbx_abi void ufbx_ffi_quat_fix_antipodal(ufbx_quat *retval, const ufbx_quat *q, const ufbx_quat *reference);
  2384. ufbx_abi void ufbx_ffi_quat_slerp(ufbx_quat *retval, const ufbx_quat *a, const ufbx_quat *b, ufbx_real t);
  2385. ufbx_abi void ufbx_ffi_quat_rotate_vec3(ufbx_vec3 *retval, const ufbx_quat *q, const ufbx_vec3 *v);
  2386. ufbx_abi void ufbx_ffi_quat_to_euler(ufbx_vec3 *retval, const ufbx_quat *q, ufbx_rotation_order order);
  2387. ufbx_abi void ufbx_ffi_euler_to_quat(ufbx_quat *retval, const ufbx_vec3 *v, ufbx_rotation_order order);
  2388. ufbx_abi void ufbx_ffi_matrix_mul(ufbx_matrix *retval, const ufbx_matrix *a, const ufbx_matrix *b);
  2389. ufbx_abi void ufbx_ffi_matrix_invert(ufbx_matrix *retval, const ufbx_matrix *m);
  2390. ufbx_abi void ufbx_ffi_matrix_for_normals(ufbx_matrix *retval, const ufbx_matrix *m);
  2391. ufbx_abi void ufbx_ffi_transform_position(ufbx_vec3 *retval, const ufbx_matrix *m, const ufbx_vec3 *v);
  2392. ufbx_abi void ufbx_ffi_transform_direction(ufbx_vec3 *retval, const ufbx_matrix *m, const ufbx_vec3 *v);
  2393. ufbx_abi void ufbx_ffi_transform_to_matrix(ufbx_matrix *retval, const ufbx_transform *t);
  2394. ufbx_abi void ufbx_ffi_matrix_to_transform(ufbx_transform *retval, const ufbx_matrix *m);
  2395. ufbx_abi void ufbx_ffi_get_skin_vertex_matrix(ufbx_matrix *retval, const ufbx_skin_deformer *skin, size_t vertex, const ufbx_matrix *fallback);
  2396. ufbx_abi void ufbx_ffi_get_blend_shape_vertex_offset(ufbx_vec3 *retval, const ufbx_blend_shape *shape, size_t vertex);
  2397. ufbx_abi void ufbx_ffi_get_blend_vertex_offset(ufbx_vec3 *retval, const ufbx_blend_deformer *blend, size_t vertex);
  2398. ufbx_abi void ufbx_ffi_evaluate_nurbs_curve(ufbx_curve_point *retval, const ufbx_nurbs_curve *curve, ufbx_real u);
  2399. ufbx_abi void ufbx_ffi_evaluate_nurbs_surface(ufbx_surface_point *retval, const ufbx_nurbs_surface *surface, ufbx_real u, ufbx_real v);
  2400. ufbx_abi void ufbx_ffi_get_weighted_face_normal(ufbx_vec3 *retval, const ufbx_vertex_vec3 *positions, const ufbx_face *face);
  2401. ufbx_abi size_t ufbx_ffi_get_triangulate_face_num_indices(const ufbx_face *face);
  2402. ufbx_abi uint32_t ufbx_ffi_triangulate_face(uint32_t *indices, size_t num_indices, const ufbx_mesh *mesh, const ufbx_face *face);
  2403. ufbx_inline size_t ufbx_check_index(size_t index, size_t count) {
  2404. (void)count;
  2405. ufbx_assert(index < count);
  2406. return index;
  2407. }
  2408. #define ufbx_at(list, index) ((list).data[ufbx_check_index((index), (list).count)])
  2409. #ifdef __cplusplus
  2410. }
  2411. #endif
  2412. #if defined(_MSC_VER)
  2413. #pragma warning(pop)
  2414. #endif
  2415. #endif