check_skins now compares the four joint slots of a skinned vertex in
pairs instead of collecting the joints with nonzero weights into a Vec,
so validation does not allocate once per vertex. The rule is unchanged:
a joint may not appear in two slots whose weights are both nonzero.
The writer test adds a vertex that repeats a joint in slots 1 and 3.
The writer refuses a skin that names a joint node twice, an inverse bind
matrix whose last row is not 0, 0, 0, 1, a negative skinning weight, a
vertex that names a joint with a nonzero weight twice, and a node with a
skin that places a written mesh without joints and weights.
Parts whose corners all have normals or UVs and parts whose corners do
not are written as primitives over separate vertices, so the first keep
their normals and the targets' normal offsets. A named image keeps its
mimeType. Texture slots look up their texture by image and sampler in a
map instead of a scan.
The reader charges images in data: URIs against max_data_bytes, and
skips a morph target's offsets for a pool the primitive does not fill
before it looks up their accessor.
The writer now checks limits.max_data_bytes as each buffer view and
each row of vertex data is added, and returns TooLarge before the
binary chunk passes the limit. The whole-chunk check after writing
stays. A mesh with more morph targets than limits.max_morph_targets
is TooLarge before any target is written.
extensionsUsed is collected through extension_names, which a test
uses to check that many distinct extension keys are listed in
n log n comparisons.
write_glb now writes what the glTF reader reads into the model:
- JOINTS_0 and WEIGHTS_0, skins with their joints and inverse bind
matrices, and a node's skin.
- Morph targets: POSITION and NORMAL offsets over the written vertices,
the mesh's weights, a node's weights (filled from the mesh's for the
targets the node leaves out) and names in extras.targetNames. A target
that moves fewer than three quarters of the vertices is a sparse
accessor without a buffer view; one that moves nothing is zeros.
- The kept extensions and extras of the file, nodes, meshes and
materials. Material extensions the reader reads into Material are
written from its fields, and KHR_lights_punctual is not written.
extensionsUsed lists every extension in the file, nested ones
included. The reader does not keep extensionsRequired, so the writer
requires only EXT_texture_webp.
- The file's textures (texture_variants) first and in their order, so
texture indices in kept extension data still match. A texture of a
WebP image names it through EXT_texture_webp, since core glTF has no
WebP, and WebP bytes without a MIME type are written as image/webp.
The writer refuses a value that is not finite, a skin without joints or
with a different number of inverse bind matrices, a mesh with joints but
no weights (or the reverse), a joint index outside the node's skin, and
a node with more morph weights than its mesh has targets.
The reader now names textures it leaves out for want of an image in a
warning, since the textures after them move up.
The glTF reader checked the buffers' total against max_data_bytes on its
own and then gave morph targets, images, skins and animations the whole
limit again. Those charges now start from what the buffers leave of the
limit, so one max_data_bytes covers all of them, as the README lists.
The boundary tests add the buffer's bytes, and a one-triangle file with
one morph target needs the target's size plus 144 bytes.
The glTF reader now reads morph targets instead of skipping them with a
warning. Each target's POSITION, NORMAL and TANGENT offsets, from dense or
sparse accessors, become a MorphTarget on the Mesh, aligned with the pool
it moves. The mesh's default weights go in Mesh::morph_weights, a node's
own weights in Node::morph_weights, and names come from
extras.targetNames. Primitives that name the same attributes but other
targets no longer share vertices.
The new Limits::max_morph_targets (256) bounds the targets of one mesh. A
mesh with more is read in its base shape and named in a warning, as every
morphed mesh was before. Offsets, and the zeros of vertices a target does
not move, count against max_data_bytes at 8 bytes per value, and so does
each target itself, so targets that all name one accessor, or many meshes
of empty targets, cannot allocate without bound.
The extensions and extras of the file, its nodes, meshes and materials are
kept as serde_json values on Scene, Node, Mesh and Material, so a caller
can read an extension the reader does not. serde_json becomes a
dependency with every feature and is re-exported.
* craft-mesh: add COLLADA (.dae) and Alembic (.abc) readers
* fix(mesh): use str::to_owned instead of into_owned in dae
* craft-mesh: make dae and abc opt-in features
* fix(mesh): remove unused Error import and use Entry API in abc
* mesh, image-codecs: add clearcoat/sheen GLB, obj_with_mtl, and EXR chromaticities (#778)
* fix(mesh): import Image and TextureRef in obj tests
* fix(mesh): construct Mesh via struct literal in gltf test
Merges main at 3b8e426a26.
- crates/ui: main's e-sign dialog (crates/ui/src/esign) moves to craft-cloud-ui beside the
share dialog, behind craft-cloud-ui's esign feature; craft-ui forwards `esign` and
re-exports the module.
- crates/proof: main's can_suggest_cased goes to affix/check.rs and its tests to
affix/tests.rs (next split affix.rs); French wiring in lib.rs.
- crates/svg: main's validated resolver and raster validation stay under tree-render, which
now also enables gif and image-webp; the shared image-codec helpers are gated on tree.
- craft-ai-agents: main's rev (craft-ai-integrations main), one entry.
- crates/craft: facade dependencies, features and re-exports for main's new crates.
- Workflows: main's per-crate layout, with next in the push triggers, Linux only for pushes to
next, next's crate features (keymap egui, window and update ui) and test paths (crw samples and
the pdf fixtures run inside the lib's test binary). The workspace gate keeps --keep-going and
the facade-as-an-app clippy from next's ui.yml. Per-crate doc steps live in docs.yml, which also
documents craft-ui, the ui-* crates, craft-doc and craft-pdf with every feature. docpath, i18n,
print and ui workflows go, as on main. actions.lock lists docs.yml and theme.yml.
- Main's cloud and share UI (account, cloud, share, presence, the overflow menu and split button)
lives in the new crate craft-cloud-ui as main wrote it; the craft-ui facade forwards share and
cloud and re-exports account, cloud, share and presence, so craft-cloud-local builds unchanged.
- audio and media: main's new tests join tests/main.rs under their features.
- cms: main's new synth and FOGRA39 tests, with the fogra39() helper they use.
- nextest: no gpu group on unix; next's tests create no GPU device.
storytold main 83cb1133dd (291 commits) into the integration head bab1a99b85; 47 conflicted files.
- Domain test files (metafile, prepress, pdf plates, settings store, heif, media-testkit, atomic): tests next cut stay cut; tests new on main are kept, as trials where the crate's test target runs trials.
- atomic: main's group-bits test and Faulty::set_group go to src/tests.rs. audio: main's GSM and SBC oracles join tests/main.rs. cms constructors, pdf knockout_backdrop and testing_pdf join their crates' one test binary; timeline's preflight tests become src/preflight_tests.rs trials.
- update: main's changes to detect, install (linux, macos) and the tests land in next's split modules. The app's own offer is inspected on a thread of its own, picked up by tick's polling; settle_for_tests settles offers too. Later on a ready update drops the close it asked for. updater_pin_tests.rs stays deleted; its new pin test is in tests/it/update.rs.
- craft-color: main added a different crate at crates/color (the colour tags of compositor and display frames); it is next's craft-color module `tags`, re-exported at the root.
- Old crates/ui (combo, docking, testing, README) and keymap's ui/view.rs stay deleted; main's new crates/ui/src/testing files are dropped with them.
- New crates in the craft facade: ai, control, dds, frame, ipc, media-source, palette, press-print, score, ssip. testkit and xtask are listed outside it.
- Cargo.lock: the union of both locks, resolved by cargo metadata. Workflow: main's nextest Windows leg, with next's --keep-going clippy.
The README's glTF "Not read" line was doubled and listed sparse
accessors and tangents, which are read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A primitive's morph targets are not read, and only one scene becomes the
roots. Both now add a warning: a count of the primitives drawn in their
base shape, and which scene of how many was read.
Closes#1938.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A base64 body with `%2B`, `%2F` or `%3D` escapes was refused as bad
base64, and a plain body lost every escaped byte that was not UTF-8 to
U+FFFD. Escapes are now decoded to bytes first, then base64 when the URI
says so. `uri_decode` is unchanged for file names.
Closes#1936
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
cut stay cut; tests new upstream are kept (audio aac/config, layout,
encode_format; cms lutfile; media mux; print windows_native, ticket;
update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
craft-media mux roll sample groups (mux/boxes.rs) and writer-start
offsets with overflow checks (mux/progressive.rs); craft-print's
shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
archive detection (self_update/detect.rs); craft-vectorcraft-format's
Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
(bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
the library's test executable are modules of tests/main.rs (audio
flac_decode and qoa_oracle, cms, docpath, pcraft-format,
vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
Addresses CodeRabbit on #1777: ByPolygonVertex/ByControlPoint material IDs use the
polygon's first corner instead of the polygon number; an earlier texture candidate
is tried before a later cached one; regression test for strict colours reading the
validated layer.