Assertion function used in ufbx, defaults to C standard assert().

You can define this to your custom preferred assert macro, but in that case make sure that it is also used within ufbx.c. Defining UFBX_NO_ASSERT to any value disables assertions.

Pointer may be NULL.

Changing this value from default or calling this function can lead into breaking API guarantees.

Linkage of the main ufbx API functions.

Defaults to nothing, or static if UFBX_STATIC is defined. If you want to isolate ufbx to a single translation unit you can do the following:

#define UFBX_STATIC
#include "ufbx.h"
#include "ufbx.c"

Linkage of the main ufbx data fields in the header.

Defaults to extern, or static if UFBX_STATIC is defined.

Linkage of the main ufbx data fields in the source.

Defaults to nothing, or static if UFBX_STATIC is defined.

Limits for embedded arrays within structures.

Number of thread groups to use if threading is enabled.

A thread group processes a number of tasks and is then waited and potentially re-used later. In essence, this controls the granularity of threading.

Packing/unpacking for UFBX_HEADER_VERSION and ufbx_source_version.

Version of the ufbx header.

UFBX_VERSION is simply an alias of UFBX_HEADER_VERSION. ufbx_source_version contains the version of the corresponding source file.

The version can be compared numerically to the result of ufbx_pack_version(), for example #if UFBX_VERSION >= ufbx_pack_version(0, 12, 0).

Main floating point type used everywhere in ufbx, defaults to double.

If you define UFBX_REAL_IS_FLOAT to any value, ufbx_real will be defined as float instead. You can also manually define UFBX_REAL_TYPE to any floating point type.

struct ufbx_string

Null-terminated UTF-8 encoded string within an FBX file

struct ufbx_blob

Opaque byte buffer blob

struct ufbx_vec2

2D vector

union
struct

struct ufbx_vec3

3D vector

union
struct

struct ufbx_vec4

4D vector

union

struct ufbx_quat

Quaternion

union

enum ufbx_rotation_order

Order in which Euler-angle rotation axes are applied for a transform

The order in the name refers to the order of axes applied, not the multiplication order: eg. UFBX_ROTATION_ORDER_XYZ is Z*Y*X

struct ufbx_transform

Explicit translation+rotation+scale transformation.

Rotation is a quaternion, not Euler angles!

struct ufbx_matrix

4x3 matrix encoding an affine transformation.

cols[0..2] are the X/Y/Z basis vectors, cols[3] is the translation

struct ufbx_void_list

struct ufbx_bool_list

struct ufbx_uint32_list

struct ufbx_real_list

struct ufbx_vec2_list

struct ufbx_vec3_list

struct ufbx_vec4_list

struct ufbx_string_list

 

Sentinel value used to represent a missing index.

 

 

enum ufbx_prop_type

Data type contained within the property. All the data fields are always populated regardless of type, so there's no need to switch by type usually eg. prop->value_real and prop->value_int have the same value (well, close) if prop->type == UFBX_PROP_INTEGER. String values are not converted from/to.

enum ufbx_prop_flags

Property flags: Advanced information about properties, not usually needed.

Supports animation.

ufbx ignores this and allows animations on non-animatable properties.

User defined (custom) property.

Hidden in UI.

Disallow modification from UI for components.

Disable animation from components.

Property created by ufbx when an element has a connected ufbx_anim_prop but doesn't contain the ufbx_prop it's referring to.

The property may have been found in the templated defaults.

The property has at least one ufbx_anim_prop in some layer.

Used by ufbx_evaluate_prop() to indicate the the property was not found.

The property is connected to another one.

This use case is relatively rare so ufbx_prop does not track connections directly. You can find connections from ufbx_element.connections_dst where ufbx_connection.dst_prop is this property and ufbx_connection.src_prop is defined.

The value of this property is undefined (represented as zero).

This property has been overridden by the user.

See ufbx_anim.prop_overrides for more information.

Value type.

REAL/VEC2/VEC3/VEC4 are mutually exclusive but may coexist with eg. STRING in some rare cases where the string defines the unit for the vector.

struct ufbx_prop_list

struct ufbx_props

List of alphabetically sorted properties with potential defaults.

For animated objects in as scene from ufbx_evaluate_scene() this list only has the animated properties, the originals are stored under defaults.

 

struct ufbx_node_list

struct ufbx_mesh_list

struct ufbx_light_list

struct ufbx_camera_list

struct ufbx_bone_list

struct ufbx_empty_list

struct ufbx_marker_list

struct ufbx_video_list

struct ufbx_shader_list

struct ufbx_pose_list

enum ufbx_element_type

UFBX_ELEMENT_UNKNOWN
UFBX_ELEMENT_NODE
UFBX_ELEMENT_MESH
UFBX_ELEMENT_LIGHT
UFBX_ELEMENT_CAMERA
UFBX_ELEMENT_BONE
UFBX_ELEMENT_EMPTY
UFBX_ELEMENT_LINE_CURVE
UFBX_ELEMENT_NURBS_CURVE
UFBX_ELEMENT_NURBS_SURFACE
UFBX_ELEMENT_NURBS_TRIM_SURFACE
UFBX_ELEMENT_NURBS_TRIM_BOUNDARY
UFBX_ELEMENT_PROCEDURAL_GEOMETRY
UFBX_ELEMENT_STEREO_CAMERA
UFBX_ELEMENT_CAMERA_SWITCHER
UFBX_ELEMENT_MARKER
UFBX_ELEMENT_LOD_GROUP
UFBX_ELEMENT_SKIN_DEFORMER
UFBX_ELEMENT_SKIN_CLUSTER
UFBX_ELEMENT_BLEND_DEFORMER
UFBX_ELEMENT_BLEND_CHANNEL
UFBX_ELEMENT_BLEND_SHAPE
UFBX_ELEMENT_CACHE_DEFORMER
UFBX_ELEMENT_CACHE_FILE
UFBX_ELEMENT_MATERIAL
UFBX_ELEMENT_TEXTURE
UFBX_ELEMENT_VIDEO
UFBX_ELEMENT_SHADER
UFBX_ELEMENT_SHADER_BINDING
UFBX_ELEMENT_ANIM_STACK
UFBX_ELEMENT_ANIM_LAYER
UFBX_ELEMENT_ANIM_VALUE
UFBX_ELEMENT_ANIM_CURVE
UFBX_ELEMENT_DISPLAY_LAYER
UFBX_ELEMENT_SELECTION_SET
UFBX_ELEMENT_SELECTION_NODE
UFBX_ELEMENT_CHARACTER
UFBX_ELEMENT_CONSTRAINT
UFBX_ELEMENT_AUDIO_LAYER
UFBX_ELEMENT_AUDIO_CLIP
UFBX_ELEMENT_POSE
UFBX_ELEMENT_METADATA_OBJECT
UFBX_ELEMENT_TYPE_FIRST_ATTRIB
UFBX_ELEMENT_TYPE_LAST_ATTRIB
UFBX_ELEMENT_TYPE_COUNT

struct ufbx_connection

Connection between two elements.

Source and destination are somewhat arbitrary but the destination is often the "container" like a parent node or mesh containing a deformer.

struct ufbx_element

Element "base-class" common to each element.

Some fields (like connections_src) are advanced and not visible in the specialized element structs.

The element_id value is consistent when loading the same file, but re-exporting the file will invalidate them.

struct ufbx_unknown

union

Shared "base-class" header, see ufbx_element.

FBX format specific type information.

In ASCII FBX format:

super_type: ID, "type::name", "sub_type" { ... }

enum ufbx_inherit_mode

Inherit type specifies how hierarchial node transforms are combined.

This only affects the final scaling, as rotation and translation are always inherited correctly.

These don't map to "InheritType" property as there may be new ones for compatibility with various exporters.

Normal matrix composition of hierarchy: R*S*r*s.

child.node_to_world = parent.node_to_world * child.node_to_parent;

Ignore parent scale when computing the transform: R*r*s.

ufbx_transform t = node.local_transform;
t.translation *= parent.inherit_scale;
t.scale *= node.inherit_scale_node.inherit_scale;
child.node_to_world = parent.unscaled_node_to_world * t;

Also known as "Segment scale compensate" in some software.

Apply parent scale component-wise: R*r*S*s.

ufbx_transform t = node.local_transform;
t.translation *= parent.inherit_scale;
t.scale *= node.inherit_scale_node.inherit_scale;
child.node_to_world = parent.unscaled_node_to_world * t;

struct ufbx_node

Nodes form the scene transformation hierarchy and can contain attached elements such as meshes or lights. In normal cases a single ufbx_node contains only a single attached element, so using type/mesh/... is safe.

union

Parent node containing this one if not root.

Always non-NULL for non-root nodes unless ufbx_load_opts.allow_nodes_out_of_root is enabled.

List of child nodes parented to this node.

Common attached element type and typed pointers. Set to NULL if not in use, so checking attrib_type is not required.

If you need less common attributes access ufbx_node.attrib, you can use utility functions like ufbx_as_nurbs_curve(attrib) to convert and check the attribute in one step.

Less common attributes use these fields.

Defined even if it is one of the above, eg. ufbx_mesh. In case there is multiple attributes this will be the first one.

Geometry transform helper if one exists.

Scale helper if one exists.

attrib->type if attrib is defined, otherwise UFBX_ELEMENT_UNKNOWN.

List of all attached attribute elements.

In most cases there is only zero or one attributes per node, but if you have a very exotic FBX file nodes may have multiple attributes.

Local transform in parent, geometry transform is a non-inherited transform applied only to attachments like meshes

Combined scale when using UFBX_INHERIT_MODE_COMPONENTWISE_SCALE.

Contains local_transform.scale otherwise.

Node where scale is inherited from for UFBX_INHERIT_MODE_COMPONENTWISE_SCALE and even for UFBX_INHERIT_MODE_IGNORE_PARENT_SCALE. For componentwise-scale nodes, this will point to parent, for scale ignoring nodes this will point to the parent of the nearest componentwise-scaled node in the parent chain.

Specifies the axis order euler_rotation is applied in.

Rotation around the local X/Y/Z axes in rotation_order.

The angles are specified in degrees.

Transform from this node to parent space.

Equivalent to ufbx_transform_to_matrix(&local_transform).

Transform from this node to the world space, ie. multiplying all the node_to_parent matrices of the parent chain together.

Transform from the attribute to this node. Does not affect the transforms of children! Equivalent to ufbx_transform_to_matrix(&geometry_transform).

Transform from attribute space to world space.

Equivalent to ufbx_matrix_mul(&node_to_world, &geometry_to_node).

Transform from this node to world space, ignoring self scaling.

Translation applied between parent and self

Rotation applied between parent and self

Scaling applied between parent and self

Rotation applied in local space at the end

Scaling applied in local space at the end

Scaling applied to translation only

Mirror translation and rotation on this axis

Materials used by mesh or other attrib.

There may be multiple copies of a single ufbx_mesh with different materials in the ufbx_node instances.

Bind pose

Visibility state.

True if this node is the implicit root node of the scene.

True if the node has a non-identity geometry_transform.

If true the transform is adjusted by ufbx, not enabled by default.

See adjust_pre_rotation, adjust_pre_scale, adjust_post_rotation, and adjust_post_scale.

Scale is adjusted by root scale.

True if this node is a synthetic geometry transform helper.

True if the node is a synthetic scale compensation helper.

Parent node to children that can compensate for parent scale.

How deep is this node in the parent hierarchy. Root node is at depth 0 and the immediate children of root at 1.

struct ufbx_vertex_attrib

Vertex attribute: All attributes are stored in a consistent indexed format regardless of how it's actually stored in the file.

values is a contiguous array of attribute values. indices maps each mesh index into a value in the values array.

If unique_per_vertex is set then the attribute is guaranteed to have a single defined value per vertex accessible via:

attrib.values.data[attrib.indices.data[mesh->vertex_first_index[vertex_ix]]

Is this attribute defined by the mesh.

List of values the attribute uses.

Indices into values[], indexed up to ufbx_mesh.num_indices.

Number of ufbx_real entries per value.

true if this attribute is defined per vertex, instead of per index.

Optional 4th 'W' component for the attribute.

May be defined for the following:

This is not loaded by default, set ufbx_load_opts.retain_vertex_attrib_w.

struct ufbx_vertex_real

1D vertex attribute, see ufbx_vertex_attrib for information

struct ufbx_vertex_vec2

2D vertex attribute, see ufbx_vertex_attrib for information

struct ufbx_vertex_vec3

3D vertex attribute, see ufbx_vertex_attrib for information

struct ufbx_vertex_vec4

4D vertex attribute, see ufbx_vertex_attrib for information

struct ufbx_uv_set

Vertex UV set/layer

UV / texture coordinates

(optional) Tangent vector in UV.x direction

(optional) Tangent vector in UV.y direction

struct ufbx_color_set

Vertex color set/layer

Per-vertex RGBA color

struct ufbx_uv_set_list

struct ufbx_edge

Edge between two indices in a mesh

union
struct

struct ufbx_edge_list

struct ufbx_face

Polygonal face with arbitrary number vertices, a single face contains a contiguous range of mesh indices, eg. {5,3} would have indices 5, 6, 7

num_indices maybe less than 3 in which case the face is invalid!

struct ufbx_face_list

struct ufbx_mesh_part

Subset of mesh faces used by a single material or group.

Index of the mesh part.

Number of faces (polygons)

Number of triangles if triangulated

Number of faces with zero vertices

Number of faces with a single vertex

Number of faces with two vertices

Indices to ufbx_mesh.faces[].

Always contains num_faces elements.

struct ufbx_face_group

Numerical ID for this group.

Name for the face group.

enum ufbx_subdivision_boundary

OpenSubdiv: VTX_BOUNDARY_EDGE_AND_CORNER / FVAR_LINEAR_CORNERS_ONLY

OpenSubdiv: VTX_BOUNDARY_EDGE_ONLY / FVAR_LINEAR_NONE

OpenSubdiv: FVAR_LINEAR_BOUNDARIES

OpenSubdiv: FVAR_LINEAR_ALL

struct ufbx_mesh

Polygonal mesh geometry.

Example mesh with two triangles (x, z) and a quad (y). The faces have a constant UV coordinate x/y/z. The vertices have per vertex normals that point up/down.

  ^   ^     ^
  A---B-----C
  |x /     /|
  | /  y  / |
  |/     / z|
  D-----E---F
  v     v   v

Attributes may have multiple values within a single vertex, for example a UV seam vertex has two UV coordinates. Thus polygons are defined using an index that counts each corner of each face polygon. If an attribute is defined (even per-vertex) it will always have a valid indices array.

{0,3}    {3,4}    {7,3}   faces ({ index_begin, num_indices })
0 1 2   3 4 5 6   7 8 9   index

0 1 3   1 2 4 3   2 4 5   vertex_indices[index]
A B D   B C E D   C E F   vertices[vertex_indices[index]]

0 0 1   0 0 1 1   0 1 1   vertex_normal.indices[index]
^ ^ v   ^ ^ v v   ^ v v   vertex_normal.data[vertex_normal.indices[index]]

0 0 0   1 1 1 1   2 2 2   vertex_uv.indices[index]
x x x   y y y y   z z z   vertex_uv.data[vertex_uv.indices[index]]

Vertex position can also be accessed uniformly through an accessor:

0 1 3   1 2 4 3   2 4 5   vertex_position.indices[index]
A B D   B C E D   C E F   vertex_position.data[vertex_position.indices[index]]

Some geometry data is specified per logical vertex. Vertex positions are the only attribute that is guaranteed to be defined uniquely per vertex. Vertex attributes may be defined per vertex if unique_per_vertex == true. You can access the per-vertex values by first finding the first index that refers to the given vertex.

0 1 2 3 4 5  vertex
A B C D E F  vertices[vertex]

0 1 4 2 5 9  vertex_first_index[vertex]
0 0 0 1 1 1  vertex_normal.indices[vertex_first_index[vertex]]
^ ^ ^ v v v  vertex_normal.data[vertex_normal.indices[vertex_first_index[vertex]]]

Number of logical "vertex" points

Number of combiend vertex/attribute tuples

Number of faces (polygons) in the mesh

Number of triangles if triangulated

Number of edges in the mesh.

May be zero in valid meshes if the file doesn't contain edge adjacency data!

Maximum number of triangles in a face in this mesh

Number of faces with zero vertices

Number of faces with a single vertex

Number of faces with two vertices

Face index range

Should the face have soft normals

Face polygon group index, indices to ufbx_mesh.face_groups[]

Should the face be hidden as a "hole"

Edge index range

Should the edge have soft normals

Crease value for subdivision surfaces

Should the edge be visible

Logical vertices and positions, alternatively you can use vertex_position for consistent interface with other attributes.

First index referring to a given vertex, UFBX_NO_INDEX if the vertex is unused.

Vertex positions

(optional) Normal vectors, always defined if ufbx_load_opts.generate_missing_normals

(optional) UV / texture coordinates

(optional) Tangent vector in UV.x direction

(optional) Tangent vector in UV.y direction

(optional) Per-vertex RGBA color

(optional) Crease value for subdivision surfaces

Multiple named UV/color sets

The first set contains the same data as vertex_uv/color!

Materials used by the mesh.

These can be wrong if you want to support per-instance materials! Use ufbx_node.materials[] to get the per-instance materials at the same indices.

Face groups for this mesh.

Segments that use a given material.

Defined even if the mesh doesn't have any materials.

Segments for each face group.

Order of material_parts by first face that refers to it.

Useful for compatibility with FBX SDK and various importers using it, as they use this material order by default.

Skinned vertex positions, for efficiency the skinned positions are the same as the static ones for non-skinned meshes and skinned_is_local is set to true meaning you need to transform them manually using ufbx_transform_position(&node->geometry_to_world, skinned_pos)!

The winding of the faces has been reversed.

Normals have been generated instead of evaluated.

Either from missing normals (via ufbx_load_opts.generate_missing_normals), skinning, tessellation, or subdivision.

Tessellation (result)

enum ufbx_light_type

The kind of light source

Single point at local origin, at node->world_transform.position

Infinite directional light pointing locally towards light->local_direction For global: ufbx_transform_direction(&node->node_to_world, light->local_direction)

Cone shaped light towards light->local_direction, between light->inner/outer_angle.

For global: ufbx_transform_direction(&node->node_to_world, light->local_direction)

Area light, shape specified by light->area_shape

Volumetric light source

enum ufbx_light_decay

How fast does the light intensity decay at a distance

struct ufbx_light

Light source attached to a ufbx_node

Color and intensity of the light, usually you want to use color * intensity

intensity is 0.01x of the property "Intensity" as that matches matches values in DCC programs before exporting.

Direction the light is aimed at in node's local space, usually -Y

enum ufbx_aspect_mode

Method of specifying the rendering resolution from properties

Handled internally by ufbx, ignore unless you interpret ufbx_props directly!

No defined resolution

"AspectWidth" and "AspectHeight" are relative to each other

"AspectWidth" and "AspectHeight" are both pixels

"AspectWidth" is pixels, "AspectHeight" is relative to width

< "AspectHeight" is pixels, "AspectWidth" is relative to height

enum ufbx_aperture_mode

Method of specifying the field of view from properties

Handled internally by ufbx, ignore unless you interpret ufbx_props directly!

Use separate "FieldOfViewX" and "FieldOfViewY" as horizontal/vertical FOV angles

Use "FieldOfView" as horizontal FOV angle, derive vertical angle via aspect ratio

Use "FieldOfView" as vertical FOV angle, derive horizontal angle via aspect ratio

Compute the field of view from the render gate size and focal length

enum ufbx_gate_fit

Method of specifying the render gate size from properties

Handled internally by ufbx, ignore unless you interpret ufbx_props directly!

Use the film/aperture size directly as the render gate

Fit the render gate to the height of the film, derive width from aspect ratio

Fit the render gate to the width of the film, derive height from aspect ratio

Fit the render gate so that it is fully contained within the film gate

Fit the render gate so that it fully contains the film gate

Stretch the render gate to match the film gate

enum ufbx_aperture_format

Camera film/aperture size defaults

Handled internally by ufbx, ignore unless you interpret ufbx_props directly!

UFBX_APERTURE_FORMAT_CUSTOM

Use "FilmWidth" and "FilmHeight"

UFBX_APERTURE_FORMAT_16MM_THEATRICAL

0.404 x 0.295 inches

UFBX_APERTURE_FORMAT_SUPER_16MM

0.493 x 0.292 inches

UFBX_APERTURE_FORMAT_35MM_ACADEMY

0.864 x 0.630 inches

UFBX_APERTURE_FORMAT_35MM_TV_PROJECTION

0.816 x 0.612 inches

UFBX_APERTURE_FORMAT_35MM_FULL_APERTURE

0.980 x 0.735 inches

UFBX_APERTURE_FORMAT_35MM_185_PROJECTION

0.825 x 0.446 inches

UFBX_APERTURE_FORMAT_35MM_ANAMORPHIC

0.864 x 0.732 inches (squeeze ratio: 2)

UFBX_APERTURE_FORMAT_70MM_PROJECTION

2.066 x 0.906 inches

UFBX_APERTURE_FORMAT_VISTAVISION

1.485 x 0.991 inches

UFBX_APERTURE_FORMAT_DYNAVISION

2.080 x 1.480 inches

UFBX_APERTURE_FORMAT_IMAX

2.772 x 2.072 inches

UFBX_APERTURE_FORMAT_COUNT

struct ufbx_coordinate_axes

Coordinate axes the scene is represented in.

front is the opposite from forward!

struct ufbx_camera

Camera attached to a ufbx_node

Projection mode (perspective/orthographic).

If set to true, resolution represents actual pixel values, otherwise it's only useful for its aspect ratio.

Render resolution, either in pixels or arbitrary units, depending on above

Horizontal/vertical field of view in degrees Valid if projection_mode == UFBX_PROJECTION_MODE_PERSPECTIVE.

Component-wise tan(field_of_view_deg), also represents the size of the proection frustum slice at distance of 1. Valid if projection_mode == UFBX_PROJECTION_MODE_PERSPECTIVE.

Orthographic camera extents.

Valid if projection_mode == UFBX_PROJECTION_MODE_ORTHOGRAPHIC.

Orthographic camera size.

Valid if projection_mode == UFBX_PROJECTION_MODE_ORTHOGRAPHIC.

Size of the projection plane at distance 1.

Equal to field_of_view_tan if perspective, orthographic_size if orthographic.

Aspect ratio of the camera.

Near plane of the frustum in units from the camera.

Far plane of the frustum in units from the camera.

Coordinate system that the projection uses.

FBX saves cameras with +X forward and +Y up, but you can override this using ufbx_load_opts.target_camera_axes and it will be reflected here.

Focal length in millimeters

Film size in inches

Aperture/film gate size in inches

Anamoprhic stretch ratio

struct ufbx_bone

Bone attached to a ufbx_node, provides the logical length of the bone but most interesting information is directly in ufbx_node.

Visual radius of the bone

Length of the bone relative to the distance between two nodes

Is the bone a root bone

struct ufbx_empty

Empty/NULL/locator connected to a node, actual details in ufbx_node

struct ufbx_line_segment

Segment of a ufbx_line_curve, indices refer to ufbx_line_curve.point_indices[]

struct ufbx_line_curve

List of possible values the line passes through

Indices to control_points[] the line goes through

Tessellation (result)

enum ufbx_nurbs_topology

The endpoints are not connected.

Repeats first ufbx_nurbs_basis.order - 1 control points after the end.

Repeats the first control point after the end.

struct ufbx_nurbs_basis

NURBS basis functions for an axis

Number of control points influencing a point on the curve/surface.

Equal to the degree plus one.

Topology (periodicity) of the dimension.

Subdivision of the parameter range to control points.

Range for the parameter value.

Parameter values of control points.

true if this axis is two-dimensional.

Number of control points that need to be copied to the end.

This is just for convenience as it could be derived from topology and order. If for example num_wrap_control_points == 3 you should repeat the first 3 control points after the end.

You don't need to worry about this if you use ufbx functions like ufbx_evaluate_nurbs_curve() as they handle this internally.

true if the parametrization is well defined.

struct ufbx_nurbs_curve

Basis in the U axis

Linear array of control points

The control points are not homogeneous, meaning you have to multiply them by w before evaluating the surface.

struct ufbx_nurbs_surface

Basis in the U/V axes

Number of control points for the U/V axes

2D array of control points.

Memory layout: V * num_control_points_u + U

The control points are not homogeneous, meaning you have to multiply them by w before evaluating the surface.

How many segments tessellate each span in ufbx_nurbs_basis.spans.

If true the resulting normals should be flipped when evaluated.

Material for the whole surface.

May be NULL!

enum ufbx_marker_type

UFBX_MARKER_UNKNOWN

Unknown marker type

UFBX_MARKER_FK_EFFECTOR

FK (Forward Kinematics) effector

UFBX_MARKER_IK_EFFECTOR

IK (Inverse Kinematics) effector

UFBX_MARKER_TYPE_COUNT

struct ufbx_marker

Tracking marker for effectors

Type of the marker

enum ufbx_lod_display

LOD level display mode.

UFBX_LOD_DISPLAY_USE_LOD

Display the LOD level if the distance is appropriate.

UFBX_LOD_DISPLAY_SHOW

Always display the LOD level.

UFBX_LOD_DISPLAY_HIDE

Never display the LOD level.

UFBX_LOD_DISPLAY_COUNT

struct ufbx_lod_level

Single LOD level within an LOD group.

Specifies properties of the Nth child of the node containing the LOD group.

Minimum distance to show this LOD level.

In world units by default, or in screen percentage if ufbx_lod_group.relative_distances is set.

LOD display mode.

Mostly for editing, you should probably ignore this unless making a modeling program.

struct ufbx_lod_group

Group of LOD (Level of Detail) levels for an object.

The actual LOD models are defined in the parent ufbx_node.children.

If set to true, ufbx_lod_level.distance represents a screen size percentage.

LOD levels matching in order to ufbx_node.children.

If set to true don't account for parent transform when computing the distance.

If use_distance_limit is enabled hide the group if the distance is not between distance_limit_min and distance_limit_max.

enum ufbx_skinning_method

Method to evaluate the skinning on a per-vertex level

Linear blend skinning: Blend transformation matrices by vertex weights

One vertex should have only one bone attached

Convert the transformations to dual quaternions and blend in that space

Blend between UFBX_SKINNING_METHOD_LINEAR and UFBX_SKINNING_METHOD_BLENDED_DQ_LINEAR The blend weight can be found either per-vertex in ufbx_skin_vertex.dq_weight or in ufbx_skin_deformer.dq_vertices/dq_weights (indexed by vertex).

struct ufbx_skin_vertex

Skin weight information for a single mesh vertex

Index to start from in the weights[] array

Number of weights influencing the vertex

Blend weight between Linear Blend Skinning (0.0) and Dual Quaternion (1.0).

Should be used if skinning_method == UFBX_SKINNING_METHOD_BLENDED_DQ_LINEAR

struct ufbx_skin_weight

Single per-vertex per-cluster weight, see ufbx_skin_vertex

Amount this bone influence the vertex

struct ufbx_skin_deformer

Skin deformer specifies a binding between a logical set of bones (a skeleton) and a mesh. Each bone is represented by a ufbx_skin_cluster that contains the binding matrix and a ufbx_node *bone that has the current transformation.

union

Clusters (bones) in the skin

Per-vertex weight information

Largest amount of weights a single vertex can have

Blend weights between Linear Blend Skinning (0.0) and Dual Quaternion (1.0).

You probably want to use vertices and ufbx_skin_vertex.dq_weight instead!

These may be out-of-bounds for a given mesh, vertices is always safe.

struct ufbx_skin_cluster

Cluster of vertices bound to a single bone.

union

The bone node the cluster is attached to

Always valid if found from ufbx_skin_deformer.clusters[] unless ufbx_load_opts.connect_broken_elements is true.

Binding matrix from local mesh vertices to the bone

Binding matrix from local mesh node to the bone.

Prefer geometry_to_bone in most use cases!

Matrix that specifies the rest/bind pose transform of the node, not generally needed for skinning, use geometry_to_bone instead.

Precomputed matrix/transform that accounts for the current bone transform ie. ufbx_matrix_mul(&cluster->bone->node_to_world, &cluster->geometry_to_bone)

Number of vertices in the cluster

Per-vertex weight values

struct ufbx_blend_deformer

Blend shape deformer can contain multiple channels (think of sliders between morphs) that may optionally have in-between keyframes.

union

Independent morph targets of the deformer.

struct ufbx_blend_keyframe

Blend shape associated with a target weight in a series of morphs

The target blend shape offsets.

Weight value at which to apply the keyframe at full strength

The weight the shape should be currently applied with

struct ufbx_blend_channel

Blend channel consists of multiple morph-key targets that are interpolated.

In simple cases there will be only one keyframe that is the target shape.

union

Current weight of the channel

Key morph targets to blend between depending on weight In usual cases there's only one target per channel

Final blend shape ignoring any intermediate blend shapes.

struct ufbx_blend_shape

Blend shape target containing the actual vertex offsets

union

Number of vertex offsets in the following arrays

Always specified per-vertex offsets

Empty if not specified

enum ufbx_cache_interpretation

Known interpretations of geometry cache data.

Unknown interpretation, see ufbx_cache_channel.interpretation_name for more information.

Generic "points" interpretation, FBX SDK default. Usually fine to interpret as vertex positions if no other cache channels are specified.

Vertex positions.

Vertex normals.

struct ufbx_cache_frame

Name of the channel this frame belongs to.

Time of this frame in seconds.

Name of the file containing the data.

The specified file may contain multiple frames, use data_offset etc. to read at the right position.

Format of the wrapper file.

Axis to mirror the read data by.

Factor to scale the geometry by.

Format of the data in the file

Binary encoding of the data

Byte offset into the file

Number of data elements

Size of a single data element in bytes

Size of the whole data blob in bytes

struct ufbx_cache_channel

Name of the geometry cache channel.

What does the data in this channel represent.

Source name for interpretation, especially useful if interpretation is UFBX_CACHE_INTERPRETATION_UNKNOWN.

List of frames belonging to this channel.

Sorted by time (ufbx_cache_frame.time).

Axis to mirror the frames by.

Factor to scale the geometry by.

struct ufbx_cache_file

union

Filename relative to the currently loaded file.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file.

Relative filename specified in the file.

May be absolute if the file is saved in a different drive.

Filename relative to the loaded file, non-UTF-8 encoded.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file, non-UTF-8 encoded.

Relative filename specified in the file, non-UTF-8 encoded.

May be absolute if the file is saved in a different drive.

struct ufbx_material_map

Material property, either specified with a constant value or a mapped texture

union

Constant value or factor for the map.

May be specified simultaneously with a texture, in this case most shading models use multiplicative tinting of the texture values.

Texture if connected, otherwise NULL.

May be valid but "disabled" (application specific) if texture_enabled == false.

true if the file has specified any of the values above.

The value may be set to a non-zero default even if has_value == false, for example missing factors are set to 1.0 if a color is defined.

Controls whether shading should use texture.

Some shading models allow this to be true even if texture == NULL.

Set to true if this feature should be disabled (specific to shader type).

Number of components in the value from 1 to 4 if defined, 0 if not.

struct ufbx_material_feature_info

Material feature

Whether the material model uses this feature or not.

The feature can be enabled but still not used if eg. the corresponding factor is at zero!

Explicitly enabled/disabled by the material.

struct ufbx_material_texture

Texture attached to an FBX property

Name of the property in ufbx_material.props

Shader-specific property mapping name

Texture attached to the property.

enum ufbx_shader_type

Shading model type

Unknown shading model

FBX builtin diffuse material

FBX builtin diffuse+specular material

Open Shading Language standard surface https://github.com/Autodesk/standard-surface

Stingray ShaderFX shader graph.

Contains a serialized "ShaderGraph" in ufbx_props.

Variation of the FBX phong shader that can recover PBR properties like metalness or roughness from the FBX non-physical values.

Wavefront .mtl format shader (used by .obj files)

enum ufbx_material_pbr_map

Known PBR material properties, matches maps in ufbx_material_pbr_maps

UFBX_MATERIAL_PBR_BASE_FACTOR
UFBX_MATERIAL_PBR_BASE_COLOR
UFBX_MATERIAL_PBR_ROUGHNESS
UFBX_MATERIAL_PBR_METALNESS
UFBX_MATERIAL_PBR_DIFFUSE_ROUGHNESS
UFBX_MATERIAL_PBR_SPECULAR_FACTOR
UFBX_MATERIAL_PBR_SPECULAR_COLOR
UFBX_MATERIAL_PBR_SPECULAR_IOR
UFBX_MATERIAL_PBR_SPECULAR_ANISOTROPY
UFBX_MATERIAL_PBR_SPECULAR_ROTATION
UFBX_MATERIAL_PBR_TRANSMISSION_FACTOR
UFBX_MATERIAL_PBR_TRANSMISSION_COLOR
UFBX_MATERIAL_PBR_TRANSMISSION_DEPTH
UFBX_MATERIAL_PBR_TRANSMISSION_SCATTER
UFBX_MATERIAL_PBR_TRANSMISSION_SCATTER_ANISOTROPY
UFBX_MATERIAL_PBR_TRANSMISSION_DISPERSION
UFBX_MATERIAL_PBR_TRANSMISSION_ROUGHNESS
UFBX_MATERIAL_PBR_TRANSMISSION_EXTRA_ROUGHNESS
UFBX_MATERIAL_PBR_TRANSMISSION_PRIORITY
UFBX_MATERIAL_PBR_TRANSMISSION_ENABLE_IN_AOV
UFBX_MATERIAL_PBR_SUBSURFACE_FACTOR
UFBX_MATERIAL_PBR_SUBSURFACE_COLOR
UFBX_MATERIAL_PBR_SUBSURFACE_RADIUS
UFBX_MATERIAL_PBR_SUBSURFACE_SCALE
UFBX_MATERIAL_PBR_SUBSURFACE_ANISOTROPY
UFBX_MATERIAL_PBR_SUBSURFACE_TINT_COLOR
UFBX_MATERIAL_PBR_SUBSURFACE_TYPE
UFBX_MATERIAL_PBR_SHEEN_FACTOR
UFBX_MATERIAL_PBR_SHEEN_COLOR
UFBX_MATERIAL_PBR_SHEEN_ROUGHNESS
UFBX_MATERIAL_PBR_COAT_FACTOR
UFBX_MATERIAL_PBR_COAT_COLOR
UFBX_MATERIAL_PBR_COAT_ROUGHNESS
UFBX_MATERIAL_PBR_COAT_IOR
UFBX_MATERIAL_PBR_COAT_ANISOTROPY
UFBX_MATERIAL_PBR_COAT_ROTATION
UFBX_MATERIAL_PBR_COAT_NORMAL
UFBX_MATERIAL_PBR_COAT_AFFECT_BASE_COLOR
UFBX_MATERIAL_PBR_COAT_AFFECT_BASE_ROUGHNESS
UFBX_MATERIAL_PBR_THIN_FILM_THICKNESS
UFBX_MATERIAL_PBR_THIN_FILM_IOR
UFBX_MATERIAL_PBR_EMISSION_FACTOR
UFBX_MATERIAL_PBR_EMISSION_COLOR
UFBX_MATERIAL_PBR_OPACITY
UFBX_MATERIAL_PBR_INDIRECT_DIFFUSE
UFBX_MATERIAL_PBR_INDIRECT_SPECULAR
UFBX_MATERIAL_PBR_NORMAL_MAP
UFBX_MATERIAL_PBR_TANGENT_MAP
UFBX_MATERIAL_PBR_DISPLACEMENT_MAP
UFBX_MATERIAL_PBR_MATTE_FACTOR
UFBX_MATERIAL_PBR_MATTE_COLOR
UFBX_MATERIAL_PBR_AMBIENT_OCCLUSION
UFBX_MATERIAL_PBR_GLOSSINESS
UFBX_MATERIAL_PBR_COAT_GLOSSINESS
UFBX_MATERIAL_PBR_TRANSMISSION_GLOSSINESS
UFBX_MATERIAL_PBR_MAP_COUNT

struct ufbx_material_pbr_maps

union
struct

struct ufbx_material

Surface material properties such as color, roughness, etc. Each property may be optionally bound to an ufbx_texture.

union

FBX builtin properties

These may be empty if the material is using a custom shader

PBR material properties, defined for all shading models but may be somewhat approximate if shader == NULL.

Material features, primarily applies to pbr.

Always defined

Optional extended shader information

Often one of { "lambert", "phong", "unknown" }

Prefix before shader property names with trailing |.

For example "3dsMax|Parameters|" where properties would have names like "3dsMax|Parameters|base_color". You can ignore this if you use the built-in ufbx_material_fbx_maps fbx and ufbx_material_pbr_maps pbr structures.

Sorted by material_prop

enum ufbx_texture_type

Texture associated with an image file/sequence. texture->filename and and texture->relative_filename contain the texture's path. If the file has embedded content texture->content may hold texture->content_size bytes of raw image data.

The texture consists of multiple texture layers blended together.

Reserved as these should exist in FBX files.

Node in a shader graph.

Use ufbx_texture.shader for more information.

enum ufbx_blend_mode

Blend modes to combine layered textures with, compatible with common blend mode definitions in many art programs. Simpler blend modes have equations specified below where src is the layer to composite over dst. See eg. https://www.w3.org/TR/2013/WD-compositing-1-20131010/#blendingseparable

UFBX_BLEND_TRANSLUCENT

src effects result alpha

UFBX_BLEND_ADDITIVE

src + dst

UFBX_BLEND_MULTIPLY

src * dst

UFBX_BLEND_MULTIPLY_2X

2 * src * dst

UFBX_BLEND_OVER

src * src_alpha + dst * (1-src_alpha)

UFBX_BLEND_REPLACE

src Replace the contents

UFBX_BLEND_DISSOLVE

random() + src_alpha >= 1.0 ? src : dst

UFBX_BLEND_DARKEN

min(src, dst)

UFBX_BLEND_COLOR_BURN

src > 0 ? 1 - min(1, (1-dst) / src) : 0

UFBX_BLEND_LINEAR_BURN

src + dst - 1

UFBX_BLEND_DARKER_COLOR

value(src) < value(dst) ? src : dst

UFBX_BLEND_LIGHTEN

max(src, dst)

UFBX_BLEND_SCREEN

1 - (1-src)*(1-dst)

UFBX_BLEND_COLOR_DODGE

src < 1 ? dst / (1 - src) : (dst>0?1:0)`

UFBX_BLEND_LINEAR_DODGE

src + dst

UFBX_BLEND_LIGHTER_COLOR

value(src) > value(dst) ? src : dst

UFBX_BLEND_SOFT_LIGHT
UFBX_BLEND_HARD_LIGHT
UFBX_BLEND_VIVID_LIGHT

Combination of COLOR_DODGE and COLOR_BURN

UFBX_BLEND_LINEAR_LIGHT

Combination of LINEAR_DODGE and LINEAR_BURN

UFBX_BLEND_PIN_LIGHT

Combination of DARKEN and LIGHTEN

UFBX_BLEND_HARD_MIX

Produces primary colors depending on similarity

UFBX_BLEND_DIFFERENCE

abs(src - dst)

UFBX_BLEND_EXCLUSION

dst + src - 2 * src * dst

UFBX_BLEND_SUBTRACT

dst - src

UFBX_BLEND_DIVIDE

dst / src

UFBX_BLEND_HUE

Replace hue

UFBX_BLEND_SATURATION

Replace saturation

UFBX_BLEND_COLOR

Replace hue and saturatio

UFBX_BLEND_LUMINOSITY

Replace value

UFBX_BLEND_OVERLAY

Same as HARD_LIGHT but with src and dst swapped

UFBX_BLEND_MODE_COUNT

enum ufbx_wrap_mode

Blend modes to combine layered textures with, compatible with common blend

UFBX_WRAP_REPEAT

Repeat the texture past the [0,1] range

UFBX_WRAP_CLAMP

Clamp the normalized texture coordinates to [0,1]

UFBX_WRAP_MODE_COUNT

struct ufbx_texture_layer

Single layer in a layered texture

The inner texture to evaluate, never NULL

Equation to combine the layer to the background

Blend weight of this layer

struct ufbx_shader_texture_input

Input to a shader texture, see ufbx_shader_texture.

Name of the input.

union

Constant value of the input.

Texture connected to this input.

Index of the output to use if texture is a multi-output shader node.

Controls whether shading should use texture.

Some shading models allow this to be true even if texture == NULL.

Property representing this input.

Property representing texture.

Property representing texture_enabled.

struct ufbx_shader_texture

Texture that emulates a shader graph node.

3ds Max exports some materials as node graphs serialized to textures. ufbx can parse a small subset of these, as normal maps are often hidden behind some kind of bump node.

These encode a lot of details of 3ds Max internals, not recommended for direct use.

ufbx_texture.file_textures[] contains a list of "real" textures that are connected to the ufbx_texture that is pretending to be a shader node.

Type of this shader node.

Name of the shader to use.

64-bit opaque identifier for the shader type.

Input values/textures (possibly further shader textures) to the shader.

Shader source code if found.

Representative texture for this shader.

Only specified if main_texture.outputs[main_texture_output_index] is semantically equivalent to this texture.

Output index of main_texture if it is a multi-output shader.

Prefix for properties related to this shader in ufbx_texture.

Contains the trailing '|' if not empty.

struct ufbx_texture_file

Unique texture within the file.

Filename relative to the currently loaded file.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file.

Relative filename specified in the file.

May be absolute if the file is saved in a different drive.

Filename relative to the loaded file, non-UTF-8 encoded.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file, non-UTF-8 encoded.

Relative filename specified in the file, non-UTF-8 encoded.

May be absolute if the file is saved in a different drive.

Optional embedded content blob, eg. raw .png format data

struct ufbx_texture

Texture that controls material appearance

union

Texture type (file / layered / procedural / shader)

Filename relative to the currently loaded file.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file.

Relative filename specified in the file.

May be absolute if the file is saved in a different drive.

Filename relative to the loaded file, non-UTF-8 encoded.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file, non-UTF-8 encoded.

Relative filename specified in the file, non-UTF-8 encoded.

May be absolute if the file is saved in a different drive.

FILE: Optional embedded content blob, eg. raw .png format data

FILE: Optional video texture

FILE: Index into ufbx_scene.texture_files[] or UFBX_NO_INDEX.

FILE: True if file_index has a valid value.

LAYERED: Inner texture layers, ordered from bottom to top

SHADER: Shader information

May be specified even if type == UFBX_TEXTURE_FILE if ufbx_load_opts.disable_quirks is not specified. Some known shaders that represent files are interpreted as UFBX_TEXTURE_FILE.

List of file textures representing this texture.

Defined even if type == UFBX_TEXTURE_FILE in which case the array contains only itself.

Name of the UV set to use

Has a non-identity transform and derived matrices.

Texture transformation in UV space

Matrix representation of transform

UV coordinate to normalized texture coordinate matrix

struct ufbx_video

union

Filename relative to the currently loaded file.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file.

Relative filename specified in the file.

May be absolute if the file is saved in a different drive.

Filename relative to the loaded file, non-UTF-8 encoded.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file, non-UTF-8 encoded.

Relative filename specified in the file, non-UTF-8 encoded.

May be absolute if the file is saved in a different drive.

Optional embedded content blob

struct ufbx_shader

Shader specifies a shading model and contains ufbx_shader_binding elements that define how to interpret FBX properties in the shader.

union

Known shading model

Bindings from FBX properties to the shader

ufbx_find_shader_prop() translates shader properties to FBX properties

struct ufbx_shader_prop_binding

Binding from a material property to shader implementation

Property name used by the shader implementation

Property name inside ufbx_material.props

struct ufbx_shader_binding

Shader binding table

union

struct ufbx_anim

Animation descriptor used for evaluating animation.

Usually obtained from ufbx_scene via either global animation ufbx_scene.anim, per-stack animation ufbx_anim_stack.anim or per-layer animation ufbx_anim_layer.anim.

For advanced usage you can use ufbx_create_anim() to create animation descriptors with custom layers, property overrides, special flags, etc.

Time begin/end for the animation, both may be zero if absent.

List of layers in the animation.

Optional overrides for weights for each layer in layers[].

Sorted by element_id, prop_name

Evaluate connected properties as if they would not be connected.

Custom ufbx_anim created by ufbx_create_anim().

enum ufbx_interpolation

Animation curve segment interpolation mode between two keyframes

UFBX_INTERPOLATION_CONSTANT_PREV

Hold previous key value

UFBX_INTERPOLATION_CONSTANT_NEXT

Hold next key value

UFBX_INTERPOLATION_LINEAR

Linear interpolation between two keys

UFBX_INTERPOLATION_CUBIC

Cubic interpolation, see ufbx_tangent

UFBX_INTERPOLATION_COUNT

struct ufbx_tangent

Tangent vector at a keyframe, may be split into left/right

Derivative in the time axis

Derivative in the (curve specific) value axis

struct ufbx_keyframe

Single real value at a specified time, interpolation between two keyframes is determined by the interpolation field of the previous key. If interpolation == UFBX_INTERPOLATION_CUBIC the span is evaluated as a cubic bezier curve through the following points:

(prev->time, prev->value)
(prev->time + prev->right.dx, prev->value + prev->right.dy)
(next->time - next->left.dx, next->value - next->left.dy)
(next->time, next->value)

You can use ufbx_evaluate_curve(ufbx_anim_curve *curve, double time) rather than trying to manually handle all the interpolation modes.

struct ufbx_display_layer

Collection of nodes to hide/freeze

union

Nodes included in the layer (exclusively at most one layer per node)

Contained nodes are visible

Contained nodes cannot be edited

Visual color for UI

struct ufbx_selection_set

Named set of nodes/geometry features to select.

union

Included nodes and geometry features

struct ufbx_selection_node

Selection state of a node, potentially contains vertex/edge/face selection as well.

union

Selection targets, possibly NULL

Is target_node included in the selection

struct ufbx_character

union

enum ufbx_constraint_type

Type of property constrain eg. position or look-at

struct ufbx_constraint_target

Target to follow with a constraint

Target node reference

Relative weight to other targets (does not always sum to 1)

Offset from the actual target

enum ufbx_constraint_aim_up_type

Method to determine the up vector in aim constraints

struct ufbx_constraint

union

Type of constraint to use

Node to be constrained

List of weighted targets for the constraint (pole vectors for IK)

State of the constraint

Translation/rotation/scale axes the constraint is applied to

Offset from the constrained position

SINGLE_CHAIN_IK: Target for the IK, targets contains pole vectors!

struct ufbx_audio_layer

union

Clips contained in this layer.

struct ufbx_audio_clip

union

Filename relative to the currently loaded file.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file.

Relative filename specified in the file.

May be absolute if the file is saved in a different drive.

Filename relative to the loaded file, non-UTF-8 encoded.

If using functions other than ufbx_load_file(), you can provide ufbx_load_opts.filename/raw_filename to let ufbx resolve this.

Absolute filename specified in the file, non-UTF-8 encoded.

Relative filename specified in the file, non-UTF-8 encoded.

May be absolute if the file is saved in a different drive.

Optional embedded content blob, eg. raw .png format data

struct ufbx_bone_pose

Node to apply the pose to.

Matrix from node local space to world space.

Matrix from node local space to parent space.

FBX only stores world transformations so this is approximated from the parent world transform.

struct ufbx_pose

union

Set if this pose is marked as a bind pose.

List of bone poses.

Sorted by ufbx_node.typed_id.

struct ufbx_metadata_object

union

enum ufbx_file_format

UFBX_FILE_FORMAT_UNKNOWN

Unknown file format

UFBX_FILE_FORMAT_FBX

.fbx Kaydara/Autodesk FBX file

UFBX_FILE_FORMAT_OBJ

.obj Wavefront OBJ file

UFBX_FILE_FORMAT_MTL

.mtl Wavefront MTL (Material template library) file

UFBX_FILE_FORMAT_COUNT

enum ufbx_warning_type

Missing external file file (for example .mtl for Wavefront .obj file or a geometry cache)

Loaded a Wavefront .mtl file derived from the filename instead of a proper mtllib statement.

Truncated array has been auto-expanded.

Geometry data has been defined but has no data.

Duplicated connection between two elements that shouldn't have.

Vertex 'W' attribute length differs from main attribute.

Missing polygon mapping type.

Out-of-bounds index has been clamped to be in-bounds.

You can use ufbx_index_error_handling to adjust behavior.

Non-UTF8 encoded strings.

You can use ufbx_unicode_error_handling to adjust behavior.

Non-node element connected to root.

Duplicated object ID in the file, connections will be wrong.

Empty face has been removed.

Use ufbx_load_opts.allow_empty_faces if you want to allow them.

Unknown .obj file directive.

Warnings after this one are deduplicated.

See ufbx_warning.count for how many times they happened.

struct ufbx_warning

Warning about a non-fatal issue in the file.

Often contains information about issues that ufbx has corrected about the file but it might indicate something is not working properly.

Type of the warning.

Description of the warning.

The element related to this warning or UFBX_NO_INDEX if not related to a specific element.

Number of times this warning was encountered.

enum ufbx_thumbnail_format

UFBX_THUMBNAIL_FORMAT_UNKNOWN

Unknown format

UFBX_THUMBNAIL_FORMAT_RGB_24

8-bit RGB pixels, in memory R,G,B

UFBX_THUMBNAIL_FORMAT_RGBA_32

8-bit RGBA pixels, in memory R,G,B,A

UFBX_THUMBNAIL_FORMAT_COUNT

enum ufbx_space_conversion

Specify how unit / coordinate system conversion should be performed.

Affects how ufbx_load_opts.target_axes and ufbx_load_opts.target_unit_meters work, has no effect if neither is specified.

Store the space conversion transform in the root node.

Sets ufbx_node.local_transform of the root node.

Perform the conversion by using "adjust" transforms.

Compensates for the transforms using ufbx_node.adjust_pre_rotation and ufbx_node.adjust_pre_scale. You don't need to account for these unless you are manually building transforms from ufbx_props.

Perform the conversion by scaling geometry in addition to adjusting transforms.

Compensates transforms like UFBX_SPACE_CONVERSION_ADJUST_TRANSFORMS but applies scaling to geometry as well.

struct ufbx_thumbnail

Embedded thumbnail in the file, valid if the dimensions are non-zero.

Extents of the thumbnail

Thumbnail pixel data, layout as contiguous rows from bottom to top.

See ufbx_thumbnail.format for the pixel format.

struct ufbx_metadata

Miscellaneous data related to the loaded file

List of non-fatal warnings about the file.

If you need to only check whether a specific warning was triggered you can use ufbx_metadata.has_warning[].

FBX ASCII file format.

FBX version in integer format, eg. 7400 for 7.4.

File format of the source file.

Index arrays may contain UFBX_NO_INDEX instead of a valid index to indicate gaps.

May contain meshes with no defined vertex position.

ufbx_mesh.vertex_position.exists may be false!

Arrays may contain items with NULL element references.

Some API guarantees do not apply (depending on unsafe options used).

Loaded with ufbx_load_opts.allow_unsafe enabled.

Flag for each possible warning type.

See ufbx_metadata.warnings[] for detailed warning information.

One second in internal KTime units

Space conversion method used on the scene.

Transform that has been applied to root for axis/unit conversion.

Axis that the scene has been mirrored by.

All geometry has been mirrored in this axis.

Amount geometry has been scaled.

struct ufbx_scene_settings

Global settings: Axes and time/unit scales

Mapping of X/Y/Z axes to world-space directions.

Use ufbx_load_opts.target_axes to normalize this.

This contains the original axes even if you supply ufbx_load_opts.target_axes.

How many meters does a single world-space unit represent.

FBX files usually default to centimeters, reported as 0.01 here.

Use ufbx_load_opts.target_unit_meters to normalize this.

Frames per second the animation is defined at.

Animation user interface settings.

Use ufbx_scene_settings.frames_per_second instead of interpreting these yourself.

struct ufbx_scene

Global settings

Node instances in the scene

Default animation descriptor

union
struct

Unique texture files referenced by the scene.

Sorted by id

Sorted by src,src_prop

Sorted by dst,dst_prop

Elements sorted by name, type

enum ufbx_topo_flags

UFBX_TOPO_NON_MANIFOLD

Edge with three or more faces

struct ufbx_topo_edge

Starting index of the edge, always defined

Ending index of the edge / next per-face ufbx_topo_edge, always defined

Previous per-face ufbx_topo_edge, always defined

ufbx_topo_edge on the opposite side, UFBX_NO_INDEX if not found

Index into mesh->faces[], always defined

Index into mesh->edges[], UFBX_NO_INDEX if not found

struct ufbx_vertex_stream

Vertex data array for ufbx_generate_indices().

ufbx_generate_indices() compares the vertices using memcmp(), so any padding should be cleared to zero.

Data pointer of shape char[vertex_count][vertex_size].

Number of vertices in this stream, for sanity checking.

Size of a vertex in bytes.

 

Allocate size bytes, must be at least 8 byte aligned

Reallocate old_ptr from old_size to new_size

If omit alloc_fn and free_fn they will be translated to:

`alloc(size)` -> `realloc_fn(user, NULL, 0, size)`
`free_fn(ptr, size)` ->  `realloc_fn(user, ptr, size, 0)`

Free pointer ptr (of size bytes) returned by alloc_fn or realloc_fn

Free the allocator itself

struct ufbx_allocator

Allocator callbacks and user context

The allocator will be stored to the loaded scene and will be called again from ufbx_free_scene() so make sure user outlives that! You can use free_allocator_fn() to free the allocator yourself.

Callback functions, see typedefs above for information

struct ufbx_allocator_opts

Allocator callbacks

Maximum number of bytes to allocate before failing

Maximum number of allocations to attempt before failing

Threshold to swap from batched allocations to individual ones Defaults to 1MB if set to zero

If set to 1 ufbx will allocate everything in the smallest possible chunks which may be useful for debugging (eg. ASAN)

Maximum size of a single allocation containing sub-allocations.

Defaults to 16MB if set to zero The maximum amount of wasted memory depends on max_chunk_size and huge_threshold: each chunk can waste up to huge_threshold bytes internally and the last chunk might be incomplete. So for example with the defaults we can waste around 1MB/16MB = 6.25% overall plus up to 32MB due to the two incomplete blocks. The actual amounts differ slightly as the chunks start out at 4kB and double in size each time, meaning that the maximum fixed overhead (up to 32MB with defaults) is at most ~30% of the total allocation size.

 

Try to read up to size bytes to data, return the amount of read bytes.

Return SIZE_MAX to indicate an IO error.

Skip size bytes in the file.

Get the size of the file.

Return 0 if unknown, UINT64_MAX if error.

Close the file

struct ufbx_stream

Required

Optional: Will use read_fn() if missing

Optional

Optional

Context passed to other functions

enum ufbx_open_file_type

UFBX_OPEN_FILE_MAIN_MODEL

Main model file

UFBX_OPEN_FILE_GEOMETRY_CACHE

Unknown geometry cache file

UFBX_OPEN_FILE_OBJ_MTL

.mtl material library file

UFBX_OPEN_FILE_TYPE_COUNT

 

struct ufbx_open_file_info

Context that can be passed to the following functions to use a shared allocator:

Kind of file to load.

Original filename in the file, not resolved or UTF-8 encoded.

Not necessarily NULL-terminated!

 

Callback for opening an external file from the filesystem

struct ufbx_open_file_opts

Options for ufbx_open_file().

Allocator to allocate the memory with.

The filename is guaranteed to be NULL-terminated.

 

Memory stream options

struct ufbx_open_memory_opts

Options for ufbx_open_memory().

Allocator to allocate the memory with.

Used even if no copy is made to allocate a small metadata block.

Do not copy the memory.

You can use close_cb to free the memory when the stream is closed.

This means the provided data pointer is referenced after creating the memory stream, make sure the data stays valid until the stream is closed!

Callback to free the memory blob.

struct ufbx_error_frame

Detailed error stack frame

enum ufbx_error_type

Error causes (and UFBX_ERROR_NONE for no error).

No error, operation has been performed successfully.

Unspecified error, most likely caused by an invalid FBX file or a file that contains something ufbx can't handle.

File not found.

Empty file.

External file not found.

See ufbx_load_opts.load_external_files for more information.

Out of memory (allocator returned NULL).

File ended abruptly.

IO read error.

eg. returning SIZE_MAX from ufbx_stream.read_fn or stdio ferror() condition.

User cancelled the loading via ufbx_load_opts.progress_cb returning UFBX_PROGRESS_CANCEL.

Could not detect file format from file data or filename.

You can supply it manually using ufbx_load_opts.file_format or use ufbx_load_opts.filename when using ufbx_load_memory() to let ufbx guess the format from the extension.

Options struct (eg. ufbx_load_opts) is not cleared to zero.

Make sure you initialize the structure to zero via eg.

ufbx_load_opts opts = { 0 }; // C
ufbx_load_opts opts = { }; // C++

The vertex streams in ufbx_generate_indices() are empty.

Vertex stream passed to ufbx_generate_indices().

Invalid UTF-8 encountered in a file when loading with UFBX_UNICODE_ERROR_HANDLING_ABORT_LOADING.

Feature needed for the operation has been compiled out.

Attempting to tessellate an invalid NURBS object.

Out of bounds index in the file when loading with UFBX_INDEX_ERROR_HANDLING_ABORT_LOADING.

Node is deeper than ufbx_load_opts.node_depth_limit in the hierarchy.

Error parsing ASCII array in a thread.

Threaded ASCII parsing is slightly more strict than non-threaded, for cursed files, set ufbx_load_opts.force_single_thread_ascii_parsing to true.

Unsafe options specified without enabling ufbx_load_opts.allow_unsafe.

Duplicated override property in ufbx_create_anim()

struct ufbx_error

Error description with detailed stack trace

You can use ufbx_format_error() for formatting the error

struct ufbx_progress

 

Called periodically with the current progress Return false to cancel further processing

 

struct ufbx_inflate_input

Source data/stream to decompress with ufbx_inflate()

Total size of the data in bytes

(optional) Initial or complete data chunk

(optional) Temporary buffer, defaults to 256b stack buffer

(optional) Streaming read function, concatenated after data

(optional) Progress reporting

Bytes between progress report calls

(optional) Change the progress scope

(optional) No the DEFLATE header

(optional) No the Adler32 checksum

(optional) Force internal fast lookup bit amount

struct ufbx_inflate_retain

Persistent data between ufbx_inflate() calls

You must set initialized to false, but data may be uninitialized

enum ufbx_index_error_handling

Clamp to a valid value.

Set bad indices to UFBX_NO_INDEX.

This is the recommended way if you need to deal with files with gaps in information.

If you use this ufbx_get_vertex_TYPE() functions will return zero on invalid indices instead of failing.

Fail loading entierely when encountering a bad index.

Pass bad indices through as-is.

Requires ufbx_load_opts.allow_unsafe. UNSAFE: Breaks any API guarantees regarding indexes being in bounds and makes ufbx_get_vertex_TYPE() memory-unsafe to use.

enum ufbx_unicode_error_handling

Replace errors with U+FFFD "Replacement Character"

Replace errors with '_' U+5F "Low Line"

Replace errors with '?' U+3F "Question Mark"

Remove errors from the output

Fail loading on encountering an Unicode error

Ignore and pass-through non-UTF-8 string data.

Requires ufbx_load_opts.allow_unsafe. UNSAFE: Breaks API guarantee that ufbx_string is UTF-8 encoded.

enum ufbx_geometry_transform_handling

How to handle FBX node geometry transforms.

FBX nodes can have "geometry transforms" that affect only the attached meshes, but not the children. This is not allowed in many scene representations so ufbx provides some ways to simplify them. Geometry transforms can also be used to transform any other attributes such as lights or cameras.

Preserve the geometry transforms as-is.

To be correct for all files you have to use ufbx_node.geometry_transform, ufbx_node.geometry_to_node, or ufbx_node.geometry_to_world to compensate for any potential geometry transforms.

Add helper nodes between the nodes and geometry where needed.

Modify the geometry of meshes attached to nodes with geometry transforms.

Will add helper nodes like UFBX_GEOMETRY_TRANSFORM_HANDLING_HELPER_NODES if necessary, for example if there are multiple instances of the same mesh with geometry transforms.

Modify the geometry of meshes attached to nodes with geometry transforms.

This will not work correctly for instanced geometry.

enum ufbx_inherit_mode_handling

How to handle FBX transform inherit modes.

Preserve inherit mode in ufbx_node.inherit_mode.

To correctly handle all scenes you would need to handle the non-standard inherit modes.

Create scale helper nodes parented to nodes that need special inheritance.

Scale helper nodes will have ufbx_node.is_scale_helper and parents of scale helpers will have ufbx_node.scale_helper pointing to it.

Attempt to compensate for bone scale by inversely scaling children.

This only works for uniform non-animated scaling, if scale is non-uniform or animated, ufbx will add scale helpers in the same way as UFBX_INHERIT_MODE_HANDLING_HELPER_NODES.

Attempt to compensate for bone scale by inversely scaling children.

Will never create helper nodes.

Ignore non-standard inheritance modes.

Forces all nodes to have UFBX_INHERIT_MODE_NORMAL regardless of the inherit mode specified in the file. This can be useful for emulating results from importers/programs that don't support inherit modes.

enum ufbx_pivot_handling

How to handle FBX transform pivots.

Take pivots into account when computing the transform.

Translate objects to be located at their pivot.

Only applied if rotation and scaling pivots are equal.

Results in geometric translation. Use ufbx_geometry_transform_handling to interpret these in a standard scene graph.

enum ufbx_baked_key_flags

This keyframe represents a constant step from the left side

This keyframe represents a constant step from the right side

This keyframe is the main part of a step Bordering either UFBX_BAKED_KEY_STEP_LEFT or UFBX_BAKED_KEY_STEP_RIGHT.

This keyframe is a real keyframe in the source animation

This keyframe has been reduced by maximum sample rate.

struct ufbx_baked_vec3

Time of the keyframe, in seconds

Value at time, can be linearly interpolated

Additional information about the keyframe

struct ufbx_baked_quat

Time of the keyframe, in seconds

Value at time, can be (spherically) linearly interpolated

Additional information about the keyframe

struct ufbx_baked_node

Baked transform animation for a single node.

Typed ID of the node, maps to ufbx_scene.nodes[].

Element ID of the element, maps to ufbx_scene.elements[].

The translation channel has constant values for the whole animation.

The rotation channel has constant values for the whole animation.

The scale channel has constant values for the whole animation.

Translation keys for the animation, maps to ufbx_node.local_transform.translation.

Rotation keyframes, maps to ufbx_node.local_transform.rotation.

Scale keyframes, maps to ufbx_node.local_transform.scale.

struct ufbx_baked_prop

Baked property animation.

Name of the property, eg. "Visibility".

The value of the property is constant for the whole animation.

Property value keys.

struct ufbx_baked_element

Baked property animation for a single element.

Element ID of the element, maps to ufbx_scene.elements[].

List of properties the animation modifies.

struct ufbx_baked_anim_metadata

Memory statistics

struct ufbx_baked_anim

Animation baked into linearly interpolated keyframes.

Nodes that are modified by the animation.

Some nodes may be missing if the specified animation does not transform them. Conversely, some non-obviously animated nodes may be included as exporters often may add dummy keyframes for objects.

Element properties modified by the animation.

Playback time range for the animation.

Keyframe time range.

Additional bake information.

 

 

struct ufbx_load_opts

Options for ufbx_load_file/memory/stream/stdio()

Initialize to zero with { 0 } (C) or { } (C++)

Allocator used during loading

Allocator used for the final scene

Threading options

Do not load geometry datsa (vertices, indices, etc)

Do not load animation curves

Do not load embedded content

Do not load any content (geometry, animation, embedded)

Evaluate skinning (see ufbx_mesh.skinned_vertices)

Evaluate vertex caches (see ufbx_mesh.skinned_vertices)

Try to open external files referenced by the main file automatically.

Applies to geometry caches and .mtl files for OBJ.

This may be risky for untrusted data as the input files may contain references to arbitrary paths in the filesystem.

This only applies to files implicitly referenced by the scene, if you request additional files via eg. ufbx_load_opts.obj_mtl_path they are still loaded.

Will fail loading if any external files are not found by default, use ufbx_load_opts.ignore_missing_external_files to suppress this, in this case you can find the errors at ufbx_metadata.warnings[] as UFBX_WARNING_MISSING_EXTERNAL_FILE.

Don't fail loading if external files are not found.

Don't compute ufbx_skin_deformer vertices and weights arrays saving a bit of memory and time if not needed

Clean-up skin weights by removing negative, zero and NAN weights.

Read Blender materials as PBR values.

Blender converts PBR materials to legacy FBX Phong materials in a deterministic way. If this setting is enabled, such materials will be read as UFBX_SHADER_BLENDER_PHONG, which means ufbx will be able to parse roughness and metallic textures.

Don't adjust reading the FBX file depending on the detected exporter

Don't allow partially broken FBX files to load

Force ASCII parsing to use a single thread.

The multi-threaded ASCII parsing is slightly more lenient as it ignores the self-reported size of ASCII arrays, that threaded parsing depends on.

UNSAFE: If enabled allows using unsafe options that may fundamentally break the API guarantees.

Specify how to handle broken indices.

Connect related elements even if they are broken. If false (default) ufbx_skin_cluster with a missing bone field are not included in the ufbx_skin_deformer.clusters[] array for example.

Allow nodes that are not connected in any way to the root. Conversely if disabled, all lone nodes will be parented under ufbx_scene.root_node.

Allow meshes with no vertex position attribute.

If this is set ufbx_mesh.vertex_position.exists may be false.

Allow faces with zero indices.

Generate vertex normals for a meshes that are missing normals.

You can see if the normals have been generated from ufbx_mesh.generated_normals.

Ignore open_file_cb when loading the main file.

Path separator character, defaults to '' on Windows and '/' otherwise.

Maximum depth of the node hirerachy.

Will fail with UFBX_ERROR_NODE_DEPTH_LIMIT if a node is deeper than this limit.

The default of 0 allows arbitrarily deep hierarchies. Be careful if using recursive algorithms without setting this limit.

Estimated file size for progress reporting

Buffer size in bytes to use for reading from files or IO callbacks

Filename to use as a base for relative file paths if not specified using ufbx_load_file(). Use length = SIZE_MAX for NULL-terminated strings. raw_filename will be derived from this if empty.

Raw non-UTF8 filename. Does not support NULL termination.

filename will be derived from this if empty.

Progress reporting

Bytes between progress report calls

External file callbacks (defaults to stdio.h)

How to handle geometry transforms in the nodes.

See ufbx_geometry_transform_handling for an explanation.

How to handle unconventional transform inherit modes.

See ufbx_inherit_mode_handling for an explanation.

How to handle pivots.

See ufbx_pivot_handling for an explanation.

How to perform space conversion by target_axes and target_unit_meters.

See ufbx_space_conversion for an explanation.

Axis used to mirror for conversion between left-handed and right-handed coordinates.

Do not change winding of faces when converting handedness.

Reverse winding of all faces.

If handedness_conversion_retain_winding is not specified, mirrored meshes will retain their original winding.

Apply an implicit root transformation to match axes.

Used if ufbx_coordinate_axes_valid(target_axes).

Scale the scene so that one world-space unit is target_unit_meters meters.

By default units are not scaled.

Target space for camera.

By default FBX cameras point towards the positive X axis. Used if ufbx_coordinate_axes_valid(target_camera_axes).

Target space for directed lights.

By default FBX lights point towards the negative Y axis. Used if ufbx_coordinate_axes_valid(target_light_axes).

Name for dummy geometry transform helper nodes.

Name for dummy scale helper nodes.

Normalize vertex normals.

Normalize tangents and bitangents.

Override for the root transform

Animation keyframe clamp threhsold, only applies to specific interpolation modes.

Specify how to handle Unicode errors in strings.

Retain the 'W' component of mesh normal/tangent/bitangent.

Retain the raw document structure using ufbx_dom_node.

Force a specific file format instead of detecting it.

How far to read into the file to determine the file format.

Default: 16kB

Do not attempt to detect file format from file content.

Do not attempt to detect file format from filename extension.

ufbx primarily detects file format from the file header, this is just used as a fallback.

(.obj) Try to find .mtl file with matching filename as the .obj file.

Used if the file specified mtllib line is not found, eg. for a file called model.obj that contains the line usemtl materials.mtl, ufbx would first try to open materials.mtl and if that fails it tries to open model.mtl.

(.obj) Don't split geometry into meshes by object.

(.obj) Don't split geometry into meshes by groups.

(.obj) Force splitting groups even on object boundaries.

(.obj) Path to the .mtl file.

Use length = SIZE_MAX for NULL-terminated strings.

This is used instead of the one in the file even if not found and sidesteps load_external_files as it's explicitly requested.

(.obj) Data for the .mtl file.

The world unit in meters that .obj files are assumed to be in.

.obj files do not define the working units. By default the unit scale is read as zero, and no unit conversion is performed.

Coordinate space .obj files are assumed to be in.

.obj files do not define the coordinate space they use. By default no coordinate space is assumed and no conversion is performed.

struct ufbx_evaluate_opts

Options for ufbx_evaluate_scene()

Initialize to zero with { 0 } (C) or { } (C++)

Allocator used during evaluation

Allocator used for the final scene

Evaluate skinning (see ufbx_mesh.skinned_vertices)

Evaluate vertex caches (see ufbx_mesh.skinned_vertices)

WARNING: Potentially unsafe! Try to open external files such as geometry caches

External file callbacks (defaults to stdio.h)

struct ufbx_const_uint32_list

struct ufbx_const_real_list

struct ufbx_prop_override_desc

Element (ufbx_element.element_id) to override the property from

Property name to override.

Override value, use value.x for scalars. value_int is initialized from value.x if zero so keep value zeroed even if you don't need it!

struct ufbx_anim_opts

Animation layers indices.

Override layer weights, parallel to ufbx_anim_opts.layer_ids[].

Property overrides.

These allow you to override FBX properties, such as 'UFBX_Lcl_Rotation`.

Transform overrides.

These allow you to override individual nodes' ufbx_node.local_transform.

Ignore connected properties

Allocator used to create the ufbx_anim

enum ufbx_bake_step_handling

Specifies how to handle stepped tangents.

One millisecond default step duration, with potential extra slack for converting to float.

Use a custom interpolation duration for the constant step.

Stepped keyframes are represented as keyframes at the exact same time.

Use flags UFBX_BAKED_KEY_STEP_LEFT and UFBX_BAKED_KEY_STEP_RIGHT to differentiate between the primary key and edge limits.

Represent stepped keyframe times as the previous/next representable double value.

Using this and robust linear interpolation will handle stepped tangents correctly without having to look at the key flags.

Casting these values to float or otherwise modifying them can collapse the keyframes to have the identical time.

Treat all stepped tangents as linearly interpolated.

struct ufbx_bake_opts

Allocator used during loading

Allocator used for the final baked animation

Move the keyframe times to start from zero regardless of the animation start time.

For example, for an animation spanning between frames [30, 60] will be moved to [0, 30] in the baked animation.

This is in general not equivalent to subtracting ufbx_anim.time_begin from each keyframe, as this trimming is done exactly using internal FBX ticks.

Samples per second to use for resampling non-linear animation.

Default: 30

Minimum sample rate to not resample.

Many exporters resample animation by default. To avoid double-resampling keyframe rates higher or equal to this will not be resampled. Default: 19.5

Maximum sample rate to use, this will remove keys if they are too close together.

Default: unlimited

Bake the raw versions of properties related to transforms.

Do not bake node transforms.

Do not resample linear rotation keyframes.

FBX interpolates rotation in Euler angles, so this might cause incorrect interpolation.

Ignore layer weight animation.

Maximum number of segments to generate from one keyframe.

Default: 32

How to handle stepped tangents.

Interpolation duration used by UFBX_BAKE_STEP_HANDLING_CUSTOM_DURATION.

Interpolation epsilon used by UFBX_BAKE_STEP_HANDLING_CUSTOM_DURATION.

Defined as the minimum fractional decrease/increase in key time, ie. time / (1.0 + step_custom_epsilon) and time * (1.0 + step_custom_epsilon).

Enable key reduction.

Enable key reduction for non-constant rotations.

Assumes rotations will be interpolated using a spherical linear interpolation at runtime.

Threshold for reducing keys for linear segments.

Default 0.000001, use negative to disable.

Maximum passes over the keys to reduce.

Every pass can potentially halve the the amount of keys. Default: 4

struct ufbx_tessellate_curve_opts

Initialize to zero with { 0 } (C) or { } (C++)

Allocator used during tessellation

Allocator used for the final line curve

How many segments tessellate each span in ufbx_nurbs_basis.spans.

struct ufbx_tessellate_surface_opts

Initialize to zero with { 0 } (C) or { } (C++)

Allocator used during tessellation

Allocator used for the final mesh

How many segments tessellate each span in ufbx_nurbs_basis.spans.

Default is 4, not ufbx_nurbs_surface.span_subdivision_u/v as that would make it easy to create an FBX file with an absurdly high subdivision rate (similar to mesh subdivision). Please enforce copy the value yourself enforcing whatever limits you deem reasonable.

Skip computing ufbx_mesh.material_parts[]

struct ufbx_subdivide_opts

Options for ufbx_subdivide_mesh()

Initialize to zero with { 0 } (C) or { } (C++)

Allocator used during subdivision

Allocator used for the final mesh

Do not generate normals

Interpolate existing normals using the subdivision rules instead of generating new normals

Subdivide also tangent attributes

Map subdivided vertices into weighted original vertices.

May be O(n2) if max_source_vertices is not specified!

Limit source vertices per subdivided vertex.

Calculate bone influences over subdivided vertices (if applicable).

May be O(n2) if max_skin_weights is not specified!

Limit bone influences per subdivided vertex.

Index of the skin deformer to use for evaluate_skin_weights.

struct ufbx_geometry_cache_opts

Initialize to zero with { 0 } (C) or { } (C++)

Allocator used during loading

Allocator used for the final scene

External file callbacks (defaults to stdio.h)

FPS value for converting frame times to seconds

Axis to mirror the geometry by.

Enable scaling scale_factor all geometry by.

Factor to scale the geometry by.

struct ufbx_geometry_cache_data_opts

Options for ufbx_read_geometry_cache_TYPE()

Initialize to zero with { 0 } (C) or { } (C++)

External file callbacks (defaults to stdio.h)

Ignore scene transform.

 

Sizes of element types. eg sizeof(ufbx_node)

Version of the source file, comparable to UFBX_HEADER_VERSION

Practically always true (see below), if not you need to be careful with threads.

Guaranteed to be true in any of the following conditions:

  • ufbx.c has been compiled using: GCC / Clang / MSVC / ICC / EMCC / TCC
  • ufbx.c has been compiled as C++11 or later
  • ufbx.c has been compiled as C11 or later with <stdatomic.h> support

If false you can't call the following functions concurrently:

Load a scene from a size byte memory buffer at data

Load a scene by opening a file named filename

Load a scene by reading from an FILE *file stream

file is passed as a void pointer to avoid including <stdio.h>

Load a scene by reading from an FILE *file stream with a prefix

file is passed as a void pointer to avoid including <stdio.h>

Load a scene from a user-specified stream

Load a scene from a user-specified stream with a prefix

Free a previously loaded or evaluated scene

Increment scene refcount

Format a textual description of error.

Always produces a NULL-terminated string to char dst[dst_size], truncating if necessary. Returns the number of characters written not including the NULL terminator.

Find a property name from props, returns NULL if not found.

Searches through ufbx_props.defaults as well.

Utility functions for finding the value of a property, returns def if not found.

For ufbx_string you need to ensure the lifetime of the default is sufficient as no copy is made.

Find property in props with concatendated parts[num_parts].

Get an element connected to a property.

Find an element connected to a property by name.

Find any element of type type in scene by name.

For example if you want to find ufbx_material named Mat:

Find node in scene by name (shorthand for ufbx_find_element(UFBX_ELEMENT_NODE)).

Find an animation stack in scene by name (shorthand for ufbx_find_element(UFBX_ELEMENT_ANIM_STACK))

Find a material in scene by name (shorthand for ufbx_find_element(UFBX_ELEMENT_MATERIAL)).

Find a single animated property prop of element in layer.

Returns NULL if not found.

Find all animated properties of element in layer.

Get a matrix that transforms normals in the same way as Autodesk software.

The resulting normals are slightly incorrect as this function deliberately inverts geometric transformation wrong. For better results use ufbx_matrix_for_normals(&node->geometry_to_world).

Decompress a DEFLATE compressed buffer.

Returns the decompressed size or a negative error code (see source for details).

You must supply a valid retain with ufbx_inflate_retain.initialized == false but the rest can be uninitialized.

Same as ufbx_open_file() but compatible with the callback in ufbx_open_file_fn.

The user parameter is actually not used here.

Open a ufbx_stream from a file.

Use path_len == SIZE_MAX for NULL terminated string.

Uses the default ufbx allocator!

Evaluate a single animation curve at a time.

Returns default_value only if curve == NULL or it has no keyframes.

Evaluate a value from bundled animation curves.

Evaluate an animated property name from element at time.

If the property is not found it will have the flag UFBX_PROP_FLAG_NOT_FOUND.

Evaluate all animated properties of element.

This function returns an ufbx_props structure with the original properties as ufbx_props.defaults. This lets you use ufbx_find_prop/value() for the results.

 

Evaluate the animated transform of a node given a time.

The returned transform is the local transform of the node (ie. relative to the parent), comparable to ufbx_node.local_transform.

Evaluate the blend shape weight of a blend channel.

Return value uses 1.0 for full weight, instead of 100.0 that the internal property UFBX_Weight uses.

Evaluate the whole scene at a specific time in the animation anim.

The returned scene behaves as if it had been exported at a specific time in the specified animation, except that animated elements' properties contain only the animated values, the original ones are in props->defaults.

The returned scene refers to the original scene so the original scene cannot be freed until all evaluated scenes are freed.

Create a custom animation descriptor.

ufbx_anim_opts is used to specify animation layers and weights.

You can also leave ufbx_anim_opts.layer_ids[] empty and only specify overrides to evaluate the scene with different properties or local transforms.

Free an animation returned by ufbx_create_anim().

Increase the animation reference count.

"Bake" an animation to linearly interpolated keyframes.

Composites the FBX transformation chain into quaternion rotations.

Evaluate baked animation keyframes at time.

Internally linearly interpolates between two adjacent keyframes. Handles stepped tangents cleanly, which is not strictly necessary for custom interpolation.

Evaluate baked animation keyframes at time.

Internally spherically interpolates (ufbx_quat_slerp()) between two adjacent keyframes. Handles stepped tangents cleanly, which is not strictly necessary for custom interpolation.

Retrieve the bone pose for node.

Returns NULL if the pose does not contain node.

Find a texture for a given material FBX property.

Find a texture for a given shader property.

Map from a shader property to material property.

Find an input in a shader texture.

Returns true if axes forms a valid coordinate space.

Vector math utility functions.

Matrix math utility functions.

Get a matrix that can be used to transform geometry normals.

You must normalize the normals after transforming them with this matrix, eg. using ufbx_vec3_normalize().

This function flips the normals if the determinant is negative.

Matrix transformation utilities.

Get a matrix representing the deformation for a single vertex.

Returns fallback if the vertex is not skinned.

Resolve the index into ufbx_blend_shape.position_offsets[] given a vertex.

Returns UFBX_NO_INDEX if the vertex is not included in the blend shape.

Get the offset for a given vertex in the blend shape.

Returns ufbx_zero_vec3 if the vertex is not a included in the blend shape.

Get the current blend offset given a blend deformer.

This depends on the current animated blend weight of the deformer.

Apply the blend shape with weight to given vertices.

Apply the blend deformer with weight to given vertices.

This depends on the current animated blend weight of the deformer.

Low-level utility to evaluate NURBS the basis functions.

Evaluate a point on a NURBS curve given the parameter u.

Evaluate a point on a NURBS surface given the parameter u and v.

Tessellate a NURBS curve into a polyline.

Tessellate a NURBS surface into a mesh.

Free a line returned by ufbx_tessellate_nurbs_curve().

Increase the refcount of the line.

Find the face that contains a given index.

Returns UFBX_NO_INDEX if out of bounds.

Triangulate a mesh face, returning the number of triangles.

You need to space for (face.num_indices - 2) * 3 - 1 indices!

Using ufbx_mesh.max_face_triangles * 3 is always safe.

Generate the half-edge representation of mesh to topo[mesh->num_indices]

Get the next half-edge in topo.

Get the previous half-edge in topo.

Calculate a normal for a given face.

The returned normal is weighted by face area.

Generate indices for normals from the topology.

Respects smoothing groups.

Compute normals given normal indices.

You can use ufbx_generate_normal_mapping() to generate the normal indices.

Subdivide a mesh using the Catmull-Clark subdivision level times.

Free a mesh returned from ufbx_subdivide_mesh() or ufbx_tessellate_nurbs_surface().

Increase the mesh reference count.

Load geometry cache information from a file.

As geometry caches can be massive, this does not actually read the data, but only seeks through the files to form the metadata.

Free a geometry cache returned from ufbx_load_geometry_cache().

Increase the geometry cache reference count.

Read a frame from a geometry cache.

Sample the a geometry cache channel, linearly blending between adjacent frames.

Find a DOM node given a name.

Generate an index buffer for a flat vertex buffer.

streams specifies one or more vertex data arrays, each stream must contain num_indices vertices. This function compacts the data within streams in-place, writing the deduplicated indices to indices.

Run a single thread pool task.

See ufbx_thread_pool_run_fn for more information.

Get or set an arbitrary user pointer for the thread pool context.

ufbx_thread_pool_get_user_ptr() returns NULL if unset.

Utility functions for reading geometry data for a single index.

Utility functions for reading geometry data for a single index.

Functions for converting an untyped ufbx_element to a concrete type.

Returns NULL if the element is not that type.

Local translation.

Used by: ufbx_node

Local rotation expressed in Euler degrees.

Used by: ufbx_node The rotation order is defined by the UFBX_RotationOrder property.

Local scaling factor, 3D vector.

Used by: ufbx_node

Euler rotation interpretation, used by UFBX_Lcl_Rotation.

Used by: ufbx_node, enum value ufbx_rotation_order.

Scaling pivot: point around which scaling is performed.

Used by: ufbx_node.

Scaling pivot: point around which rotation is performed.

Used by: ufbx_node.

Scaling offset: translation added after scaling is performed.

Used by: ufbx_node.

Rotation offset: translation added after rotation is performed.

Used by: ufbx_node.

Pre-rotation: Rotation applied after UFBX_Lcl_Rotation.

Used by: ufbx_node. Affected by UFBX_RotationPivot but not UFBX_RotationOrder.

Post-rotation: Rotation applied before UFBX_Lcl_Rotation.

Used by: ufbx_node. Affected by UFBX_RotationPivot but not UFBX_RotationOrder.

Controls whether the node should be displayed or not.

Used by: ufbx_node.

Weight of an animation layer in percentage (100.0 being full).

Used by: ufbx_anim_layer.

Blend shape deformation weight (100.0 being full).