Skip to content

Commit

Permalink
feat(cli): Add optimize CLI flags for keepNamed and keepMeshes (#1551)
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-chemla authored Nov 19, 2024
1 parent ac5128c commit 46ad981
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ commands or using the scripting API.
validator: Validator.BOOLEAN,
default: true,
})
.option('--join-keep-meshes <bool>', 'Prevents joining distinct Meshes and Nodes.', {
validator: Validator.BOOLEAN,
default: JOIN_DEFAULTS.keepMeshes,
})
.option('--join-keep-named <bool>', 'Prevents joining named Meshes and Nodes.', {
validator: Validator.BOOLEAN,
default: JOIN_DEFAULTS.keepNamed,
})
.option('--weld <bool>', 'Merge equivalent vertices. Required when simplifying geometry.', {
validator: Validator.BOOLEAN,
default: true,
Expand All @@ -360,6 +368,8 @@ commands or using the scripting API.
textureSize: number;
flatten: boolean;
join: boolean;
joinKeepNamed: boolean;
joinKeepMeshes: boolean;
weld: boolean;
};

Expand All @@ -378,7 +388,14 @@ commands or using the scripting API.
}

if (opts.flatten) transforms.push(flatten());
if (opts.join) transforms.push(join());
if (opts.join) {
transforms.push(
join({
keepNamed: opts.joinKeepNamed,
keepMeshes: opts.joinKeepMeshes,
})
);
}
if (opts.weld) transforms.push(weld());

if (opts.simplify) {
Expand Down

0 comments on commit 46ad981

Please sign in to comment.