@wonderlandengine/editor-api 1.2.0-dev.3 → 1.2.3-dev.1

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/dist/data.d.ts CHANGED
@@ -26,6 +26,7 @@ export declare class ProjectSettings {
26
26
  customIndexHtml: boolean;
27
27
  extraFilesFolder: string;
28
28
  packageForStreaming: boolean;
29
+ version: number[];
29
30
  }
30
31
  /** Sky settings */
31
32
  export declare class SkySettings {
@@ -48,6 +49,8 @@ export declare enum TonemappingMode {
48
49
  ACES = "aces",
49
50
  /** Tonemapping with a simpler fit of the ACES transform */
50
51
  ACESApproximated = "aces approximated",
52
+ /** Tonemapping with the Khronos PBR Neutral Tone Mapper */
53
+ KhronosPBRNeutral = "khronos pbr neutral",
51
54
  /** Tonemapping with the global Reinhard operator */
52
55
  Reinhard = "reinhard",
53
56
  /** Tonemapping with an exponential curve */
@@ -63,8 +66,25 @@ export declare class TextureStreamingSettings {
63
66
  maxCacheSize: number;
64
67
  maxUploadPerFrame: number;
65
68
  }
69
+ export declare enum EnvironmentMode {
70
+ Disabled = "disabled",
71
+ SphericalHarmonic0 = "spherical-harmonic-0",
72
+ SphericalHarmonic1 = "spherical-harmonic-1",
73
+ SphericalHarmonic2 = "spherical-harmonic-2"
74
+ }
75
+ /** Environment settings */
76
+ export declare class EnvironmentSettings {
77
+ enabled: boolean;
78
+ image: ImageReference;
79
+ mode: EnvironmentMode;
80
+ intensity: number;
81
+ bakeExposure: number;
82
+ tint: number[];
83
+ maxSpecularEnvironmentSize: number;
84
+ }
66
85
  /** Rendering settings */
67
86
  export declare class RenderingSettings {
87
+ api: 'webgl2' | 'webgpu-or-webgl2';
68
88
  textureAtlasSize: number[];
69
89
  compressedTextureAtlasSize: number[];
70
90
  clearColor: number[];
@@ -76,6 +96,8 @@ export declare class RenderingSettings {
76
96
  bloom: BloomSettings;
77
97
  hdr: HdrSettings;
78
98
  textureStreaming: TextureStreamingSettings;
99
+ environment: EnvironmentSettings;
100
+ maxTextures: number;
79
101
  }
80
102
  /** Camera settings */
81
103
  export declare class CameraSettings {
@@ -88,6 +110,10 @@ export declare class EditorSettings {
88
110
  serverCOEP: string;
89
111
  camera: CameraSettings;
90
112
  ids: string;
113
+ package: {
114
+ packageUnusedMeshes: boolean;
115
+ supercompressionLevel: number;
116
+ };
91
117
  }
92
118
  /** Plugins settings */
93
119
  export declare class PluginsSettings {
@@ -147,6 +173,7 @@ export declare class ScriptingSettings {
147
173
  bundlingType: BundlingType;
148
174
  npmScript: string;
149
175
  esbuildFlags: string;
176
+ esbuildFlagsEditor: string;
150
177
  entryPoint: string;
151
178
  }
152
179
  /** VR settings */
@@ -214,6 +241,7 @@ export declare class ImageResource {
214
241
  stream: boolean;
215
242
  isProbe: boolean;
216
243
  isSpecularProbe: boolean;
244
+ hdr: boolean;
217
245
  }
218
246
  /** Texture resource */
219
247
  export declare class TextureResource {
@@ -249,6 +277,7 @@ export declare class MeshResource {
249
277
  simplifyTarget: number;
250
278
  simplifyTargetError: number;
251
279
  importScaling: number;
280
+ hasMorphTargets: boolean;
252
281
  }
253
282
  /** Material properties for the default Phong pipeline */
254
283
  export declare class PhongMaterial {
@@ -347,6 +376,17 @@ export declare class MaterialResource {
347
376
  Sky?: SkyMaterial;
348
377
  Background?: BackgroundMaterial;
349
378
  }
379
+ /** Animation blending type */
380
+ export declare enum AnimationBlendType {
381
+ None = "none",
382
+ Blend1D = "blend1D"
383
+ }
384
+ /** Root motion handling mode */
385
+ export declare enum RootMotionMode {
386
+ None = "none",
387
+ ApplyToOwner = "applyToOwner",
388
+ ScriptEvent = "scriptEvent"
389
+ }
350
390
  /** 'animation' component configuration */
351
391
  export declare class AnimationComponent {
352
392
  preview: boolean;
@@ -356,6 +396,13 @@ export declare class AnimationComponent {
356
396
  speed: number;
357
397
  skin: SkinReference;
358
398
  animation: AnimationReference;
399
+ rootMotionMode: RootMotionMode;
400
+ blendFactor: number;
401
+ blendType: AnimationBlendType;
402
+ blendAnimations: {
403
+ animations: AnimationReference[];
404
+ playbackSpeeds: number[];
405
+ };
359
406
  }
360
407
  /** Light type enum */
361
408
  export declare enum LightType {
@@ -462,12 +509,20 @@ export declare class MeshComponent {
462
509
  mesh: MeshReference;
463
510
  skin: SkinReference;
464
511
  morphTargets: MorphTargetsReference;
512
+ morphTargetWeights: number[];
465
513
  }
466
514
  /** Text effect type enum */
467
515
  export declare enum TextEffectType {
468
516
  None = "none",
469
517
  Outline = "outline"
470
518
  }
519
+ /** Text wrap mode */
520
+ export declare enum TextWrapMode {
521
+ None = "none",
522
+ Soft = "soft",
523
+ Hard = "hard",
524
+ Clip = "clip"
525
+ }
471
526
  /** 'text' component configuration */
472
527
  export declare class TextComponent {
473
528
  alignment: string;
@@ -477,6 +532,8 @@ export declare class TextComponent {
477
532
  effect: TextEffectType;
478
533
  text: string;
479
534
  material: MaterialReference;
535
+ wrapMode: TextWrapMode;
536
+ wrapWidth: number;
480
537
  }
481
538
  /** Settings for a sphere collider */
482
539
  export declare class SphereConfig {
@@ -516,6 +573,11 @@ export declare class AnimationEvent {
516
573
  time: number;
517
574
  name: string;
518
575
  }
576
+ export declare class RootMotion {
577
+ target: ObjectReference;
578
+ translationAxis: number;
579
+ rotationAxis: number;
580
+ }
519
581
  /** Animation resource */
520
582
  export declare class AnimationResource {
521
583
  /** Name of the animation */
@@ -526,6 +588,7 @@ export declare class AnimationResource {
526
588
  targets: ObjectReference[];
527
589
  /** Animation events track */
528
590
  events: AnimationEvent[];
591
+ rootMotion?: RootMotion;
529
592
  }
530
593
  /** Component configuration */
531
594
  export declare class ComponentConfig {
@@ -607,6 +670,13 @@ export declare enum DepthFunction {
607
670
  GreaterOrEqual = "greater or equal",
608
671
  Greater = "greater"
609
672
  }
673
+ /** Mesh sorting mode */
674
+ export declare enum MeshSorting {
675
+ None = "none",
676
+ Z = "z",
677
+ InverseZ = "inverse-z",
678
+ MeshIndex = "mesh-index"
679
+ }
610
680
  /** Pipeline resource */
611
681
  export declare class PipelineResource {
612
682
  name: string;
@@ -621,6 +691,7 @@ export declare class PipelineResource {
621
691
  features: {
622
692
  [key: string]: boolean;
623
693
  };
694
+ meshSorting: MeshSorting;
624
695
  blendSrcRgb: BlendFunction;
625
696
  blendSrcAlpha: BlendFunction;
626
697
  blendDestRgb: BlendFunction;
@@ -644,10 +715,14 @@ export declare class FontResource {
644
715
  export declare class LanguageResource {
645
716
  /** Name of the language */
646
717
  name: string;
647
- /** Custom terms */
648
- strings: {
649
- [key: string]: string;
650
- };
718
+ /** Whether this is the default language */
719
+ isDefault: boolean;
720
+ }
721
+ /** File resource */
722
+ export declare class FileResource {
723
+ fileName: string;
724
+ importerName: string;
725
+ importPhysicalAsPhongMaterials: boolean;
651
726
  }
652
727
  /**
653
728
  * Access to Wonderland Editor's data.
@@ -670,7 +745,7 @@ export declare class EditorData {
670
745
  /** Project settings */
671
746
  settings: Settings;
672
747
  /** List of scene file paths */
673
- files: string[];
748
+ files: FileResource[];
674
749
  /** Animation resources */
675
750
  animations: AnimationResource[];
676
751
  /** Object resources */
package/dist/data.js CHANGED
@@ -4,6 +4,7 @@ export class ProjectSettings {
4
4
  customIndexHtml = false;
5
5
  extraFilesFolder = 'static';
6
6
  packageForStreaming = false;
7
+ version = [1, 2, 0];
7
8
  }
8
9
  /** Sky settings */
9
10
  export class SkySettings {
@@ -27,6 +28,8 @@ export var TonemappingMode;
27
28
  TonemappingMode["ACES"] = "aces";
28
29
  /** Tonemapping with a simpler fit of the ACES transform */
29
30
  TonemappingMode["ACESApproximated"] = "aces approximated";
31
+ /** Tonemapping with the Khronos PBR Neutral Tone Mapper */
32
+ TonemappingMode["KhronosPBRNeutral"] = "khronos pbr neutral";
30
33
  /** Tonemapping with the global Reinhard operator */
31
34
  TonemappingMode["Reinhard"] = "reinhard";
32
35
  /** Tonemapping with an exponential curve */
@@ -42,8 +45,26 @@ export class TextureStreamingSettings {
42
45
  maxCacheSize = 1024;
43
46
  maxUploadPerFrame = 10;
44
47
  }
48
+ export var EnvironmentMode;
49
+ (function (EnvironmentMode) {
50
+ EnvironmentMode["Disabled"] = "disabled";
51
+ EnvironmentMode["SphericalHarmonic0"] = "spherical-harmonic-0";
52
+ EnvironmentMode["SphericalHarmonic1"] = "spherical-harmonic-1";
53
+ EnvironmentMode["SphericalHarmonic2"] = "spherical-harmonic-2";
54
+ })(EnvironmentMode || (EnvironmentMode = {}));
55
+ /** Environment settings */
56
+ export class EnvironmentSettings {
57
+ enabled = false;
58
+ image = null;
59
+ mode = EnvironmentMode.Disabled;
60
+ intensity = 1.0;
61
+ bakeExposure = 1.0;
62
+ tint = [1.0, 1.0, 1.0];
63
+ maxSpecularEnvironmentSize = 512;
64
+ }
45
65
  /** Rendering settings */
46
66
  export class RenderingSettings {
67
+ api = 'webgl2';
47
68
  textureAtlasSize = [8192, 4096];
48
69
  compressedTextureAtlasSize = [16384, 8192];
49
70
  clearColor = [0.168, 0.168, 0.168, 1.0];
@@ -55,6 +76,8 @@ export class RenderingSettings {
55
76
  bloom = new BloomSettings();
56
77
  hdr = new HdrSettings();
57
78
  textureStreaming = new TextureStreamingSettings();
79
+ environment = new EnvironmentSettings();
80
+ maxTextures = 1024;
58
81
  }
59
82
  /** Camera settings */
60
83
  export class CameraSettings {
@@ -67,6 +90,10 @@ export class EditorSettings {
67
90
  serverCOEP = 'require-corp';
68
91
  camera = new CameraSettings();
69
92
  ids = 'incremental-number';
93
+ package = {
94
+ packageUnusedMeshes: false,
95
+ supercompressionLevel: 8,
96
+ };
70
97
  }
71
98
  /** Plugins settings */
72
99
  export class PluginsSettings {
@@ -138,6 +165,7 @@ export class ScriptingSettings {
138
165
  bundlingType = BundlingType.Esbuild;
139
166
  npmScript = 'build';
140
167
  esbuildFlags = '--format=esm';
168
+ esbuildFlagsEditor = '';
141
169
  entryPoint = 'js/index.js';
142
170
  }
143
171
  /** VR settings */
@@ -206,6 +234,7 @@ export class ImageResource {
206
234
  stream = true;
207
235
  isProbe = false;
208
236
  isSpecularProbe = false;
237
+ hdr = false;
209
238
  }
210
239
  /** Texture resource */
211
240
  export class TextureResource {
@@ -243,6 +272,7 @@ export class MeshResource {
243
272
  simplifyTarget = 0.5;
244
273
  simplifyTargetError = 0.02;
245
274
  importScaling = 1.0;
275
+ hasMorphTargets = false;
246
276
  }
247
277
  /** Material properties for the default Phong pipeline */
248
278
  export class PhongMaterial {
@@ -341,6 +371,19 @@ export class MaterialResource {
341
371
  Sky;
342
372
  Background;
343
373
  }
374
+ /** Animation blending type */
375
+ export var AnimationBlendType;
376
+ (function (AnimationBlendType) {
377
+ AnimationBlendType["None"] = "none";
378
+ AnimationBlendType["Blend1D"] = "blend1D";
379
+ })(AnimationBlendType || (AnimationBlendType = {}));
380
+ /** Root motion handling mode */
381
+ export var RootMotionMode;
382
+ (function (RootMotionMode) {
383
+ RootMotionMode["None"] = "none";
384
+ RootMotionMode["ApplyToOwner"] = "applyToOwner";
385
+ RootMotionMode["ScriptEvent"] = "scriptEvent";
386
+ })(RootMotionMode || (RootMotionMode = {}));
344
387
  /** 'animation' component configuration */
345
388
  export class AnimationComponent {
346
389
  preview = false;
@@ -350,6 +393,10 @@ export class AnimationComponent {
350
393
  speed = 1.0;
351
394
  skin = null;
352
395
  animation = null;
396
+ rootMotionMode = RootMotionMode.None;
397
+ blendFactor = 0.0;
398
+ blendType = AnimationBlendType.None;
399
+ blendAnimations = { animations: [], playbackSpeeds: [] };
353
400
  }
354
401
  /** Light type enum */
355
402
  export var LightType;
@@ -459,6 +506,7 @@ export class MeshComponent {
459
506
  mesh = null;
460
507
  skin = null;
461
508
  morphTargets = null;
509
+ morphTargetWeights = [];
462
510
  }
463
511
  /** Text effect type enum */
464
512
  export var TextEffectType;
@@ -466,6 +514,14 @@ export var TextEffectType;
466
514
  TextEffectType["None"] = "none";
467
515
  TextEffectType["Outline"] = "outline";
468
516
  })(TextEffectType || (TextEffectType = {}));
517
+ /** Text wrap mode */
518
+ export var TextWrapMode;
519
+ (function (TextWrapMode) {
520
+ TextWrapMode["None"] = "none";
521
+ TextWrapMode["Soft"] = "soft";
522
+ TextWrapMode["Hard"] = "hard";
523
+ TextWrapMode["Clip"] = "clip";
524
+ })(TextWrapMode || (TextWrapMode = {}));
469
525
  /** 'text' component configuration */
470
526
  export class TextComponent {
471
527
  alignment = 'center';
@@ -475,6 +531,8 @@ export class TextComponent {
475
531
  effect = TextEffectType.None;
476
532
  text = 'Wonderland Engine';
477
533
  material = 'DefaultFontMaterial';
534
+ wrapMode = TextWrapMode.None;
535
+ wrapWidth = 0.0;
478
536
  }
479
537
  /** Settings for a sphere collider */
480
538
  export class SphereConfig {
@@ -515,6 +573,11 @@ export class AnimationEvent {
515
573
  time = 0.0;
516
574
  name = '';
517
575
  }
576
+ export class RootMotion {
577
+ target = null;
578
+ translationAxis = 0;
579
+ rotationAxis = 0;
580
+ }
518
581
  /** Animation resource */
519
582
  export class AnimationResource {
520
583
  /** Name of the animation */
@@ -525,6 +588,7 @@ export class AnimationResource {
525
588
  targets = [];
526
589
  /** Animation events track */
527
590
  events = [];
591
+ rootMotion;
528
592
  }
529
593
  /** Component configuration */
530
594
  export class ComponentConfig {
@@ -609,6 +673,14 @@ export var DepthFunction;
609
673
  DepthFunction["GreaterOrEqual"] = "greater or equal";
610
674
  DepthFunction["Greater"] = "greater";
611
675
  })(DepthFunction || (DepthFunction = {}));
676
+ /** Mesh sorting mode */
677
+ export var MeshSorting;
678
+ (function (MeshSorting) {
679
+ MeshSorting["None"] = "none";
680
+ MeshSorting["Z"] = "z";
681
+ MeshSorting["InverseZ"] = "inverse-z";
682
+ MeshSorting["MeshIndex"] = "mesh-index";
683
+ })(MeshSorting || (MeshSorting = {}));
612
684
  /** Pipeline resource */
613
685
  export class PipelineResource {
614
686
  name = 'pipeline';
@@ -621,6 +693,7 @@ export class PipelineResource {
621
693
  shader = null;
622
694
  viewVertexShader = null;
623
695
  features = {};
696
+ meshSorting = MeshSorting.None;
624
697
  blendSrcRgb = BlendFunction.One;
625
698
  blendSrcAlpha = BlendFunction.One;
626
699
  blendDestRgb = BlendFunction.Zero;
@@ -644,8 +717,14 @@ export class FontResource {
644
717
  export class LanguageResource {
645
718
  /** Name of the language */
646
719
  name = 'language';
647
- /** Custom terms */
648
- strings = {};
720
+ /** Whether this is the default language */
721
+ isDefault = false;
722
+ }
723
+ /** File resource */
724
+ export class FileResource {
725
+ fileName = '';
726
+ importerName = '';
727
+ importPhysicalAsPhongMaterials = true;
649
728
  }
650
729
  /**
651
730
  * Access to Wonderland Editor's data.
package/dist/native.d.ts CHANGED
@@ -4,6 +4,7 @@ interface NativeToolsAPI {
4
4
  loadFile(filename: string): number;
5
5
  loadScene(filename: string, parent?: string): number;
6
6
  awaitJob(jobId: number, cb: (success: boolean) => void): void;
7
+ openBrowser(url: string): void;
7
8
  }
8
9
  interface NativeUiAPI {
9
10
  freeImage(id: number): void;
@@ -27,7 +28,7 @@ export interface Project {
27
28
  *
28
29
  * Directory in which the project file resides in.
29
30
  */
30
- readonly rootPath: string;
31
+ readonly root: string;
31
32
  /**
32
33
  * Project filename
33
34
  *
package/dist/tools.d.ts CHANGED
@@ -24,3 +24,9 @@ export declare function loadFile(path: string): Promise<void>;
24
24
  export declare function loadScene(path: string, options: {
25
25
  parent?: string;
26
26
  }): Promise<void>;
27
+ /**
28
+ * Open a URL with the system default browser
29
+ *
30
+ * @param url URL to open
31
+ */
32
+ export declare const openBrowser: (url: string) => void;
package/dist/tools.js CHANGED
@@ -41,3 +41,9 @@ export function loadScene(path, options) {
41
41
  const job = tools.loadScene(path, options.parent);
42
42
  return awaitJob(job);
43
43
  }
44
+ /**
45
+ * Open a URL with the system default browser
46
+ *
47
+ * @param url URL to open
48
+ */
49
+ export const openBrowser = tools.openBrowser.bind(tools);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderlandengine/editor-api",
3
- "version": "1.2.0-dev.3",
3
+ "version": "1.2.3-dev.1",
4
4
  "description": "Wonderland Engine's Editor API for plugins - very experimental.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",