donmccurdy / donmccurdy/glTF-Transform

Support transforms reporting a 'skip' result

Open
#1,406 0 comments 0 reactions 0 assignees View on GitHub
feature package:cli package:functions
Dominant language
TypeScript
Stars
2k
Forks
206
Avg merge
2d 2h
Merged PRs (30d)
16

Description

In many cases transforms complete without doing anything. Examples include `resample()` on a model with no animation, or `textureCompress()` on a model with no textures.

If a model quits early with nothing to do, it'd be nice if there were some API for it to report that result. This could be shown in the CLI output, for example,

**Before:**

```bash
> gltf-transform optimize in.glb out.glb

✔ dedup 731ms
✔ instance 1ms
✔ palette 27ms
✔ flatten 1ms
✔ join 1,115ms
✔ weld 23ms
✔ simplify 26ms
✔ resample 0ms
✔ prune 0ms
✔ sparse 9ms
✔ textureCompress 0ms
✔ meshopt 40ms
```

**After:**

```bash
> gltf-transform optimize in.glb out.glb

✔ dedup 731ms
✔ instance –
✔ palette 27ms
✔ flatten 1ms
✔ join 1,115ms
✔ weld 23ms
✔ simplify 26ms
✔ resample –
✔ prune 0ms
✔ sparse 9ms
✔ textureCompress –
✔ meshopt 40ms
```

In some cases it might take a transform a non-trivial amount of time to determine that it can't do anything ... TBD how that should be handled, and whether the CLI should display the time or a `-`.

Contributor guide

Open the contributing guide

Research direction

Start at the `gltf-transform optimize` CLI entry point and trace how transforms report completion and elapsed time. Review the transform API behavior for early exits such as `resample()` and `textureCompress()`; done requires agreeing on a skip result and defining whether the CLI displays a dash or elapsed time. No files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.