From 99ce2fced95e94bea15c7943f0f474d5ed37cdfc Mon Sep 17 00:00:00 2001 From: bqqbarbhg Date: Mon, 18 May 2026 00:39:16 +0300 Subject: [PATCH] Update ufbx to v0.22.0 --- native/viewer/ufbx.c | 7 +++++-- native/viewer/ufbx.h | 5 +++-- sfs-deps.json.lock | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/native/viewer/ufbx.c b/native/viewer/ufbx.c index 12ae741..bf5f7ad 100644 --- a/native/viewer/ufbx.c +++ b/native/viewer/ufbx.c @@ -874,7 +874,7 @@ enum { UFBX_MAXIMUM_ALIGNMENT = sizeof(void*) > 8 ? sizeof(void*) : 8 }; // -- Version -#define UFBX_SOURCE_VERSION ufbx_pack_version(0, 21, 4) +#define UFBX_SOURCE_VERSION ufbx_pack_version(0, 22, 0) ufbx_abi_data_def const uint32_t ufbx_source_version = UFBX_SOURCE_VERSION; ufbx_static_assert(source_header_version, UFBX_SOURCE_VERSION/1000u == UFBX_HEADER_VERSION/1000u); @@ -12032,7 +12032,7 @@ static bool ufbxi_match_version_string(const char *fmt, ufbx_string str, uint32_ } if (pos >= str.length) return false; pos++; - } else if (c == '/' || c == '.' || c == '(' || c == ')') { + } else if (c == '/' || c == '.' || c == '(' || c == ')' || c == '_') { if (pos >= str.length) return false; if (str.data[pos] != c) return false; pos++; @@ -12081,6 +12081,9 @@ ufbxi_nodiscard ufbxi_noinline static int ufbxi_match_exporter(ufbxi_context *uc } else if (ufbxi_match_version_string("motionbuilder/mocap/online version ?.?", creator, version)) { uc->exporter = UFBX_EXPORTER_MOTION_BUILDER; uc->exporter_version = ufbx_pack_version(version[0], version[1], 0); + } else if (ufbxi_match_version_string("ufbx_write", creator, version)) { + uc->exporter = UFBX_EXPORTER_UFBX_WRITE; + uc->exporter_version = ufbx_pack_version(0, 0, 1); } uc->scene.metadata.exporter = uc->exporter; diff --git a/native/viewer/ufbx.h b/native/viewer/ufbx.h index e8db3a2..bbb456e 100644 --- a/native/viewer/ufbx.h +++ b/native/viewer/ufbx.h @@ -267,7 +267,7 @@ struct ufbx_converter { }; // `ufbx_source_version` contains the version of the corresponding source file. // HINT: The version can be compared numerically to the result of `ufbx_pack_version()`, // for example `#if UFBX_VERSION >= ufbx_pack_version(0, 12, 0)`. -#define UFBX_HEADER_VERSION ufbx_pack_version(0, 21, 4) +#define UFBX_HEADER_VERSION ufbx_pack_version(0, 22, 0) #define UFBX_VERSION UFBX_HEADER_VERSION // -- Basic types @@ -3502,11 +3502,12 @@ typedef enum ufbx_exporter UFBX_ENUM_REPR { UFBX_EXPORTER_BLENDER_BINARY, UFBX_EXPORTER_BLENDER_ASCII, UFBX_EXPORTER_MOTION_BUILDER, + UFBX_EXPORTER_UFBX_WRITE, UFBX_ENUM_FORCE_WIDTH(UFBX_EXPORTER) } ufbx_exporter; -UFBX_ENUM_TYPE(ufbx_exporter, UFBX_EXPORTER, UFBX_EXPORTER_MOTION_BUILDER); +UFBX_ENUM_TYPE(ufbx_exporter, UFBX_EXPORTER, UFBX_EXPORTER_UFBX_WRITE); typedef struct ufbx_application { ufbx_string vendor; diff --git a/sfs-deps.json.lock b/sfs-deps.json.lock index 2eee65f..3efbb0f 100644 --- a/sfs-deps.json.lock +++ b/sfs-deps.json.lock @@ -1,2 +1,2 @@ sfs=04890ac20b5797f26b523e502141d1fc637f50e5 -ufbx=8c897bb61dd87c3a26f81b72176d5ec45d2011be +ufbx=448a7cc3ac0a323a870d118362830fb9936e586a