@vvfx/ge-ir 0.0.1-beta.11 → 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.
- package/README.md +134 -55
- package/dist/common/coordinate-mapping.d.ts +2 -0
- package/dist/common/json-normalization.d.ts +1 -1
- package/dist/common/particle-expression.d.ts +2 -0
- package/dist/conversion.d.ts +6 -0
- package/dist/ge2ir/parser/component.d.ts +2 -1
- package/dist/ge2ir/parser/timeline.d.ts +4 -2
- package/dist/ge2ir/post-process/mask.d.ts +1 -1
- package/dist/ge2ir/post-process.d.ts +1 -1
- package/dist/ge2ir/preserve-scene.d.ts +2 -0
- package/dist/ge2ir/types.d.ts +2 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.js +9510 -8686
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9512 -8687
- package/dist/index.mjs.map +1 -1
- package/dist/ir2ge/assemble-source-preserved-data.d.ts +5 -0
- package/dist/ir2ge/converter/bezier.d.ts +4 -6
- package/dist/ir2ge/converter/precomp.d.ts +3 -3
- package/dist/ir2ge/generator/{component.d.ts → append-component.d.ts} +1 -1
- package/dist/ir2ge/generator/append-particle-component.d.ts +3 -0
- package/dist/ir2ge/generator/append-timeline-tracks.d.ts +15 -0
- package/dist/ir2ge/generator/component-preservation.d.ts +1 -0
- package/dist/ir2ge/generator/layer-strategy.d.ts +2 -2
- package/dist/ir2ge/post-process/mask.d.ts +16 -10
- package/dist/ir2ge/post-process/matte.d.ts +2 -1
- package/dist/ir2ge/post-process/merge-preserved-resources.d.ts +1 -0
- package/dist/ir2ge/post-process/{visibility.d.ts → normalize-activation-intervals.d.ts} +4 -4
- package/dist/ir2ge/post-process/restore-runtime-graph.d.ts +4 -0
- package/dist/ir2ge/types.d.ts +10 -0
- package/dist/particle/assemble-particle-source-data.d.ts +11 -0
- package/dist/particle/particle-fragment.d.ts +6 -9
- package/dist/preserved-data.d.ts +25 -0
- package/package.json +4 -4
- package/dist/ir2ge/generator/build-particle-component.d.ts +0 -3
- package/dist/ir2ge/generator/timeline.d.ts +0 -8
- package/dist/ir2ge/map-particle-layout-to-ge-transform.d.ts +0 -30
- package/dist/particle/merge-particle-fragment.d.ts +0 -12
- package/dist/particle/merge-particle-scenes.d.ts +0 -21
- /package/dist/ge2ir/parser/{scene.d.ts → build-scene-context.d.ts} +0 -0
- /package/dist/ge2ir/parser/{layer.d.ts → parse-item-layer.d.ts} +0 -0
- /package/dist/ir2ge/generator/{layer.d.ts → append-layer-items.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -11,16 +11,16 @@ for fidelity-preserving export. Applications compose this adapter with `@vvfx/ds
|
|
|
11
11
|
|
|
12
12
|
- [Install](#install)
|
|
13
13
|
- [Usage](#usage)
|
|
14
|
+
- [Input capabilities](#input-capabilities)
|
|
14
15
|
- [Preserved data](#preserved-data)
|
|
15
16
|
- [Data boundaries](#data-boundaries)
|
|
16
17
|
- [API](#api)
|
|
17
18
|
- [Project structure](#project-structure)
|
|
18
|
-
- [Contributing](#contributing)
|
|
19
19
|
- [License](#license)
|
|
20
20
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
|
-
Node.js
|
|
23
|
+
Node.js 24 or later is required.
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
pnpm add @vvfx/ge-ir
|
|
@@ -60,47 +60,51 @@ console.info(imported.preservedData.particleSourceData);
|
|
|
60
60
|
Each source Composition containing ParticleSystems becomes one `particleEffectGroup`; every ParticleSystem retains an
|
|
61
61
|
independent binding and its original Item order. Because GE does not provide principal visual bounds, the adapter
|
|
62
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.
|
|
63
64
|
Scenes without ParticleSystem components store empty group and Layer arrays. Complete renderer, shape, and resource
|
|
64
65
|
data remains in the GE-owned layer payload rather than this layout index.
|
|
65
66
|
|
|
66
|
-
###
|
|
67
|
+
### Convert a complete DSL with particle sources
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
It follows the Python layout contract: FOV is vertical, world height is `2 * abs(camera.position.z) * tan(fov / 2)`,
|
|
72
|
-
and world width is world height times the preview aspect ratio. Camera `clipMode`, XY position, and rotation are
|
|
73
|
-
ignored. Returned world Z is zero; placement Z controls painter order.
|
|
74
|
-
When merging GE scenes, portrait-camera horizontal FOV is converted to equivalent vertical FOV for both
|
|
75
|
-
source and host before this mapping. The stored cameras remain unchanged.
|
|
76
|
-
|
|
77
|
-
### Merge restored particle GE scenes
|
|
78
|
-
|
|
79
|
-
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`:
|
|
80
72
|
|
|
81
73
|
```ts
|
|
82
|
-
import {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
});
|
|
89
88
|
```
|
|
90
89
|
|
|
91
|
-
Each
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
+
|
|
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.
|
|
96
100
|
|
|
97
|
-
`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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.
|
|
101
105
|
|
|
102
|
-
|
|
103
|
-
|
|
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.
|
|
104
108
|
|
|
105
109
|
### Convert Animation IR to GE
|
|
106
110
|
|
|
@@ -115,6 +119,12 @@ console.info(exported.diagnostics);
|
|
|
115
119
|
|
|
116
120
|
`convertIRToGE` validates the IR scene before conversion. `options.duration` can override the exported duration.
|
|
117
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
|
+
|
|
118
128
|
### Preserve GE-only data across a round trip
|
|
119
129
|
|
|
120
130
|
Pass the sidecar returned by `convertGEToIR` back to `convertIRToGE` when the IR has not been edited:
|
|
@@ -129,7 +139,8 @@ const roundTripped = convertIRToGE(imported.scene, {
|
|
|
129
139
|
The IR scene remains valid without the sidecar. Most supported layer types are also exportable without it. Particle
|
|
130
140
|
layers require their trusted GE sidecar for export because renderer, shape, and resource bindings are outside the
|
|
131
141
|
source-neutral particle contract. Supplying the sidecar restores compatible GE object-pool data, raw
|
|
132
|
-
animation payloads,
|
|
142
|
+
animation payloads, component property tracks, camera configuration, renderer and geometry settings, masks,
|
|
143
|
+
precomposition payloads, sprite metadata, particle payloads, and source hierarchy data.
|
|
133
144
|
|
|
134
145
|
### Export edited IR with retained GE data
|
|
135
146
|
|
|
@@ -161,16 +172,86 @@ const exported = convertIRToGE(updatedScene, {
|
|
|
161
172
|
GE values that conflict with changed IR fields, removes bindings for deleted compositions and layers, and returns the
|
|
162
173
|
reconciled sidecar. It does not modify either IR scene or generate GE output.
|
|
163
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
|
+
|
|
164
233
|
## Preserved data
|
|
165
234
|
|
|
166
235
|
`GEToIRPreservedData` is owned by this adapter and stored outside the Animation IR contract. Persist it together with
|
|
167
236
|
the IR scene when GE round-trip fidelity is required. Applications should not edit its internal fields directly.
|
|
168
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
|
+
|
|
169
249
|
Layer-level preserved data can include:
|
|
170
250
|
|
|
171
|
-
- raw position, rotation, scale, and color animation payloads;
|
|
172
|
-
-
|
|
173
|
-
-
|
|
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;
|
|
174
255
|
- masks and precomposition payloads that cannot be normalized losslessly;
|
|
175
256
|
- complete ParticleSystem payloads whose normalized IR fields override the corresponding values on export;
|
|
176
257
|
- the original single-item or null/sprite hierarchy.
|
|
@@ -182,6 +263,11 @@ are omitted and reported as
|
|
|
182
263
|
|
|
183
264
|
Use `updateGEToIRPreservedData` for an edited scene. It derives all supported invalidations from the difference
|
|
184
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.
|
|
185
271
|
|
|
186
272
|
## Data boundaries
|
|
187
273
|
|
|
@@ -199,16 +285,18 @@ between the baseline and updated IR scenes; layer-level lookup and invalidation
|
|
|
199
285
|
`rateOverTime`, `bursts`, Layer blend mode, anchor, and static opacity to that baseline instead of fabricating
|
|
200
286
|
renderer, shape, or resource defaults. Animated Particle Layer opacity is reported as unsupported because GE has
|
|
201
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.
|
|
202
291
|
- GE burst defaults are normalized to explicit IR `cycleCount` and `repeatIntervalFrames` values, including
|
|
203
292
|
unbounded cycles, with an informational normalization diagnostic. GE Item end behavior enters the normalized Layer;
|
|
204
293
|
Activation clip end behavior is retained independently in preserved data and restored during export.
|
|
205
294
|
|
|
206
295
|
Further documentation:
|
|
207
296
|
|
|
208
|
-
- [
|
|
209
|
-
- [DSL
|
|
210
|
-
- [
|
|
211
|
-
- [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)
|
|
212
300
|
|
|
213
301
|
Ordinary and particle layers share the initial DSL `position.z` stacking order; higher values render above lower
|
|
214
302
|
values. Reordering input arrays does not change stacking. Ordinary child subtrees stay together at their root rank.
|
|
@@ -255,6 +343,11 @@ interface GEToIROptions {
|
|
|
255
343
|
interface IRToGEOptions {
|
|
256
344
|
duration?: number;
|
|
257
345
|
preservedData?: GEToIRPreservedData;
|
|
346
|
+
sources?: readonly {
|
|
347
|
+
scene: IRScene;
|
|
348
|
+
preservedData: GEToIRPreservedData;
|
|
349
|
+
idMap: Readonly<Record<string, string>>;
|
|
350
|
+
}[];
|
|
258
351
|
}
|
|
259
352
|
```
|
|
260
353
|
|
|
@@ -267,7 +360,6 @@ reconciliation.
|
|
|
267
360
|
| --- | --- |
|
|
268
361
|
| `convertGEToIR` | Import GE JSONScene as Animation IR and GE-owned preserved data |
|
|
269
362
|
| `convertIRToGE` | Export Animation IR as GE JSONScene |
|
|
270
|
-
| `mergeParticleScenes` | Merge restored particle GE scenes with explicit layout and painter order |
|
|
271
363
|
| `updateGEToIRPreservedData` | Reconcile GE preserved data after IR edits |
|
|
272
364
|
| `get2dTo3dRatio` | Calculate the coordinate conversion ratio |
|
|
273
365
|
|
|
@@ -276,7 +368,6 @@ reconciliation.
|
|
|
276
368
|
All public types are imported from the package root:
|
|
277
369
|
|
|
278
370
|
- Conversion: `GEToIROptions`, `GEToIRResult`, `IRToGEOptions`, and `IRToGEResult`.
|
|
279
|
-
- Particle merge: `GEParticlePlacement` and `ParticleSceneMergeInput`.
|
|
280
371
|
- GE preserved data: `GEToIRPreservedData`.
|
|
281
372
|
- Reconciliation: `GEToIRPreservedDataChange` and `UpdateGEToIRPreservedDataOptions`.
|
|
282
373
|
|
|
@@ -297,18 +388,6 @@ src/
|
|
|
297
388
|
index.ts Stable public entry
|
|
298
389
|
```
|
|
299
390
|
|
|
300
|
-
## Contributing
|
|
301
|
-
|
|
302
|
-
Use repository issues for questions and bug reports. Pull requests are welcome. Run the package checks after changing
|
|
303
|
-
public behavior:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
pnpm --filter @vvfx/ge-ir test
|
|
307
|
-
pnpm --filter @vvfx/ge-ir build
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
Rendering changes require representative visual comparison in addition to automated checks.
|
|
311
|
-
|
|
312
391
|
## License
|
|
313
392
|
|
|
314
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
|
|
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;
|
package/dist/conversion.d.ts
CHANGED
|
@@ -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
|
|
5
|
-
duration
|
|
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
|
|
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
|
|
10
|
+
export declare function mergeNullVisualPairs(descriptors: RawLayerDescriptor[], ctx: GESceneContext): RawLayerDescriptor[];
|
|
11
11
|
export declare function resolveHierarchy(descriptors: RawLayerDescriptor[], ctx: GESceneContext): void;
|
package/dist/ge2ir/types.d.ts
CHANGED
|
@@ -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';
|