diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25da5c54..b117c33e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,9 +22,15 @@ jobs: - name: Tests (default features) run: cargo test --all --release + - name: Tests (all features) run: cargo test --all --all-features --release + - name: Formatting run: cargo fmt --all -- --check + - name: Clippy run: cargo clippy --all-features + + - name: Semantic versioning checks + uses: obi1kenobi/cargo-semver-checks-action@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index d563b376..4bb48aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,30 @@ Notable changes to this project are documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). -The `gltf` crate adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +The top-level `gltf` crate adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). Historically, semantic versioning has not applied to `gltf-json`. This is planned to change from version 2—see issue #409. ## Unreleased +## [1.4.1] - 2024-05-09 + +### Added + +- New functions `animation::Channel::index` and `animation::Sampler::index`. +- New feature flag `allow_empty_texture` to avoid required extension checks. + ### Fixed -- Fix `attemt to to subtract with overflow`-panic in `size_hint()` of sparse accessor when collecting items. -- Fix incorrect values returned from `size_hint()` in sparse accessor -- Add support to read items from sparse accessor without base buffer view + +- Fix `attempt to to subtract with overflow`-panic in `size_hint()` of sparse accessor when collecting items. +- Fix incorrect values returned from `size_hint()` in sparse accessor. +- Add support to read items from sparse accessor without base buffer view. ### Changed -- Update `image` to `0.25.0`. + +- Update `image` to `0.25.0`. +- Validation will now fail if a glTF document requires extensions that are not supported by the crate. ### Removed + - Feature `image_jpeg_rayon` no longer needed, as `image 0.25.0` now uses `zune-jpeg` for jpeg decoding. ## [1.4.0] - 2023-12-17 diff --git a/Cargo.toml b/Cargo.toml index 4f313766..a94a7add 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gltf" -version = "1.4.0" +version = "1.4.1" authors = ["David Harvey-Macaulay "] description = "glTF 2.0 loader" documentation = "https://docs.rs/gltf" @@ -25,7 +25,7 @@ approx = "0.5" [dependencies] base64 = { optional = true, version = "0.13" } byteorder = "1.3" -gltf-json = { path = "gltf-json", version = "1.4.0" } +gltf-json = { path = "gltf-json", version = "=1.4.1" } lazy_static = "1" urlencoding = { optional = true, version = "2.1" } serde_json = { features = ["raw_value"], version = "1.0" } diff --git a/README.md b/README.md index 574d8e52..643d0b4b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ By default, `gltf` ignores all `extras` and `names` included with glTF assets. Y ```toml [dependencies.gltf] -version = "1.2" +version = "1.4" features = ["extras", "names"] ``` diff --git a/gltf-derive/Cargo.toml b/gltf-derive/Cargo.toml index 78c1d97a..30a1c5a7 100644 --- a/gltf-derive/Cargo.toml +++ b/gltf-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gltf-derive" -version = "1.4.0" +version = "1.4.1" authors = ["David Harvey-Macaulay "] description = "Internal macros for the gltf crate" repository = "https://github.com/gltf-rs/gltf" diff --git a/gltf-json/Cargo.toml b/gltf-json/Cargo.toml index ff91e69a..015510df 100644 --- a/gltf-json/Cargo.toml +++ b/gltf-json/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gltf-json" -version = "1.4.0" +version = "1.4.1" authors = ["David Harvey-Macaulay "] description = "JSON parsing for the gltf crate" repository = "https://github.com/gltf-rs/gltf" @@ -9,7 +9,7 @@ edition = "2021" rust-version = "1.61" [dependencies] -gltf-derive = { path = "../gltf-derive", version = "1.4.0" } +gltf-derive = { path = "../gltf-derive", version = "=1.4.1" } serde = "1.0" serde_derive = "1.0" serde_json = { features = ["raw_value"], version = "1.0" } diff --git a/src/accessor/util.rs b/src/accessor/util.rs index b6d8c872..a9f027bd 100644 --- a/src/accessor/util.rs +++ b/src/accessor/util.rs @@ -114,12 +114,21 @@ impl<'a, T: Item> SparseIter<'a, T> { /// /// Here `base` is allowed to be `None` when the base buffer view is not explicitly specified. pub fn new( + base: Option>, + indices: SparseIndicesIter<'a>, + values: ItemIter<'a, T>, + ) -> Self { + Self::with_base_count(base, 0, indices, values) + } + + /// Supplemental constructor. + pub fn with_base_count( base: Option>, base_count: usize, indices: SparseIndicesIter<'a>, values: ItemIter<'a, T>, ) -> Self { - SparseIter { + Self { base, base_count, indices: indices.peekable(), @@ -354,7 +363,7 @@ impl<'a, 's, T: Item> Iter<'s, T> { ItemIter::new(subslice, stride) }; - Some(Iter::Sparse(SparseIter::new( + Some(Iter::Sparse(SparseIter::with_base_count( base_iter, base_count, index_iter, value_iter, ))) }