angular-three 2.0.0-beta.300 → 2.0.0-beta.302
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/esm2022/lib/renderer/index.mjs +6 -2
- package/fesm2022/angular-three.mjs +4 -0
- package/fesm2022/angular-three.mjs.map +1 -1
- package/package.json +8 -2
- package/plugin/generators.json +1 -11
- package/plugin/src/generators/gltf/compat.d.ts +0 -2
- package/plugin/src/generators/gltf/compat.js +0 -6
- package/plugin/src/generators/gltf/compat.js.map +0 -1
- package/plugin/src/generators/gltf/files/__fileName__.ts__tmpl__ +0 -36
- package/plugin/src/generators/gltf/generator.d.ts +0 -12
- package/plugin/src/generators/gltf/generator.js +0 -125
- package/plugin/src/generators/gltf/generator.js.map +0 -1
- package/plugin/src/generators/gltf/schema.json +0 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-three",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.302",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,7 +25,13 @@
|
|
|
25
25
|
"@angular/common": ">=18.0.0 <19.0.0",
|
|
26
26
|
"@angular/core": ">=18.0.0 <19.0.0",
|
|
27
27
|
"ngxtension": ">=3.0.0",
|
|
28
|
-
"three": ">=0.148.0 <0.168.0"
|
|
28
|
+
"three": ">=0.148.0 <0.168.0",
|
|
29
|
+
"node-three-gltf": ">=1.0.0 <2.0.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"node-three-gltf": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
29
35
|
},
|
|
30
36
|
"dependencies": {
|
|
31
37
|
"tslib": "^2.3.0",
|
package/plugin/generators.json
CHANGED
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
"factory": "./src/generators/add-soba/generator",
|
|
11
11
|
"schema": "./src/generators/add-soba/schema.json",
|
|
12
12
|
"description": "Add angular-three-soba to your project"
|
|
13
|
-
},
|
|
14
|
-
"gltf": {
|
|
15
|
-
"factory": "./src/generators/gltf/generator",
|
|
16
|
-
"schema": "./src/generators/gltf/schema.json",
|
|
17
|
-
"description": "gltf generator"
|
|
18
13
|
}
|
|
19
14
|
},
|
|
20
15
|
"schematics": {
|
|
@@ -27,11 +22,6 @@
|
|
|
27
22
|
"factory": "./src/generators/add-soba/compat",
|
|
28
23
|
"schema": "./src/generators/add-soba/schema.json",
|
|
29
24
|
"description": "Add angular-three-soba to your project"
|
|
30
|
-
}
|
|
31
|
-
"gltf": {
|
|
32
|
-
"factory": "./src/generators/gltf/compat",
|
|
33
|
-
"schema": "./src/generators/gltf/schema.json",
|
|
34
|
-
"description": "gltf generator"
|
|
35
|
-
}
|
|
25
|
+
}
|
|
36
26
|
}
|
|
37
27
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@nx/devkit");
|
|
4
|
-
const generator_1 = require("./generator");
|
|
5
|
-
exports.default = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
6
|
-
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/gltf/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,2CAAwC;AAExC,kBAAe,IAAA,2BAAkB,EAAC,mBAAa,CAAC,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CUSTOM_ELEMENTS_SCHEMA, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { extend, NgtGroup } from 'angular-three';
|
|
3
|
-
import { injectGLTF } from 'angular-three-soba/loaders';
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { GLTF } from 'three-stdlib';
|
|
6
|
-
|
|
7
|
-
interface <%= className %>GLTFResult extends GLTF {
|
|
8
|
-
nodes: {},
|
|
9
|
-
materials: {}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface <%= className %>Options extends Partial<NgtGroup> {
|
|
13
|
-
/* more options */
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@Component({
|
|
17
|
-
selector: '<%= selector %>',
|
|
18
|
-
standalone: true,
|
|
19
|
-
template: `
|
|
20
|
-
@if (gltf(); as gltf) {
|
|
21
|
-
<ngt-group [dispose]="null" [parameters]="options()">
|
|
22
|
-
</ngt-group>
|
|
23
|
-
}
|
|
24
|
-
`,
|
|
25
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
26
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
-
})
|
|
28
|
-
export class <%= className %> {
|
|
29
|
-
options = input({} as <%= className %>Options);
|
|
30
|
-
|
|
31
|
-
gltf = injectGLTF(() => '<%= runtimeGltfPath %>') as Signal<<%= className %>GLTFResult | null>;
|
|
32
|
-
|
|
33
|
-
constructor() {
|
|
34
|
-
extend({ Group: THREE.Group });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
export interface GltfGeneratorSchema {
|
|
3
|
-
gltfPath: string;
|
|
4
|
-
project: string;
|
|
5
|
-
console: boolean;
|
|
6
|
-
modelName: string;
|
|
7
|
-
meshopt: boolean;
|
|
8
|
-
outputPath?: string;
|
|
9
|
-
draco?: boolean | string;
|
|
10
|
-
}
|
|
11
|
-
export declare function gltfGenerator(tree: Tree, options: GltfGeneratorSchema): Promise<void>;
|
|
12
|
-
export default gltfGenerator;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gltfGenerator = gltfGenerator;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const enquirer_1 = require("enquirer");
|
|
6
|
-
const node_fs_1 = require("node:fs");
|
|
7
|
-
const three_stdlib_1 = require("three-stdlib");
|
|
8
|
-
const generator_1 = require("../add-soba/generator");
|
|
9
|
-
function normalizeOptions(options) {
|
|
10
|
-
let { gltfPath, project, console, modelName, outputPath, draco, meshopt } = options;
|
|
11
|
-
if (draco == null) {
|
|
12
|
-
draco = true;
|
|
13
|
-
}
|
|
14
|
-
return { gltfPath, project, console, modelName, outputPath, draco, meshopt };
|
|
15
|
-
}
|
|
16
|
-
function buildSelector(fileName, prefix) {
|
|
17
|
-
return `${prefix}-${fileName}`;
|
|
18
|
-
}
|
|
19
|
-
function toArrayBuffer(buf) {
|
|
20
|
-
const ab = new ArrayBuffer(buf.length);
|
|
21
|
-
const view = new Uint8Array(ab);
|
|
22
|
-
for (let i = 0; i < buf.length; ++i)
|
|
23
|
-
view[i] = buf[i];
|
|
24
|
-
return ab;
|
|
25
|
-
}
|
|
26
|
-
let dracoLoader = null;
|
|
27
|
-
let decoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/';
|
|
28
|
-
const loader = new three_stdlib_1.GLTFLoader();
|
|
29
|
-
function load(input, draco, meshopt) {
|
|
30
|
-
if (draco) {
|
|
31
|
-
if (!dracoLoader) {
|
|
32
|
-
dracoLoader = new three_stdlib_1.DRACOLoader();
|
|
33
|
-
}
|
|
34
|
-
dracoLoader.setDecoderPath(typeof draco === 'string' ? draco : decoderPath);
|
|
35
|
-
loader.setDRACOLoader(dracoLoader);
|
|
36
|
-
}
|
|
37
|
-
if (meshopt) {
|
|
38
|
-
loader.setMeshoptDecoder(typeof three_stdlib_1.MeshoptDecoder === 'function' ? (0, three_stdlib_1.MeshoptDecoder)() : three_stdlib_1.MeshoptDecoder);
|
|
39
|
-
}
|
|
40
|
-
const data = input.startsWith('http')
|
|
41
|
-
? null
|
|
42
|
-
: (() => {
|
|
43
|
-
const fileContent = (0, node_fs_1.readFileSync)(input);
|
|
44
|
-
return toArrayBuffer(fileContent);
|
|
45
|
-
})();
|
|
46
|
-
const operationFactory = (onLoad, onError) => {
|
|
47
|
-
return input.startsWith('http')
|
|
48
|
-
? loader.load.call(loader, input, onLoad, () => { }, onError)
|
|
49
|
-
: loader.parse.call(loader, data, input, onLoad, onError);
|
|
50
|
-
};
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
operationFactory(resolve, reject);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async function gltfGenerator(tree, options) {
|
|
56
|
-
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
57
|
-
const hasAngularThreeSoba = packageJson['dependencies']['angular-three-soba'] || packageJson['devDependencies']['angular-three-soba'];
|
|
58
|
-
if (!hasAngularThreeSoba) {
|
|
59
|
-
devkit_1.logger.warn(`[NGT] angular-three-soba must be installed to use the GLTF generator`);
|
|
60
|
-
const { initSoba } = await (0, enquirer_1.prompt)({
|
|
61
|
-
type: 'confirm',
|
|
62
|
-
name: 'initSoba',
|
|
63
|
-
message: 'Would you like to initialize angular-three-soba?',
|
|
64
|
-
initial: true,
|
|
65
|
-
});
|
|
66
|
-
if (!initSoba)
|
|
67
|
-
return;
|
|
68
|
-
await (0, generator_1.addSobaGenerator)(tree);
|
|
69
|
-
}
|
|
70
|
-
try {
|
|
71
|
-
// const injectGLTF = await loadEsmModule<typeof import('angular-three-soba/loaders')>(
|
|
72
|
-
// 'angular-three-soba/loaders',
|
|
73
|
-
// ).then((m) => m.injectGLTF);
|
|
74
|
-
// // const injectGLTF = await import('angular-three-soba/loaders').then((m) => m.injectGLTF);
|
|
75
|
-
// const injectGLTF = require('angular-three-soba/loaders').injectGLTF;
|
|
76
|
-
const { gltfPath, project, console: toConsole, modelName, outputPath, draco, meshopt } = normalizeOptions(options);
|
|
77
|
-
let runtimeGltfPath;
|
|
78
|
-
if (!gltfPath.startsWith('http')) {
|
|
79
|
-
const { path } = await (0, enquirer_1.prompt)({
|
|
80
|
-
type: 'input',
|
|
81
|
-
name: 'path',
|
|
82
|
-
message: 'What is the path to the asset file to be used at runtime (with injectGLTF)?',
|
|
83
|
-
required: true,
|
|
84
|
-
});
|
|
85
|
-
runtimeGltfPath = path;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
runtimeGltfPath = gltfPath;
|
|
89
|
-
}
|
|
90
|
-
await load(runtimeGltfPath, draco, meshopt);
|
|
91
|
-
// injectGLTF.preload(() => runtimeGltfPath, {
|
|
92
|
-
// useDraco: draco,
|
|
93
|
-
// useMeshOpt: meshopt,
|
|
94
|
-
// onLoad: (data) => {
|
|
95
|
-
// console.log('data', data);
|
|
96
|
-
// },
|
|
97
|
-
// });
|
|
98
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
99
|
-
const modelNames = (0, devkit_1.names)(modelName);
|
|
100
|
-
const tmpPath = `${devkit_1.workspaceRoot}/tmp/ngt-gltf/${modelNames.fileName}`;
|
|
101
|
-
const output = toConsole ? tmpPath : (outputPath ?? (projectConfig.sourceRoot || `${projectConfig.root}/src`));
|
|
102
|
-
// NOTE: even if user passes in "console", we still generate the files.
|
|
103
|
-
// But we generate them to a temporary destination then we'll remove them printing to console.
|
|
104
|
-
// generateFiles(tree, 'files', output, {
|
|
105
|
-
// tmpl: '',
|
|
106
|
-
// fileName: modelNames.fileName,
|
|
107
|
-
// className: modelNames.className,
|
|
108
|
-
// selector: buildSelector(
|
|
109
|
-
// modelNames.fileName,
|
|
110
|
-
// 'prefix' in projectConfig && typeof projectConfig.prefix === 'string' ? projectConfig.prefix : 'app',
|
|
111
|
-
// ),
|
|
112
|
-
// runtimeGltfPath,
|
|
113
|
-
// });
|
|
114
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
115
|
-
if (toConsole) {
|
|
116
|
-
// print to console
|
|
117
|
-
// delete the files in tmp
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
catch (e) {
|
|
121
|
-
devkit_1.logger.error(`[NGT] Error generating GLTF files: ${e}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.default = gltfGenerator;
|
|
125
|
-
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/gltf/generator.ts"],"names":[],"mappings":";;AAwEA,sCA6EC;AArJD,uCAAiH;AACjH,uCAAkC;AAClC,qCAAuC;AACvC,+CAAuE;AACvE,qDAAyD;AAYzD,SAAS,gBAAgB,CAAC,OAA4B;IACrD,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEpF,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,KAAK,GAAG,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC9E,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB,EAAE,MAAc;IACtD,OAAO,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;AAChC,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IACjC,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,EAAE,CAAC;AACX,CAAC;AAED,IAAI,WAAW,GAAuB,IAAI,CAAC;AAC3C,IAAI,WAAW,GAAG,yDAAyD,CAAC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id": "Gltf",
|
|
4
|
-
"title": "",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"gltfPath": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "Where is your gltf file located?"
|
|
15
|
-
},
|
|
16
|
-
"project": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "The name of the project to generate the model component for.",
|
|
19
|
-
"x-prompt": "What project would you like to generate the model component for?",
|
|
20
|
-
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$",
|
|
21
|
-
"x-dropdown": "projects",
|
|
22
|
-
"x-priority": "important"
|
|
23
|
-
},
|
|
24
|
-
"console": {
|
|
25
|
-
"type": "boolean",
|
|
26
|
-
"description": "Print to console instead of writing to file",
|
|
27
|
-
"default": false
|
|
28
|
-
},
|
|
29
|
-
"modelName": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "Name of the model",
|
|
32
|
-
"default": "Model"
|
|
33
|
-
},
|
|
34
|
-
"outputPath": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"description": "The output path of the generated component",
|
|
37
|
-
"alias": ["o", "output"]
|
|
38
|
-
},
|
|
39
|
-
"draco": {
|
|
40
|
-
"oneOf": [
|
|
41
|
-
{
|
|
42
|
-
"type": "boolean",
|
|
43
|
-
"description": "Use Draco compression"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "Use Draco compression with a specific path"
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
"meshopt": {
|
|
52
|
-
"type": "boolean",
|
|
53
|
-
"description": "Use Meshopt compression",
|
|
54
|
-
"default": true
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"required": ["gltfPath", "project"]
|
|
58
|
-
}
|