@vvfx/ge-ir 0.0.1-beta.10 → 0.0.1-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +136 -55
  2. package/dist/common/coordinate-mapping.d.ts +2 -0
  3. package/dist/common/json-normalization.d.ts +1 -1
  4. package/dist/common/particle-expression.d.ts +2 -0
  5. package/dist/conversion.d.ts +6 -0
  6. package/dist/ge2ir/parser/component.d.ts +2 -1
  7. package/dist/ge2ir/parser/timeline.d.ts +4 -2
  8. package/dist/ge2ir/post-process/mask.d.ts +1 -1
  9. package/dist/ge2ir/post-process.d.ts +1 -1
  10. package/dist/ge2ir/preserve-scene.d.ts +2 -0
  11. package/dist/ge2ir/types.d.ts +2 -0
  12. package/dist/index.d.ts +0 -3
  13. package/dist/index.js +9510 -8686
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +9512 -8687
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/ir2ge/assemble-source-preserved-data.d.ts +5 -0
  18. package/dist/ir2ge/converter/bezier.d.ts +4 -6
  19. package/dist/ir2ge/converter/precomp.d.ts +3 -3
  20. package/dist/ir2ge/generator/{component.d.ts → append-component.d.ts} +1 -1
  21. package/dist/ir2ge/generator/append-particle-component.d.ts +3 -0
  22. package/dist/ir2ge/generator/append-timeline-tracks.d.ts +15 -0
  23. package/dist/ir2ge/generator/component-preservation.d.ts +1 -0
  24. package/dist/ir2ge/generator/layer-strategy.d.ts +2 -2
  25. package/dist/ir2ge/post-process/mask.d.ts +16 -10
  26. package/dist/ir2ge/post-process/matte.d.ts +2 -1
  27. package/dist/ir2ge/post-process/merge-preserved-resources.d.ts +1 -0
  28. package/dist/ir2ge/post-process/{visibility.d.ts → normalize-activation-intervals.d.ts} +4 -4
  29. package/dist/ir2ge/post-process/restore-runtime-graph.d.ts +4 -0
  30. package/dist/ir2ge/types.d.ts +10 -0
  31. package/dist/particle/assemble-particle-source-data.d.ts +11 -0
  32. package/dist/particle/particle-fragment.d.ts +6 -9
  33. package/dist/preserved-data.d.ts +25 -0
  34. package/package.json +18 -3
  35. package/dist/ir2ge/generator/build-particle-component.d.ts +0 -3
  36. package/dist/ir2ge/generator/timeline.d.ts +0 -8
  37. package/dist/ir2ge/map-particle-layout-to-ge-transform.d.ts +0 -30
  38. package/dist/particle/merge-particle-fragment.d.ts +0 -12
  39. package/dist/particle/merge-particle-scenes.d.ts +0 -21
  40. /package/dist/ge2ir/parser/{scene.d.ts → build-scene-context.d.ts} +0 -0
  41. /package/dist/ge2ir/parser/{layer.d.ts → parse-item-layer.d.ts} +0 -0
  42. /package/dist/ir2ge/generator/{layer.d.ts → append-layer-items.d.ts} +0 -0
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @vvfx/ge-ir
2
2
 
3
+ English | [简体中文](./README-zh_CN.md)
4
+
3
5
  Bidirectional conversion between Galacean Effects and source-neutral Animation IR.
4
6
 
5
7
  The package converts supported GE content into normalized IR and retains GE-only data in an adapter-owned sidecar
@@ -9,16 +11,16 @@ for fidelity-preserving export. Applications compose this adapter with `@vvfx/ds
9
11
 
10
12
  - [Install](#install)
11
13
  - [Usage](#usage)
14
+ - [Input capabilities](#input-capabilities)
12
15
  - [Preserved data](#preserved-data)
13
16
  - [Data boundaries](#data-boundaries)
14
17
  - [API](#api)
15
18
  - [Project structure](#project-structure)
16
- - [Contributing](#contributing)
17
19
  - [License](#license)
18
20
 
19
21
  ## Install
20
22
 
21
- Node.js 22 or later is required.
23
+ Node.js 24 or later is required.
22
24
 
23
25
  ```bash
24
26
  pnpm add @vvfx/ge-ir
@@ -58,47 +60,51 @@ console.info(imported.preservedData.particleSourceData);
58
60
  Each source Composition containing ParticleSystems becomes one `particleEffectGroup`; every ParticleSystem retains an
59
61
  independent binding and its original Item order. Because GE does not provide principal visual bounds, the adapter
60
62
  stores `[0, 0, previewWidth, previewHeight]` as the fallback `authoringBounds` without a separate provenance marker.
63
+ Source GE may omit an unused `animations` collection; when present, it must be an array.
61
64
  Scenes without ParticleSystem components store empty group and Layer arrays. Complete renderer, shape, and resource
62
65
  data remains in the GE-owned layer payload rather than this layout index.
63
66
 
64
- ### Map particle layout to a GE transform
65
-
66
- Layout mapping is handled internally when converting DSL with particles.
67
-
68
- The internal mapping scales the source `authoringBounds` proportionally and aligns its center with `targetRegion.center`.
69
- It follows the Python layout contract: FOV is vertical, world height is `2 * abs(camera.position.z) * tan(fov / 2)`,
70
- and world width is world height times the preview aspect ratio. Camera `clipMode`, XY position, and rotation are
71
- ignored. Returned world Z is zero; placement Z controls painter order.
72
- When merging GE scenes, portrait-camera horizontal FOV is converted to equivalent vertical FOV for both
73
- source and host before this mapping. The stored cameras remain unchanged.
67
+ ### Convert a complete DSL with particle sources
74
68
 
75
- ### Merge restored particle GE scenes
76
-
77
- The caller restores particle scenes through `convertIRToGE`, then merges them into a host GE scene:
69
+ Pass the complete DSL to `convertDSLToIR`. Bind its particle placeholders to the paired source DSL sidecar;
70
+ ordinary layers are authored in the same conversion. This example uses a source with one root particle layer and
71
+ a `fullDSL` containing the target layer ID `target-particle`:
78
72
 
79
73
  ```ts
80
- import { mergeParticleScenes } from '@vvfx/ge-ir';
81
-
82
- const scene = mergeParticleScenes(hostScene, [{
83
- scene: restoredParticleScene,
84
- preservedData: particleGEPreservedData,
85
- placements,
86
- }], hostStackingOrder);
74
+ import { convertDSLToIR, convertIRToDSL } from '@vvfx/dsl-ir';
75
+ import { convertGEToIR, convertIRToGE } from '@vvfx/ge-ir';
76
+
77
+ const particle = convertGEToIR(particleGE, { frameRate: 30 });
78
+ const source = convertIRToDSL(particle.scene);
79
+ const converted = convertDSLToIR(fullDSL, {
80
+ particleSources: [{
81
+ preservedData: source.preservedData,
82
+ layers: { 'target-particle': source.dsl.layers[0].id },
83
+ }],
84
+ });
85
+ const exported = convertIRToGE(converted.scene, {
86
+ sources: converted.sourceInstances?.map(({ idMap }) => ({ ...particle, idMap })),
87
+ });
87
88
  ```
88
89
 
89
- Each placement identifies a preserved effect group, its target width and height, and center position.
90
- `irLayerId` selects one particle system; omit it to place the entire group. A group must have either one group placement
91
- or one placement per system. The merger validates and resolves these bindings internally.
92
- The merger preserves required ancestors and timelines, namespaces IDs, rebases binary pointers, and orders Items,
93
- scene bindings, and timeline tracks together. Sources must share the host GE version and be self-contained.
90
+ Each `particleSources` entry creates one independent IR Precomp instance. Its `layers` record maps target DSL IDs to
91
+ source DSL IDs. Bind one system or every system in the source composition. Shared systems must have identical target
92
+ width, height, and static position. Targets must be root particle leaves. Use separate entries for independent
93
+ placements or repeated instances. Auxiliary layers accompany the first source system when systems are split.
94
94
 
95
- `hostStackingOrder` optionally maps GE Item IDs to painter ranks independently of spatial Z. To carry source IR ranks
96
- through conversion, read `itemLayerIds` from the `convertIRToGE` result. This JSON-serializable record maps generated
97
- Item IDs to IR Layer IDs. The caller joins these bindings to its layer ranks. Without explicit ranks, the merger uses cumulative
98
- host spatial Z.
95
+ Target width, height, and position place the source region; Z controls painter order with ordinary DSL layers.
96
+ Optional `authoringBounds` defaults to the source canvas and fits proportionally without clipping. Source-local
97
+ position and depth remain intact. Particle values, name, and supplied rotation, scale, anchor, opacity, and timing
98
+ edit the retained source IR. Unedited curves survive. Omitted timing extends the particle and its ancestors to the
99
+ host duration; explicit timing remains unchanged. Source frame rates are retained and the host covers source duration.
99
100
 
100
- DSL conversion, paired sidecars, model requests, and initial placement policies belong to the application.
101
- See [the web workflows](../../web-packages/README.md#ge--dsl-集成边界) for a complete example.
101
+ `sourceInstances` returns each input `sourceIndex` and its `idMap`. For multiple sources, pair each mapping with the
102
+ original GE import at that index. `convertIRToGE` restores and namespaces GE payloads through `options.sources`,
103
+ reconciles edited fields, and exports once. The assembled preserved data is used internally during export.
104
+ Inputs are not mutated.
105
+
106
+ Sources require trusted GE 3.6 data and self-contained compositions. Coupled systems must stay in one instance.
107
+ DSL and GE adapters remain independent; source selection and paired sidecars belong to the application.
102
108
 
103
109
  ### Convert Animation IR to GE
104
110
 
@@ -113,6 +119,12 @@ console.info(exported.diagnostics);
113
119
 
114
120
  `convertIRToGE` validates the IR scene before conversion. `options.duration` can override the exported duration.
115
121
 
122
+ Exports use GE JSONScene **3.7**, with `children` on compositions and items instead of
123
+ `CompositionComponent.items`. Timeline assets and scene bindings retain playback and painter order.
124
+ Text uses `autoResize` and separates glyph size from item scale. Output is verified with GE Player `2.11.0-alpha.1`.
125
+ Consumers that read the former flat item list must traverse `children`; timeline-bound items use Timeline track
126
+ order for rendering. GE import continues to accept 3.6 input and also reads the exported 3.7 hierarchy and text units.
127
+
116
128
  ### Preserve GE-only data across a round trip
117
129
 
118
130
  Pass the sidecar returned by `convertGEToIR` back to `convertIRToGE` when the IR has not been edited:
@@ -127,7 +139,8 @@ const roundTripped = convertIRToGE(imported.scene, {
127
139
  The IR scene remains valid without the sidecar. Most supported layer types are also exportable without it. Particle
128
140
  layers require their trusted GE sidecar for export because renderer, shape, and resource bindings are outside the
129
141
  source-neutral particle contract. Supplying the sidecar restores compatible GE object-pool data, raw
130
- animation payloads, masks, precomposition payloads, sprite metadata, particle payloads, and source hierarchy data.
142
+ animation payloads, component property tracks, camera configuration, renderer and geometry settings, masks,
143
+ precomposition payloads, sprite metadata, particle payloads, and source hierarchy data.
131
144
 
132
145
  ### Export edited IR with retained GE data
133
146
 
@@ -159,16 +172,86 @@ const exported = convertIRToGE(updatedScene, {
159
172
  GE values that conflict with changed IR fields, removes bindings for deleted compositions and layers, and returns the
160
173
  reconciled sidecar. It does not modify either IR scene or generate GE output.
161
174
 
175
+ Changing a layer's activation interval keeps existing animation times: retained Bezier, linear, and color-gradient
176
+ curves are rebased to the new interval. Normalized IR keyframes use the edited composition's frame rate; animations
177
+ represented only in the GE sidecar retain their source times in seconds. Newly inserted layers follow IR painter order
178
+ among retained layers, while GE-only items keep their source slots.
179
+
180
+ ## Input capabilities
181
+
182
+ This matrix describes GE JSONScene import and round trips. Supported applies to the listed IR subset; partial
183
+ requires approximation or GE-owned preserved data. Keeping a raw payload does not make it editable in IR.
184
+
185
+ | Capability | Status | Behavior |
186
+ | --- | --- | --- |
187
+ | Scene and compositions | Supported | Imports all source compositions and resolves the entry composition. |
188
+ | Common layers | Supported | Image, solid, text, shape, null, precomp, and valid ParticleSystem layers. |
189
+ | Hierarchy and timing | Supported | Parent references, painter order, seconds-to-frames, and activation timing. |
190
+ | Transform animation | Partial | Maps supported channels, including base-scale multipliers; raw encodings stay in the sidecar. |
191
+ | GE runtime graphs | Preserved | Effect, post-processing, model/lighting, FFD, video, camera controllers, and Animator objects remain GE-owned. |
192
+ | Component property tracks | Partial | Reconnects source component tracks and playable assets through preserved data. |
193
+ | Camera and renderer settings | Partial | Retains source cameras, depth/render settings, and referenced geometry in preserved data. |
194
+ | Sprite metadata | Partial | Tint, atlas splits, sampling settings, alternate image URLs, and texture sheets use preserved data. |
195
+ | Text and shape paints | Partial | Normalizes text metrics; gradients missing endpoints are dropped with a warning. |
196
+ | Mask references | Partial | Single resolvable masks; multiple or unresolved references remain source-specific. |
197
+ | Precomp export | Partial | Opacity, nonzero source start, and stretch can cause diagnostics; clipping composes with masks. |
198
+ | Particle editing | Partial | Maps supported parameters; export needs trusted source renderer, shape, and resources. |
199
+ | Particle opacity animation | Unsupported | Static opacity is applied; animated opacity produces an export warning. |
200
+ | Luminance matte export | Unsupported | Not generated; reports `GE_MATTE_MODE_UNSUPPORTED`. |
201
+ | Other item / plugin types | Preserved | Items outside the mapped subset remain in the sidecar with `GE_RUNTIME_ITEM_PRESERVED`. |
202
+ | External resources | Partial | Resolves image/font/media/binary URLs with `resourceBaseUrl`; no downloading. |
203
+
204
+ Inspect `diagnostics` for `normalized`, `approximated`, `dropped`, and `unsupported` actions. Particle source layout
205
+ without valid `previewSize` reports `GE_PARTICLE_SOURCE_LAYOUT_UNAVAILABLE`; particle import can still succeed.
206
+ Malformed required data, a missing entry composition, invalid IR, or mismatched preserved data can throw errors.
207
+ The converter does not guarantee arbitrary plugin payloads or every GE runtime version will round-trip unchanged.
208
+
209
+ ### Composition export
210
+
211
+ `convertIRToGE` generates the selected `entryCompositionId` and its reachable Precomp graph. Unreferenced IR
212
+ compositions and their items, components, and timelines are not generated. Shared references reuse a composition
213
+ unless clipping, masks, or inherited opacity require an instance-specific variant; unused originals are not emitted
214
+ alongside those variants. To export another root, set `entryCompositionId` to that composition before conversion.
215
+ GE-owned resources retained through `preservedData` continue to follow the preservation rules below.
216
+
217
+ ### Mask export
218
+
219
+ Authored `layer.masks[]`, Precomp clipping, and Layer mattes compose into GE `mask.references[]` entries shaped as
220
+ `{ mask: { id: componentId }, inverted: boolean }`. Mask sources retain their hierarchy across compositions.
221
+ Redundant positive masks are removed only when their geometry shares the same coordinate space.
222
+
223
+ This is a breaking contract change: replace IR `mask: value` with `masks: [value]` and GE
224
+ `mask: { reference, inverted }` with `mask: { references: [{ mask: reference, inverted }] }`.
225
+ Import accepts legacy singular references and converts them to `references[]`; existing array references take precedence.
226
+ Export emits only array references, without modifying caller-owned input JSON. Playback requires a Runtime that reads
227
+ `mask.references[]`; the workbench uses GE `2.11.0-alpha.1` with matching plugins.
228
+
229
+ Positive references intersect and inverted references subtract. Multiple positive Add masks require a union, which
230
+ this Runtime model cannot express: additional positive Add entries are omitted with `GE_MASK_ADD_UNION_UNSUPPORTED`.
231
+ GE import still keeps multiple references in the paired preserved data instead of reconstructing an authored stack.
232
+
162
233
  ## Preserved data
163
234
 
164
235
  `GEToIRPreservedData` is owned by this adapter and stored outside the Animation IR contract. Persist it together with
165
236
  the IR scene when GE round-trip fidelity is required. Applications should not edit its internal fields directly.
166
237
 
238
+ GE-only items remain in their owning composition's preservation binding. They do not become placeholder IR Null
239
+ layers. Additional components on editable layers and composition-level components retain their object references,
240
+ timeline bindings, materials, shaders, geometry, binary resources, and media. Export rebuilds their hierarchy and
241
+ painter order around regenerated IR items; it also retains scene render settings. Media and binary URLs use
242
+ `resourceBaseUrl` when supplied, just like normalized image assets.
243
+
244
+ `GE_RUNTIME_ITEM_PRESERVED` reports items whose content is retained but cannot be edited through IR. These capabilities
245
+ require the paired `preservedData` and compatible GE Runtime/plugins; they are not portable IR feature definitions.
246
+ Deleting or changing the type of an editable layer removes its attached runtime components. GE-only sibling items
247
+ remain owned by the composition. Their internal parameters and animation are preserved rather than normalized.
248
+
167
249
  Layer-level preserved data can include:
168
250
 
169
- - raw position, rotation, scale, and color animation payloads;
170
- - sprite start color, texture splits, and texture-sheet animation settings;
171
- - GE item and component identities plus Activation clip end behavior;
251
+ - raw position, rotation, scale, and color animation payloads, including static scale bases;
252
+ - component property tracks and their playable assets, renderer settings, and geometry references;
253
+ - sprite start color, texture splits, sampling settings, alternate image URLs, and texture-sheet animation settings;
254
+ - GE item and component identities, item timing, and independent Activation clip end behavior;
172
255
  - masks and precomposition payloads that cannot be normalized losslessly;
173
256
  - complete ParticleSystem payloads whose normalized IR fields override the corresponding values on export;
174
257
  - the original single-item or null/sprite hierarchy.
@@ -180,6 +263,11 @@ are omitted and reported as
180
263
 
181
264
  Use `updateGEToIRPreservedData` for an edited scene. It derives all supported invalidations from the difference
182
265
  between the baseline and updated IR scenes; layer-level lookup and invalidation remain internal implementation details.
266
+ Composition bindings also retain camera configuration. Property tracks are discarded when layer type or timing changes;
267
+ content or bounds edits invalidate property tracks, and opacity edits invalidate color tracks. Asset replacement
268
+ invalidates texture metadata; scale edits invalidate both the raw scale curve and its base.
269
+ Composition bindings cover imported content. Newly authored compositions do not need a source binding, while particle
270
+ layers still require their trusted GE payload. Export retains the source minimum web player version and binary slots.
183
271
 
184
272
  ## Data boundaries
185
273
 
@@ -197,16 +285,18 @@ between the baseline and updated IR scenes; layer-level lookup and invalidation
197
285
  `rateOverTime`, `bursts`, Layer blend mode, anchor, and static opacity to that baseline instead of fabricating
198
286
  renderer, shape, or resource defaults. Animated Particle Layer opacity is reported as unsupported because GE has
199
287
  no timeline-compatible Particle renderer opacity target.
288
+ - Particle random endpoints are ordered for IR validation, and curves are cropped to emitter progress `[0, 1]`.
289
+ Unedited parameters retain their original GE expressions to preserve evaluation and seeded random order. Negative
290
+ item dimensions become positive local bounds with reflection in the scale channel.
200
291
  - GE burst defaults are normalized to explicit IR `cycleCount` and `repeatIntervalFrames` values, including
201
292
  unbounded cycles, with an informational normalization diagnostic. GE Item end behavior enters the normalized Layer;
202
293
  Activation clip end behavior is retained independently in preserved data and restored during export.
203
294
 
204
295
  Further documentation:
205
296
 
206
- - [GE and Animation IR reference](../../docs/ge-ir-reference.md)
207
- - [DSL, IR, and GE package boundaries](../../docs/dsl-ir-ge-ir-boundary.md)
208
- - [DSL and IR editing capabilities](../../docs/dsl-ir-editing-capabilities.md)
209
- - [Animation IR particle contract](../../docs/particle-ir-contract.md)
297
+ - [Animation IR contract](../animation-ir/README.md)
298
+ - [DSL adapter and editing contract](../dsl-ir/README.md)
299
+ - [Conversion manual](../../site/public/data/manual/en/conversion.md)
210
300
 
211
301
  Ordinary and particle layers share the initial DSL `position.z` stacking order; higher values render above lower
212
302
  values. Reordering input arrays does not change stacking. Ordinary child subtrees stay together at their root rank.
@@ -253,6 +343,11 @@ interface GEToIROptions {
253
343
  interface IRToGEOptions {
254
344
  duration?: number;
255
345
  preservedData?: GEToIRPreservedData;
346
+ sources?: readonly {
347
+ scene: IRScene;
348
+ preservedData: GEToIRPreservedData;
349
+ idMap: Readonly<Record<string, string>>;
350
+ }[];
256
351
  }
257
352
  ```
258
353
 
@@ -265,7 +360,6 @@ reconciliation.
265
360
  | --- | --- |
266
361
  | `convertGEToIR` | Import GE JSONScene as Animation IR and GE-owned preserved data |
267
362
  | `convertIRToGE` | Export Animation IR as GE JSONScene |
268
- | `mergeParticleScenes` | Merge restored particle GE scenes with explicit layout and painter order |
269
363
  | `updateGEToIRPreservedData` | Reconcile GE preserved data after IR edits |
270
364
  | `get2dTo3dRatio` | Calculate the coordinate conversion ratio |
271
365
 
@@ -274,7 +368,6 @@ reconciliation.
274
368
  All public types are imported from the package root:
275
369
 
276
370
  - Conversion: `GEToIROptions`, `GEToIRResult`, `IRToGEOptions`, and `IRToGEResult`.
277
- - Particle merge: `GEParticlePlacement` and `ParticleSceneMergeInput`.
278
371
  - GE preserved data: `GEToIRPreservedData`.
279
372
  - Reconciliation: `GEToIRPreservedDataChange` and `UpdateGEToIRPreservedDataOptions`.
280
373
 
@@ -295,18 +388,6 @@ src/
295
388
  index.ts Stable public entry
296
389
  ```
297
390
 
298
- ## Contributing
299
-
300
- Use repository issues for questions and bug reports. Pull requests are welcome. Run the package checks after changing
301
- public behavior:
302
-
303
- ```bash
304
- pnpm --filter @vvfx/ge-ir test
305
- pnpm --filter @vvfx/ge-ir build
306
- ```
307
-
308
- Rendering changes require representative visual comparison in addition to automated checks.
309
-
310
391
  ## License
311
392
 
312
393
  [MIT](./LICENSE) © 2019-present Ant Group Co., Ltd.
@@ -5,6 +5,8 @@ export declare const DEFAULT_CAMERA_Z = 8;
5
5
  export declare const DEFAULT_CAMERA_FOV = 60;
6
6
  /** Default camera clipping mode for 2D GE scenes. */
7
7
  export declare const DEFAULT_CLIP_MODE = CameraClipMode.portrait;
8
+ /** GE 3.7 text layout converts glyph pixels to world units before applying item scale. */
9
+ export declare const TEXT_WORLD_UNITS_PER_PIXEL = 0.0123;
8
10
  /** Return the pixel-to-world scale for the given canvas. */
9
11
  export declare function get2dTo3dRatio(width: number, height: number): number;
10
12
  /**
@@ -1,3 +1,3 @@
1
1
  export declare function isRecord(value: unknown): value is Record<string, unknown>;
2
2
  /** Clone and normalize a value to its JSON-persisted runtime shape. */
3
- export declare function normalizeJsonValue<T>(value: T): T;
3
+ export declare function normalizeJSONValue<T>(value: T): T;
@@ -2,3 +2,5 @@ import type { IRParticleScalarExpression } from '@vvfx/animation-ir';
2
2
  import { type NumberExpression } from '@galacean/effects-specification';
3
3
  export declare function parseGEParticleScalarExpression(value: unknown): IRParticleScalarExpression | undefined;
4
4
  export declare function convertIRParticleScalarExpressionToGE(expression: IRParticleScalarExpression): NumberExpression;
5
+ /** Preserve GE evaluation and seeded random ordering until the normalized parameter changes. */
6
+ export declare function restoreGEParticleScalarExpression(expression: IRParticleScalarExpression, source: unknown): unknown;
@@ -18,4 +18,10 @@ export interface IRToGEResult {
18
18
  export interface IRToGEOptions {
19
19
  duration?: number;
20
20
  preservedData?: GEToIRPreservedData;
21
+ /** Source instances and their identities in the supplied IR scene. */
22
+ sources?: readonly {
23
+ scene: IRScene;
24
+ preservedData: GEToIRPreservedData;
25
+ idMap: Readonly<Record<string, string>>;
26
+ }[];
21
27
  }
@@ -1,6 +1,6 @@
1
1
  import type { IRBlendMode, IRColor, IRLocalBounds, IRParticleContent, IRShape, IRTextContent } from '@vvfx/animation-ir';
2
2
  import type { GESceneContext } from '../types';
3
- import type { EffectsSpriteSplit, EffectsTextSizeMode, EffectsTextureSheetAnimation } from '../../preserved-data';
3
+ import type { EffectsLayerPreservedData, EffectsSpriteSplit, EffectsTextSizeMode, EffectsTextureSheetAnimation } from '../../preserved-data';
4
4
  interface ParsedComponentData {
5
5
  type: 'image' | 'solid' | 'text' | 'shape' | 'particle';
6
6
  imageAssetId?: string;
@@ -11,6 +11,7 @@ interface ParsedComponentData {
11
11
  blendMode?: IRBlendMode;
12
12
  anchorScale?: [number, number];
13
13
  spriteSplits?: EffectsSpriteSplit[];
14
+ spriteTexture?: EffectsLayerPreservedData['spriteTexture'];
14
15
  textureSheetAnimation?: EffectsTextureSheetAnimation;
15
16
  textSizeMode?: EffectsTextSizeMode;
16
17
  GEComponentId?: string;
@@ -1,11 +1,13 @@
1
1
  import { EndBehavior } from '@galacean/effects-specification';
2
2
  import type { GESceneContext } from '../types';
3
+ import type { EffectsLayerPreservedData } from '../../preserved-data';
3
4
  interface ParsedTimelineData {
4
- delay: number;
5
- duration: number;
5
+ delay?: number;
6
+ duration?: number;
6
7
  activationEndBehavior?: EndBehavior;
7
8
  transformAsset?: Record<string, unknown>;
8
9
  spriteColorAsset?: Record<string, unknown>;
9
10
  }
10
11
  export declare function parseTimeline(itemId: string, ctx: GESceneContext): ParsedTimelineData | undefined;
12
+ export declare function parseComponentTimeline(componentId: string, ctx: GESceneContext): EffectsLayerPreservedData['componentTimeline'];
11
13
  export {};
@@ -7,4 +7,4 @@ export interface GEMaskNormalizationComposition {
7
7
  descriptors: RawLayerDescriptor[];
8
8
  }
9
9
  /** Normalize GE component mask references into Layer mattes or a strict cross-Composition path fallback. */
10
- export declare function normalizeSingleGEMasks(compositions: GEMaskNormalizationComposition[], diagnostics: ConversionDiagnostic[]): void;
10
+ export declare function normalizeGEMasks(compositions: GEMaskNormalizationComposition[], diagnostics: ConversionDiagnostic[]): void;
@@ -7,5 +7,5 @@ export interface RawLayerDescriptor {
7
7
  layer: IRLayer;
8
8
  preservedData: EffectsLayerPreservedData;
9
9
  }
10
- export declare function mergeNullSpritePairs(descriptors: RawLayerDescriptor[], ctx: GESceneContext): RawLayerDescriptor[];
10
+ export declare function mergeNullVisualPairs(descriptors: RawLayerDescriptor[], ctx: GESceneContext): RawLayerDescriptor[];
11
11
  export declare function resolveHierarchy(descriptors: RawLayerDescriptor[], ctx: GESceneContext): void;
@@ -0,0 +1,2 @@
1
+ /** Resolve adapter-owned resources against the same base as normalized IR assets. */
2
+ export declare function preserveSourceScene(scene: Record<string, unknown>, resourceBaseUrl?: string): Record<string, unknown>;
@@ -24,10 +24,12 @@ export interface GESceneContext {
24
24
  height: number;
25
25
  frameRate: number;
26
26
  ratio: number;
27
+ textScaleIncludesSize?: boolean;
27
28
  duration: number;
28
29
  inPoint: number;
29
30
  outPoint: number;
30
31
  compositionName?: string;
32
+ camera?: Record<string, unknown>;
31
33
  endBehavior: IREndBehavior;
32
34
  backgroundColor?: IRColor;
33
35
  itemById: GESceneCollectionIndex;
package/dist/index.d.ts CHANGED
@@ -2,10 +2,7 @@ export { convertIRToGE } from './ir2ge/convert';
2
2
  export { convertGEToIR } from './ge2ir/convert';
3
3
  export type { GEToIRResult, IRToGEOptions, IRToGEResult } from './conversion';
4
4
  export type { GEToIRPreservedData } from './preserved-data';
5
- export type { GEParticlePlacement } from './particle/merge-particle-scenes';
6
5
  export { get2dTo3dRatio } from './common/coordinate-mapping';
7
6
  export { updateGEToIRPreservedData } from './update-preserved-data';
8
7
  export type { GEToIROptions } from './ge2ir/types';
9
8
  export type { GEToIRPreservedDataChange, UpdateGEToIRPreservedDataOptions } from './update-preserved-data';
10
- export { mergeParticleScenes } from './particle/merge-particle-scenes';
11
- export type { ParticleSceneMergeInput } from './particle/merge-particle-scenes';