@wonderlandengine/editor-api 1.2.0-dev.2 → 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 {
@@ -380,9 +427,18 @@ export declare class LightComponent {
380
427
  shadowTexelSize: number;
381
428
  cascadeCount: number;
382
429
  }
430
+ /** View projection type enum */
431
+ export declare enum ProjectionType {
432
+ /** Perspective projection */
433
+ Perspective = "perspective",
434
+ /** Orthographic projection */
435
+ Orthographic = "orthographic"
436
+ }
383
437
  /** 'view' component configuration */
384
438
  export declare class ViewComponent {
439
+ projectionType: ProjectionType;
385
440
  fov: number;
441
+ extent: number;
386
442
  near: number;
387
443
  far: number;
388
444
  }
@@ -453,12 +509,20 @@ export declare class MeshComponent {
453
509
  mesh: MeshReference;
454
510
  skin: SkinReference;
455
511
  morphTargets: MorphTargetsReference;
512
+ morphTargetWeights: number[];
456
513
  }
457
514
  /** Text effect type enum */
458
515
  export declare enum TextEffectType {
459
516
  None = "none",
460
517
  Outline = "outline"
461
518
  }
519
+ /** Text wrap mode */
520
+ export declare enum TextWrapMode {
521
+ None = "none",
522
+ Soft = "soft",
523
+ Hard = "hard",
524
+ Clip = "clip"
525
+ }
462
526
  /** 'text' component configuration */
463
527
  export declare class TextComponent {
464
528
  alignment: string;
@@ -468,6 +532,8 @@ export declare class TextComponent {
468
532
  effect: TextEffectType;
469
533
  text: string;
470
534
  material: MaterialReference;
535
+ wrapMode: TextWrapMode;
536
+ wrapWidth: number;
471
537
  }
472
538
  /** Settings for a sphere collider */
473
539
  export declare class SphereConfig {
@@ -507,6 +573,11 @@ export declare class AnimationEvent {
507
573
  time: number;
508
574
  name: string;
509
575
  }
576
+ export declare class RootMotion {
577
+ target: ObjectReference;
578
+ translationAxis: number;
579
+ rotationAxis: number;
580
+ }
510
581
  /** Animation resource */
511
582
  export declare class AnimationResource {
512
583
  /** Name of the animation */
@@ -517,6 +588,7 @@ export declare class AnimationResource {
517
588
  targets: ObjectReference[];
518
589
  /** Animation events track */
519
590
  events: AnimationEvent[];
591
+ rootMotion?: RootMotion;
520
592
  }
521
593
  /** Component configuration */
522
594
  export declare class ComponentConfig {
@@ -598,6 +670,13 @@ export declare enum DepthFunction {
598
670
  GreaterOrEqual = "greater or equal",
599
671
  Greater = "greater"
600
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
+ }
601
680
  /** Pipeline resource */
602
681
  export declare class PipelineResource {
603
682
  name: string;
@@ -612,6 +691,7 @@ export declare class PipelineResource {
612
691
  features: {
613
692
  [key: string]: boolean;
614
693
  };
694
+ meshSorting: MeshSorting;
615
695
  blendSrcRgb: BlendFunction;
616
696
  blendSrcAlpha: BlendFunction;
617
697
  blendDestRgb: BlendFunction;
@@ -635,10 +715,14 @@ export declare class FontResource {
635
715
  export declare class LanguageResource {
636
716
  /** Name of the language */
637
717
  name: string;
638
- /** Custom terms */
639
- strings: {
640
- [key: string]: string;
641
- };
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;
642
726
  }
643
727
  /**
644
728
  * Access to Wonderland Editor's data.
@@ -661,7 +745,7 @@ export declare class EditorData {
661
745
  /** Project settings */
662
746
  settings: Settings;
663
747
  /** List of scene file paths */
664
- files: string[];
748
+ files: FileResource[];
665
749
  /** Animation resources */
666
750
  animations: AnimationResource[];
667
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;
@@ -375,9 +422,19 @@ export class LightComponent {
375
422
  shadowTexelSize = 1.0;
376
423
  cascadeCount = 4;
377
424
  }
425
+ /** View projection type enum */
426
+ export var ProjectionType;
427
+ (function (ProjectionType) {
428
+ /** Perspective projection */
429
+ ProjectionType["Perspective"] = "perspective";
430
+ /** Orthographic projection */
431
+ ProjectionType["Orthographic"] = "orthographic";
432
+ })(ProjectionType || (ProjectionType = {}));
378
433
  /** 'view' component configuration */
379
434
  export class ViewComponent {
435
+ projectionType = ProjectionType.Perspective;
380
436
  fov = 90;
437
+ extent = 10;
381
438
  near = 0.01;
382
439
  far = 100;
383
440
  }
@@ -449,6 +506,7 @@ export class MeshComponent {
449
506
  mesh = null;
450
507
  skin = null;
451
508
  morphTargets = null;
509
+ morphTargetWeights = [];
452
510
  }
453
511
  /** Text effect type enum */
454
512
  export var TextEffectType;
@@ -456,6 +514,14 @@ export var TextEffectType;
456
514
  TextEffectType["None"] = "none";
457
515
  TextEffectType["Outline"] = "outline";
458
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 = {}));
459
525
  /** 'text' component configuration */
460
526
  export class TextComponent {
461
527
  alignment = 'center';
@@ -465,6 +531,8 @@ export class TextComponent {
465
531
  effect = TextEffectType.None;
466
532
  text = 'Wonderland Engine';
467
533
  material = 'DefaultFontMaterial';
534
+ wrapMode = TextWrapMode.None;
535
+ wrapWidth = 0.0;
468
536
  }
469
537
  /** Settings for a sphere collider */
470
538
  export class SphereConfig {
@@ -505,6 +573,11 @@ export class AnimationEvent {
505
573
  time = 0.0;
506
574
  name = '';
507
575
  }
576
+ export class RootMotion {
577
+ target = null;
578
+ translationAxis = 0;
579
+ rotationAxis = 0;
580
+ }
508
581
  /** Animation resource */
509
582
  export class AnimationResource {
510
583
  /** Name of the animation */
@@ -515,6 +588,7 @@ export class AnimationResource {
515
588
  targets = [];
516
589
  /** Animation events track */
517
590
  events = [];
591
+ rootMotion;
518
592
  }
519
593
  /** Component configuration */
520
594
  export class ComponentConfig {
@@ -599,6 +673,14 @@ export var DepthFunction;
599
673
  DepthFunction["GreaterOrEqual"] = "greater or equal";
600
674
  DepthFunction["Greater"] = "greater";
601
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 = {}));
602
684
  /** Pipeline resource */
603
685
  export class PipelineResource {
604
686
  name = 'pipeline';
@@ -611,6 +693,7 @@ export class PipelineResource {
611
693
  shader = null;
612
694
  viewVertexShader = null;
613
695
  features = {};
696
+ meshSorting = MeshSorting.None;
614
697
  blendSrcRgb = BlendFunction.One;
615
698
  blendSrcAlpha = BlendFunction.One;
616
699
  blendDestRgb = BlendFunction.Zero;
@@ -634,8 +717,14 @@ export class FontResource {
634
717
  export class LanguageResource {
635
718
  /** Name of the language */
636
719
  name = 'language';
637
- /** Custom terms */
638
- 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;
639
728
  }
640
729
  /**
641
730
  * Access to Wonderland Editor's data.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './data.js';
2
2
  export * as ui from './ui.js';
3
3
  export * as tools from './tools.js';
4
+ export * from './project.js';
4
5
  /** Editor plugin */
5
6
  export declare class EditorPlugin {
6
7
  name: string;
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import * as ui_1 from './ui.js';
3
3
  export { ui_1 as ui };
4
4
  import * as tools_1 from './tools.js';
5
5
  export { tools_1 as tools };
6
+ export * from './project.js';
6
7
  /** Editor plugin */
7
8
  export class EditorPlugin {
8
9
  name = 'Editor Plugin';
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;
@@ -21,9 +22,49 @@ interface NativeUiAPI {
21
22
  beginGroup(): void;
22
23
  endGroup(): void;
23
24
  }
25
+ export interface Project {
26
+ /**
27
+ * Root directory of the project
28
+ *
29
+ * Directory in which the project file resides in.
30
+ */
31
+ readonly root: string;
32
+ /**
33
+ * Project filename
34
+ *
35
+ * File only without the root directory.
36
+ */
37
+ readonly filename: string;
38
+ /**
39
+ * Project deploy path
40
+ * @returns `<root>/deploy`
41
+ */
42
+ readonly deployPath: string;
43
+ /**
44
+ * Project cache path
45
+ * @returns `<root>/cache`
46
+ */
47
+ readonly cachePath: string;
48
+ /**
49
+ * Project package.json path
50
+ * @returns `<root>/package.json`
51
+ */
52
+ readonly packageJsonPath: string;
53
+ /**
54
+ * Project node_modules path
55
+ * @returns `<root>/node_modules`
56
+ */
57
+ readonly nodeModulesPath: string;
58
+ /**
59
+ * Project shaders path
60
+ * @returns `<root>/shaders`
61
+ */
62
+ readonly shadersPath: string;
63
+ }
24
64
  declare global {
25
65
  function _wl_internalBinding(moduleName: 'tools'): NativeToolsAPI;
26
66
  function _wl_internalBinding(moduleName: 'ui'): NativeUiAPI;
27
67
  function _wl_internalBinding(moduleName: 'data'): EditorData;
68
+ function _wl_internalBinding(moduleName: 'project'): Project;
28
69
  }
29
70
  export {};
@@ -0,0 +1 @@
1
+ export declare const project: import("./native.js").Project;
@@ -0,0 +1 @@
1
+ export const project = _wl_internalBinding('project');
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.2",
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",