Skip to content

Commit

Permalink
work
Browse files Browse the repository at this point in the history
  • Loading branch information
rosaliedewinther committed Nov 8, 2023
1 parent ca0a3c1 commit 5d21bb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/data_structure.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION;
use crate::coordinates::{GlobalCoord, Index, LocalCoord};
use crate::transform::Map;
use bitflags::bitflags;
Expand Down Expand Up @@ -91,9 +92,15 @@ where
continue;
} else if let (Some(idx), Some(node_4)) = (self.node_4_iter_active.next(), self.node_4)
{
println!("data len: {} value mask len: {} child mask len: {} idx: {} file version: {} node compression version: {}", node_4.data.len(), node_4.value_mask.len(), node_4.child_mask.len(), idx, self.grid.descriptor.file_version, OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION);
return Some((
node_4.offset_to_global_coord(Index(idx as u32)).0.as_vec3(),
node_4.data[idx],

if self.grid.descriptor.file_version < OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION {
node_4.data[node_4.node_4_iter_active.iter_zeros().nth(idx).unwrap()]
} else {
node_4.data[idx]
},
VdbLevel::Node3,
));
}
Expand Down Expand Up @@ -130,6 +137,7 @@ where
#[derive(Debug, Clone)]
pub struct GridDescriptor {
pub name: String,
pub(crate) file_version: u32,
/// If not empty, the name of another grid that shares this grid's tree
pub instance_parent: String,
pub grid_type: String,
Expand Down
1 change: 1 addition & 0 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ impl<R: Read + Seek> VdbReader<R> {

let mut gd = GridDescriptor {
name: name.clone(),
file_version: header.file_version,
grid_type,
instance_parent,
grid_pos,
Expand Down

0 comments on commit 5d21bb0

Please sign in to comment.