Merge pull request #8246 from dotCooCoo/feat/ai-editing-data-meshes

.ai save: the editing copy keeps gradient meshes
This commit is contained in:
BFlat
2026-11-17 21:32:35 +07:00
committed by GitHub
16 changed files with 1300 additions and 25 deletions
+10 -2
View File
@@ -146,7 +146,13 @@ private editing data. VectorCraft:
effects or a group's own fills and strokes, blends in opacity masks, pattern tiles, symbols and art cut to a
clipping object or nested eight levels deep in art written in place of other objects (symbol instances, live
objects, brushed strokes), blends whose art would pass the most objects VectorCraft's reader reads, and every blend
on a large canvas.
on a large canvas. Gradient meshes are written as meshes: each mesh point's place, color, opacity and handles, patch by
patch; a reflected mesh is written with its columns in reverse order, and opens with each row's points in reverse
order. Meshes with a point in a Lab color, with
more than 128 rows or columns, folded meshes (patches whose corners turn different ways), meshes VectorCraft's reader
wouldn't open as they are drawn, meshes in pattern tiles and in art cut to a clipping object, and every mesh on a
large canvas are written as their drawn look with a warning. In a symbol's art, an envelope's contents are written in
the canvas's space with y down.
Point type, area type (with its rows, columns,
gutters and first baseline, threaded frames included) and type on a path are written as text: a text object for
each, naming its story in the text document, with the characters, fonts, sizes, leading, tracking, baseline shift,
@@ -161,7 +167,7 @@ private editing data. VectorCraft:
clipping object, mirrored type, turned or unevenly scaled area type and type on a path, area type in an open frame,
type on an open path whose ends meet, area type whose wrap cannot be reconstructed from plain saved paths, compound paths or groups, type of only white space, threads of
type on a path, threads whose frames differ in orientation, type and stories past the sizes VectorCraft's reader reads, and
type with inline graphics, ruby, gradient or pattern paint or an appearance or opacity mask of its own, other patterns, other clipping objects and live
type with inline graphics, ruby, gradient or pattern paint or an appearance or opacity mask of its own, other patterns, other clipping objects and other live
objects (placed documents included) are written as plain filled and stroked paths, and freeform gradients, gradients along
or across a stroke and gradients without stops, with more than 256 stops or without extent as their average
color, each with a warning. Gradients that dither are written without dither's noise, Perceptual gradients and
@@ -300,6 +306,8 @@ An object in a pattern's art or in a brush's art takes the file's art styles in
Names in the editing data that aren't UTF-8 (layers, objects, artboards, colors, gradients, patterns, graphic styles, swatches, brushes, symbols, variables and data sets) are read as Windows-1252 unless `legacyNameEncoding` (`convert --legacy-name-encoding`) picks `macintosh`, `windows-949`, `shift_jis`, `gbk` or `big5`; the open result's warnings list the first three such names as read and count the rest. The text values of data sets are read in the same encoding.
Gradient meshes in the editing data keep each point's own color where a patch's corners differ in color model. In a symbol's art, a gradient mesh's corners and an envelope's grid are read in the space an image's matrix is read in there, and an envelope's contents in its dictionary in the canvas's space with y down. In a file without a template box such a mesh or grid is not read, and its symbol's instances open as the page draws them, as with an image there. An envelope in a symbol's art whose grid and contents are in the symbol's own space, as earlier VectorCraft builds wrote them, opens as the art it draws.
## Format by format
| Format | Illustrator | Ours: open/place | Ours: save/export | Fidelity and tests |
+1
View File
@@ -1936,6 +1936,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
An envelope whose contents hold type keeps the type editable in that `.ai`: the editing copy writes the type as type in the envelope's contents, in the form the `.ai` reader opens as a live envelope of type (`TypedEnvelope` in `crates/eps/src/import/ai/envelope.rs`), so the file opens with the type shown and editable in the envelope's contents, with Edit Contents off or on. An envelope of type in a symbol's art, and one whose type is threaded, has text wrap options or is written as its outlines (mirrored type, for example), is written as its distorted art, as before (`an_envelope_of_type_is_read_back_live_with_its_type`, `an_envelope_of_type_written_as_its_art_leaves_no_story` and `an_envelope_of_type_in_a_symbol_or_a_thread_is_written_as_its_art` in `crates/eps/src/ai_editing/tests.rs`).
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps keeps blends live: its editing copy holds each blend's key objects, its spine when it has one of its own, its drawn steps, and its spacing (Smooth Color, Specified Steps, Specified Distance) and orientation (Align to Page, Align to Path) ([Blend Options](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-options-overview.html), [blends and their spine](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260)), in the form VectorCraft's `.ai` blend reader reads (`crates/eps/src/import/ai/blend.rs`), so the file opens with the same live blend laying out the same steps. Each blend is checked with that reader before it is written; blends it wouldn't open with their settings or as they are drawn are written as their steps with a warning ([file-format-parity.md](file-format-parity.md) lists them) (`blends_are_read_back_live`, `blends_of_compound_paths_groups_and_62_keys_are_read_back_live` and `blends_the_reader_cant_read_are_written_as_their_steps` in `crates/eps/src/ai_editing/tests.rs`).
A top object whose top and bottom sides, or left and right sides, have different numbers of segments is also saved live: the side with fewer segments is split into as many as the side across from it has (each segment into equal spans of its curve, a straight one at even steps), up to the 50 a side the grid holds, so the file opens with the same corners and the same mapping of the contents, its outline holding the added anchors. Where the split side would share out the contents another way, as a side of two curves that aren't one curve can, or a side has more than 50 segments, the envelope is written as its distorted art, with the warning (`a_top_object_with_uneven_sides_is_read_back_live`, `a_top_object_split_to_the_grids_limit_is_read_back_live` and `a_top_object_whose_split_side_would_map_another_way_is_written_as_its_art` in `crates/eps/src/ai_editing/tests.rs`).
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps keeps gradient meshes editable ([gradient meshes](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=200), [opacity of mesh points](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=203)): its editing copy writes each mesh point's place, color (gray, RGB or CMYK), opacity and handles patch by patch, with the mesh's transparency, name and opacity mask, in the form VectorCraft's `.ai` mesh reader reads (`crates/eps/src/import/ai/mesh.rs`), so the file opens with the same mesh. A reflected mesh is written with its columns in reverse order. Meshes with a point in a Lab color, with more than 128 rows or columns, folded meshes, meshes the reader would open otherwise, meshes in pattern tiles and in art cut to a clipping object, and every mesh on a large canvas are written as their drawn look, with a warning (`meshes_are_read_back_as_they_are`, `meshes_in_masks_and_symbols_are_read_back`, `a_reflected_mesh_is_written_with_its_columns_reversed` and `meshes_the_reader_cant_read_are_written_as_their_drawn_look` in `crates/eps/src/ai_editing/tests.rs`).
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps writes eligible paths, compound paths and groups with live effects with an art style when the writer supports their appearance and effects (not a filled path that uses the even-odd rule, and none on a large canvas), which VectorCraft's `.ai` reader opens as the same appearance with its effects live (`objects_with_live_effects_are_read_back` and `every_effect_setting_written_on_an_object_is_read_back` in `crates/eps/src/ai_editing/tests.rs`; [file-format-parity.md](file-format-parity.md) lists the objects written without one and the effects they lose).
The same holds for the objects of an opacity mask's art, a mask inside another mask's art and a hidden art root included, so a mask whose art has Offset Path opens drawing the image it masks as it did, with the effect live; geometry effects that no art style holds on a mask's art, such as Roughen, are written applied to the art, which opens drawing what it drew (`a_masked_image_with_live_offset_path_round_trips`, `hidden_and_nested_mask_art_keep_live_offset_path` and `a_masks_art_with_an_effect_no_style_holds_is_written_as_it_draws` in `crates/eps/src/ai_editing/tests.rs`).
Opacity masks in a symbol's art and in a pattern's tile are written the same way, so a symbol or pattern whose mask art has Offset Path opens with the effect live in its definition, and its instances and pattern fills draw as they did; each definition's mask art keeps its own style, and mask art linked to a graphic style opens still linked to it (`a_symbols_mask_art_keeps_live_offset_path`, `a_pattern_tiles_mask_art_keeps_live_offset_path`, `mask_art_styles_stay_with_their_own_art` and `opacity_mask_art_keeps_its_graphic_style_link` in `crates/eps/src/ai_editing/tests.rs`).