Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ufbx"
version = "0.10.1"
version = "0.11.0"
authors = ["bqqbarbhg <bqqbarbhg@gmail.com>"]
edition = "2018"
description = "Bindings for ufbx"
Expand Down
2 changes: 1 addition & 1 deletion sfs-deps.json.lock
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sfs=04890ac20b5797f26b523e502141d1fc637f50e5
ufbx=7103691b3c4d8a863810135e07cf62b0cb6b98d2
ufbx=8c897bb61dd87c3a26f81b72176d5ec45d2011be
11 changes: 7 additions & 4 deletions ufbx/ufbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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") },
Expand Down Expand Up @@ -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;
}
Expand Down
10 changes: 8 additions & 2 deletions ufbx/ufbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Loading