From b42d07dc59ee26a8de8127793225e8b27ff4a8b5 Mon Sep 17 00:00:00 2001 From: bqqbarbhg Date: Sun, 17 May 2026 17:31:30 +0300 Subject: [PATCH] Release 0.11.0 (ufbx 0.21.5) --- Cargo.toml | 2 +- sfs-deps.json.lock | 2 +- ufbx/ufbx.c | 11 +++++++---- ufbx/ufbx.h | 10 ++++++++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b4cfd64..68e12e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ufbx" -version = "0.10.1" +version = "0.11.0" authors = ["bqqbarbhg "] edition = "2018" description = "Bindings for ufbx" diff --git a/sfs-deps.json.lock b/sfs-deps.json.lock index a09f7db..2eee65f 100644 --- a/sfs-deps.json.lock +++ b/sfs-deps.json.lock @@ -1,2 +1,2 @@ sfs=04890ac20b5797f26b523e502141d1fc637f50e5 -ufbx=7103691b3c4d8a863810135e07cf62b0cb6b98d2 +ufbx=8c897bb61dd87c3a26f81b72176d5ec45d2011be diff --git a/ufbx/ufbx.c b/ufbx/ufbx.c index 6f4be07..12ae741 100644 --- a/ufbx/ufbx.c +++ b/ufbx/ufbx.c @@ -542,7 +542,8 @@ extern "C" { #pragma GCC diagnostic ignored "-Wfloat-conversion" #endif // `-Warray-bounds` results in warnings if UBsan is enabled and pre-GCC-14 has no way of detecting it.. - #if UFBXI_GNUC_VERSION >= ufbx_pack_version(4, 3, 0) && UFBXI_GNUC_VERSION < ufbx_pack_version(14, 0, 0) + // The workaround for this uses an assert, but if the user has both UBsan and asserts disabled we need to silence the warning. + #if (UFBXI_GNUC_VERSION >= ufbx_pack_version(4, 3, 0) && UFBXI_GNUC_VERSION < ufbx_pack_version(14, 0, 0)) || defined(NDEBUG) #pragma GCC diagnostic ignored "-Warray-bounds" #endif #endif @@ -873,7 +874,7 @@ enum { UFBX_MAXIMUM_ALIGNMENT = sizeof(void*) > 8 ? sizeof(void*) : 8 }; // -- Version -#define UFBX_SOURCE_VERSION ufbx_pack_version(0, 21, 1) +#define UFBX_SOURCE_VERSION ufbx_pack_version(0, 21, 4) 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); @@ -1081,7 +1082,7 @@ ufbx_static_assert(source_header_version, UFBX_SOURCE_VERSION/1000u == UFBX_HEAD // -- Utility #if defined(UFBX_UBSAN) - static void ufbxi_assert_zero(size_t offset) { ufbx_assert(offset == 0); } + static void ufbxi_assert_zero(size_t offset) { (void)offset; ufbx_assert(offset == 0); } #define ufbxi_add_ptr(ptr, offset) ((ptr) ? (ptr) + (offset) : (ufbxi_assert_zero((size_t)(offset)), (ptr))) #define ufbxi_sub_ptr(ptr, offset) ((ptr) ? (ptr) - (offset) : (ufbxi_assert_zero((size_t)(offset)), (ptr))) #else @@ -19391,6 +19392,7 @@ static const ufbxi_shader_mapping ufbxi_obj_fbx_mapping[] = { { UFBX_MATERIAL_FBX_NORMAL_MAP, 0, 0, ufbxi_mat_string("norm") }, { UFBX_MATERIAL_FBX_DISPLACEMENT, 0, 0, ufbxi_mat_string("disp") }, { UFBX_MATERIAL_FBX_BUMP, 0, 0, ufbxi_mat_string("bump") }, + { UFBX_MATERIAL_FBX_BUMP, 0, 0, ufbxi_mat_string("Bump") }, }; static const ufbxi_shader_mapping ufbxi_fbx_lambert_shader_pbr_mapping[] = { @@ -19736,6 +19738,7 @@ static const ufbxi_shader_mapping ufbxi_obj_pbr_mapping[] = { { UFBX_MATERIAL_PBR_TRANSMISSION_COLOR, UFBXI_SHADER_MAPPING_DEFAULT_W_1|UFBXI_SHADER_MAPPING_WIDEN_TO_RGB, 0, ufbxi_mat_string("Tf") }, { UFBX_MATERIAL_PBR_DISPLACEMENT_MAP, 0, 0, ufbxi_mat_string("disp") }, { UFBX_MATERIAL_PBR_NORMAL_MAP, 0, 0, ufbxi_mat_string("bump") }, + { UFBX_MATERIAL_PBR_NORMAL_MAP, 0, 0, ufbxi_mat_string("Bump") }, { UFBX_MATERIAL_PBR_NORMAL_MAP, 0, 0, ufbxi_mat_string("norm") }, { UFBX_MATERIAL_PBR_SHEEN_COLOR, UFBXI_SHADER_MAPPING_DEFAULT_W_1|UFBXI_SHADER_MAPPING_WIDEN_TO_RGB, 0, ufbxi_mat_string("Ps") }, { UFBX_MATERIAL_PBR_COAT_FACTOR, 0, 0, ufbxi_mat_string("Pc") }, @@ -27074,7 +27077,7 @@ ufbxi_nodiscard static ufbxi_noinline int ufbxi_bake_postprocess_quat(ufbxi_bake ufbx_quat ref = src.data[0].value; for (size_t i = 1; i < src.count; i++) { ufbx_quat v = src.data[i].value; - if (v.x != ref.x || v.y != ref.y || v.z != ref.z || v.y != ref.w) { + if (v.x != ref.x || v.y != ref.y || v.z != ref.z || v.w != ref.w) { constant = false; break; } diff --git a/ufbx/ufbx.h b/ufbx/ufbx.h index 21cace7..e8db3a2 100644 --- a/ufbx/ufbx.h +++ b/ufbx/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, 1) +#define UFBX_HEADER_VERSION ufbx_pack_version(0, 21, 4) #define UFBX_VERSION UFBX_HEADER_VERSION // -- Basic types @@ -1627,6 +1627,7 @@ struct ufbx_camera { // Bone attached to a `ufbx_node`, provides the logical length of the bone // but most interesting information is directly in `ufbx_node`. +// NOTE: The FBX format calls these Skeleton node attributes. struct ufbx_bone { union { ufbx_element element; struct { ufbx_string name; @@ -1647,6 +1648,7 @@ struct ufbx_bone { }; // Empty/NULL/locator connected to a node, actual details in `ufbx_node` +// NOTE: The FBX format calls these Null node attributes. struct ufbx_empty { union { ufbx_element element; struct { ufbx_string name; @@ -3916,9 +3918,13 @@ typedef struct ufbx_scene_settings { ufbx_time_protocol time_protocol; ufbx_snap_mode snap_mode; - // Original settings (?) + // Original `axes.up` value for the scene. + // NOTE: This may be `UFBX_COORDINATE_AXIS_UNKNOWN` if not specified in the file. ufbx_coordinate_axis original_axis_up; + + // Original `unit_meters` value for the scene. ufbx_real original_unit_meters; + } ufbx_scene_settings; struct ufbx_scene {