Skip to content

Commit ed44f61

Browse files
committed
fix(plugin): adjust draco schema again
1 parent 7dced66 commit ed44f61

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

libs/plugin/src/generators/gltf/gltf.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface GltfGeneratorSchema {
77
output: string;
88
className: string;
99
selectorPrefix: string;
10-
draco: string;
10+
draco: boolean;
1111
bones: boolean;
1212
meta: boolean;
1313
shadows: boolean;
@@ -65,7 +65,12 @@ function normalizeOptions(tree: Tree, options: GltfGeneratorSchema, gltfJsx: typ
6565
const modelPathFromRoot = join(tree.root, options.modelPath);
6666
const outputDir = dirname(options.output);
6767

68-
const injectGLTFOptions = options.transform ? `{ useDraco: ${options.draco === 'true'} }` : '';
68+
const injectGLTFOptions =
69+
options.transform && options.draco != null
70+
? `{ useDraco: ${options.draco} }`
71+
: options.transform
72+
? '{ useDraco: true }'
73+
: '';
6974

7075
const selector = `${options.selectorPrefix}-${fileName}`;
7176

libs/plugin/src/generators/gltf/schema.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@
3434
"x-prompt": "Enter the prefix to use for the generated component selector (default: app)"
3535
},
3636
"draco": {
37-
"type": "string",
38-
"enum": ["true", "false", ""],
37+
"type": "boolean",
3938
"description": "Use DracoLoader",
40-
"alias": "d",
41-
"default": ""
39+
"alias": "D",
40+
"default": null
4241
},
4342
"bones": {
4443
"type": "boolean",

0 commit comments

Comments
 (0)