@threepipe/plugin-gltf-transform 0.1.0
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/GLTFDracoExportPlugin.d.ts +63 -0
- package/dist/GLTFDracoExportPlugin.d.ts.map +1 -0
- package/dist/GLTFDracoExporter.d.ts +38 -0
- package/dist/GLTFDracoExporter.d.ts.map +1 -0
- package/dist/dependencies.txt +138 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5369 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5366 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +34 -0
- package/src/GLTFDracoExportPlugin.ts +161 -0
- package/src/GLTFDracoExporter.ts +418 -0
- package/src/global.d.ts +40 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AssetExporterPlugin, AViewerPluginSync, ThreeViewer } from 'threepipe';
|
|
2
|
+
import { EncoderOptions } from '@gltf-transform/extensions/dist/khr-draco-mesh-compression/encoder';
|
|
3
|
+
export declare enum EncoderMethod {
|
|
4
|
+
EDGEBREAKER = 1,
|
|
5
|
+
SEQUENTIAL = 0
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* GLTF Draco Export Plugin
|
|
9
|
+
*
|
|
10
|
+
* Overloads the default gltf exporter in the asset manager with GLTFDracoExporter. When exporting with compress = true, the output will be compressed.
|
|
11
|
+
* Note - Only `glb` supported right now.
|
|
12
|
+
*
|
|
13
|
+
* @category Plugins
|
|
14
|
+
*/
|
|
15
|
+
export declare class GLTFDracoExportPlugin extends AViewerPluginSync<''> {
|
|
16
|
+
static readonly PluginType = "GLTFDracoExportPlugin";
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
onAdded(viewer: ThreeViewer): void;
|
|
19
|
+
protected _makeUi: (exporter: AssetExporterPlugin) => ({
|
|
20
|
+
type: string;
|
|
21
|
+
label: string;
|
|
22
|
+
property: (string | import("threepipe").ExportAssetOptions)[];
|
|
23
|
+
onChange: () => void | undefined;
|
|
24
|
+
hidden?: undefined;
|
|
25
|
+
children?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
type: string;
|
|
28
|
+
hidden: () => boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
children: ({
|
|
31
|
+
type: string;
|
|
32
|
+
label: string;
|
|
33
|
+
bounds: number[];
|
|
34
|
+
property: (string | EncoderOptions | undefined)[];
|
|
35
|
+
children?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
type: string;
|
|
38
|
+
label: string;
|
|
39
|
+
property: (string | EncoderOptions | undefined)[];
|
|
40
|
+
children: {
|
|
41
|
+
label: string;
|
|
42
|
+
}[];
|
|
43
|
+
bounds?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
type: string;
|
|
46
|
+
label: string;
|
|
47
|
+
children: {
|
|
48
|
+
type: string;
|
|
49
|
+
label: string;
|
|
50
|
+
bounds: number[];
|
|
51
|
+
stepSize: number;
|
|
52
|
+
property: (string | {
|
|
53
|
+
[key: string]: number;
|
|
54
|
+
} | undefined)[];
|
|
55
|
+
}[];
|
|
56
|
+
bounds?: undefined;
|
|
57
|
+
property?: undefined;
|
|
58
|
+
})[];
|
|
59
|
+
property?: undefined;
|
|
60
|
+
onChange?: undefined;
|
|
61
|
+
})[];
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=GLTFDracoExportPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLTFDracoExportPlugin.d.ts","sourceRoot":"","sources":["../src/GLTFDracoExportPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EAajB,WAAW,EACd,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAC,cAAc,EAAC,MAAM,oEAAoE,CAAA;AAEjG,oBAAY,aAAa;IACrB,WAAW,IAAI;IACf,UAAU,IAAI;CACjB;AAED;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,iBAAiB,CAAC,EAAE,CAAC;IAC5D,gBAAuB,UAAU,2BAA0B;IAC3D,OAAO,UAAO;IAEd,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IA8ElC,SAAS,CAAC,OAAO,aAAc,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2CjD;CACJ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
|
|
2
|
+
import { EncoderOptions } from '@gltf-transform/extensions/dist/khr-draco-mesh-compression/encoder';
|
|
3
|
+
import { DRACOLoader2, GLTFExporter2, GLTFExporter2Options, IExportParser } from 'threepipe';
|
|
4
|
+
/**
|
|
5
|
+
* GLTF Draco Exporter
|
|
6
|
+
*
|
|
7
|
+
* Extension of GLTFExporter2 that runs the output through gltf-transform for draco compression.
|
|
8
|
+
*/
|
|
9
|
+
export declare class GLTFDracoExporter extends GLTFExporter2 implements IExportParser {
|
|
10
|
+
loader?: DRACOLoader2;
|
|
11
|
+
private _io;
|
|
12
|
+
private _loadedLibs;
|
|
13
|
+
private _encoderOptions;
|
|
14
|
+
constructor(encoderOptions?: EncoderOptions, loader?: DRACOLoader2);
|
|
15
|
+
preload(): this;
|
|
16
|
+
private _loadLibs;
|
|
17
|
+
parseAsync(obj: any, { compress, dracoOptions, ...options }: {
|
|
18
|
+
compress: boolean;
|
|
19
|
+
dracoOptions?: EncoderOptions;
|
|
20
|
+
} & GLTFExporter2Options): Promise<Blob>;
|
|
21
|
+
addExtension(extension: typeof Extension): this;
|
|
22
|
+
createAndAddExtension(name: string, textures?: Record<string, string | number>): this;
|
|
23
|
+
}
|
|
24
|
+
declare module 'threepipe' {
|
|
25
|
+
interface GLTFExporter2Options {
|
|
26
|
+
compress?: boolean;
|
|
27
|
+
dracoOptions?: EncoderOptions;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
declare abstract class GenericExtension extends Extension {
|
|
31
|
+
abstract readonly extensionName: string;
|
|
32
|
+
textureChannels: Record<string, number>;
|
|
33
|
+
read(context: ReaderContext): this;
|
|
34
|
+
write(context: WriterContext): this;
|
|
35
|
+
}
|
|
36
|
+
export declare function createGenericExtensionClass(name: string, textures?: Record<string, string | number>): typeof GenericExtension;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=GLTFDracoExporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLTFDracoExporter.d.ts","sourceRoot":"","sources":["../src/GLTFDracoExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAMT,aAAa,EAKb,aAAa,EAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAC,cAAc,EAAC,MAAM,oEAAoE,CAAA;AAEjG,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAA6B,aAAa,EAAC,MAAM,WAAW,CAAA;AAErH;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,aAAc,YAAW,aAAa;IAClE,MAAM,CAAC,EAAE,YAAY,CAAA;IAC5B,OAAO,CAAC,GAAG,CAAO;IAClB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,eAAe,CAAgB;gBAE3B,cAAc,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,YAAY;IAoBlE,OAAO,IAAI,IAAI;YAKD,SAAS;IAejB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,EAAC,QAAgB,EAAE,YAAY,EAAE,GAAG,OAAO,EAAC,EAAE;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,cAAc,CAAA;KAAC,GAAG,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyDlK,YAAY,CAAC,SAAS,EAAE,OAAO,SAAS,GAAG,IAAI;IAI/C,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAC,MAAM,CAAC,GAAG,IAAI;CAGtF;AAED,OAAO,QAAQ,WAAW,CAAA;IACtB,UAAU,oBAAoB;QAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,YAAY,CAAC,EAAE,cAAc,CAAA;KAChC;CACJ;AAoHD,uBAAe,gBAAiB,SAAQ,SAAS;IAC7C,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAEvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IAE5C,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAkElC,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CAqEtC;AAWD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAC,MAAM,CAAC,GAAG,OAAO,gBAAgB,CAU3H"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Name: property-graph
|
|
2
|
+
Version: 1.3.1
|
|
3
|
+
License: MIT
|
|
4
|
+
Private: false
|
|
5
|
+
Description: Base for creating objects that behave like a Property Graph.
|
|
6
|
+
Repository: undefined
|
|
7
|
+
Author: Don McCurdy <dm@donmccurdy.com>
|
|
8
|
+
License Copyright:
|
|
9
|
+
===
|
|
10
|
+
|
|
11
|
+
The MIT License (MIT)
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2021 Don McCurdy
|
|
14
|
+
|
|
15
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
in the Software without restriction, including without limitation the rights
|
|
18
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
furnished to do so, subject to the following conditions:
|
|
21
|
+
|
|
22
|
+
The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
copies or substantial portions of the Software.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
SOFTWARE.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
Name: @gltf-transform/core
|
|
37
|
+
Version: 3.2.1
|
|
38
|
+
License: MIT
|
|
39
|
+
Private: false
|
|
40
|
+
Description: glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
|
|
41
|
+
Repository: undefined
|
|
42
|
+
Homepage: https://gltf-transform.donmccurdy.com/
|
|
43
|
+
Author: Don McCurdy <dm@donmccurdy.com>
|
|
44
|
+
License Copyright:
|
|
45
|
+
===
|
|
46
|
+
|
|
47
|
+
The MIT License (MIT)
|
|
48
|
+
|
|
49
|
+
Copyright (c) 2023 Don McCurdy
|
|
50
|
+
|
|
51
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
52
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
53
|
+
in the Software without restriction, including without limitation the rights
|
|
54
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
55
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
56
|
+
furnished to do so, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
The above copyright notice and this permission notice shall be included in all
|
|
59
|
+
copies or substantial portions of the Software.
|
|
60
|
+
|
|
61
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
62
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
63
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
64
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
65
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
66
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
67
|
+
SOFTWARE.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
Name: ktx-parse
|
|
73
|
+
Version: 0.5.0
|
|
74
|
+
License: MIT
|
|
75
|
+
Private: false
|
|
76
|
+
Description: KTX 2.0 (.ktx2) parser and serializer.
|
|
77
|
+
Repository: undefined
|
|
78
|
+
Author: Don McCurdy <dm@donmccurdy.com>
|
|
79
|
+
License Copyright:
|
|
80
|
+
===
|
|
81
|
+
|
|
82
|
+
The MIT License (MIT)
|
|
83
|
+
|
|
84
|
+
Copyright (c) 2020 Don McCurdy
|
|
85
|
+
|
|
86
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
87
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
88
|
+
in the Software without restriction, including without limitation the rights
|
|
89
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
90
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
91
|
+
furnished to do so, subject to the following conditions:
|
|
92
|
+
|
|
93
|
+
The above copyright notice and this permission notice shall be included in all
|
|
94
|
+
copies or substantial portions of the Software.
|
|
95
|
+
|
|
96
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
97
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
98
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
99
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
100
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
101
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
102
|
+
SOFTWARE.
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
Name: @gltf-transform/extensions
|
|
108
|
+
Version: 3.2.1
|
|
109
|
+
License: MIT
|
|
110
|
+
Private: false
|
|
111
|
+
Description: Adds extension support to @gltf-transform/core
|
|
112
|
+
Repository: undefined
|
|
113
|
+
Homepage: https://gltf-transform.donmccurdy.com/extensions.html
|
|
114
|
+
Author: Don McCurdy <dm@donmccurdy.com>
|
|
115
|
+
License Copyright:
|
|
116
|
+
===
|
|
117
|
+
|
|
118
|
+
The MIT License (MIT)
|
|
119
|
+
|
|
120
|
+
Copyright (c) 2023 Don McCurdy
|
|
121
|
+
|
|
122
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
123
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
124
|
+
in the Software without restriction, including without limitation the rights
|
|
125
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
126
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
127
|
+
furnished to do so, subject to the following conditions:
|
|
128
|
+
|
|
129
|
+
The above copyright notice and this permission notice shall be included in all
|
|
130
|
+
copies or substantial portions of the Software.
|
|
131
|
+
|
|
132
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
133
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
134
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
135
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
136
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
137
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
138
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,2BAA2B,EAAC,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAA"}
|