Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimize CLI join flags --join-keep-named and --join-keep-meshes #1551

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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