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

Resampling emits unnecessary warning message #399

Closed
viridia opened this issue Oct 27, 2021 · 2 comments · Fixed by #417
Closed

Resampling emits unnecessary warning message #399

viridia opened this issue Oct 27, 2021 · 2 comments · Fixed by #417
Labels
bug Something isn't working package:functions
Milestone

Comments

@viridia
Copy link

viridia commented Oct 27, 2021

Describe the bug

I am using both the resample and dedup plugins, but nevertheless resample still prints a warning advising me to use dedup:

resample: Resampling required copying accessors, some of which may be duplicates. Consider using "dedup" to consolidate any duplicates.

I realize this is a fairly trivial cosmetic bug, but it's causing a bunch of extra console spam in my build script output. I realize that I could shut off all warning messages, but that is not what I want either - it's just this one message that is causing an issue.

To Reproduce

  gltf.transform(resample(), dedup());

Expected behavior

Ideally, the resample plugin would know which other plugins are in the pipeline and suppress the message if dedup is also present.

Versions:

  • Version: 0.12.14
  • Environment: Node v15
@viridia viridia added the bug Something isn't working label Oct 27, 2021
@donmccurdy donmccurdy added this to the Backlog milestone Oct 28, 2021
@donmccurdy
Copy link
Owner

Yeah, I agree it'd be nice to silence this warning... Had been hoping there was a good way to track and/or avoid the duplicate accessors more closely in resample() but that doesn't appear to be easy. Letting the resample function know something about the other functions in the pipeline would be an option, but would need to think about how that would work e.g. with user-provided functions and possibly function names possibly obfuscated by the compiler.

@viridia
Copy link
Author

viridia commented Oct 28, 2021

Normally, I'd suggest some general purpose way to allow functions to "know" about each other, but it seems to me that might not be necessary, because the relationship between resample and dedup is already a special case. This is evident by the fact that resample explicitly names 'dedup' in the text of the message. I don't know if there are any other cases where a function needs to know about the existence of another function.

I haven't looked at the internals of gltf-transform to make any concrete suggestions. However, one random thought is selective filtering of the console output - simply look for that specific string and suppress it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package:functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants