pub struct FbxReader<R: Read + Seek = BufReader<File>> { /* private fields */ }fbx-reader only.Expand description
FBX reader for binary FBX files.
Implementations§
Source§impl FbxReader<Cursor<Vec<u8>>>
impl FbxReader<Cursor<Vec<u8>>>
Sourcepub fn from_bytes(bytes: impl Into<Vec<u8>>) -> Result<Self>
pub fn from_bytes(bytes: impl Into<Vec<u8>>) -> Result<Self>
Create an FBX reader from in-memory bytes, using default read options.
Sourcepub fn from_bytes_with_options(
bytes: impl Into<Vec<u8>>,
options: FbxReadOptions,
) -> Result<Self>
pub fn from_bytes_with_options( bytes: impl Into<Vec<u8>>, options: FbxReadOptions, ) -> Result<Self>
Create an FBX reader from in-memory bytes with explicit read options.
Source§impl<R: Read + Seek> FbxReader<R>
impl<R: Read + Seek> FbxReader<R>
Sourcepub fn new(reader: R) -> Result<Self>
pub fn new(reader: R) -> Result<Self>
Create a new FBX reader from a reader, using default read options.
Sourcepub fn new_with_options(reader: R, options: FbxReadOptions) -> Result<Self>
pub fn new_with_options(reader: R, options: FbxReadOptions) -> Result<Self>
Create a new FBX reader from a reader with explicit read options.
The header itself is parsed under options, so the options cannot be
changed after construction.
Sourcepub fn warnings(&self) -> &[FbxWarning]
pub fn warnings(&self) -> &[FbxWarning]
Container-layout notices collected by the most recent read.
Sourcepub fn byte_order(&self) -> FbxByteOrder
pub fn byte_order(&self) -> FbxByteOrder
Byte order selected by this file’s header endian marker.
Sourcepub fn options(&self) -> &FbxReadOptions
pub fn options(&self) -> &FbxReadOptions
Read options this reader was constructed with.
Sourcepub fn read_nodes(&mut self) -> Result<Vec<FbxNode>>
pub fn read_nodes(&mut self) -> Result<Vec<FbxNode>>
Read all top-level nodes.
Safe to call more than once: per-document budgets restart here, so a second read of the same file behaves exactly like the first.
Source§impl<R: Read + Seek> FbxReader<R>
impl<R: Read + Seek> FbxReader<R>
Sourcepub fn read_scene(&mut self) -> Result<FbxScene>
pub fn read_scene(&mut self) -> Result<FbxScene>
Reads the supported hierarchy, materials, textures, and animation from FBX.
The result retains model names, local transforms, materialized mesh geometry (positions, normals, UVs), per-polygon material indices, Phong/Lambert materials, textures, and node-TRS animation. It intentionally omits FBX pivots, pre/post rotations, inheritance rules, cameras, and arbitrary metadata. It retains skin clusters, bind poses, blend-shape deltas, and local TRS animation.
use draco_io::FbxMemoryReader;
let bytes = std::fs::read("model.fbx")?;
let mut reader = FbxMemoryReader::from_bytes(bytes)?;
let scene = reader.read_scene()?;
assert!(!scene.root_nodes.is_empty());