AnalyticalGraphicsInc / gltf-vscode

This is an extension for Visual Studio Code to add support for editing glTF files.
Apache License 2.0
441 stars 61 forks source link

Add "Quick Fix" for BUFFER_VIEW_TARGET_MISSING #240

Closed emackey closed 2 years ago

emackey commented 2 years ago

I'm not entirely certain of the utility of this vs. the novelty, but I've added simple logic for a "Quick Fix" of BUFFER_VIEW_TARGET_MISSING.

@lexaknyazev I hope the logic here isn't too simplistic for what it's doing. It expects BUFFER_VIEW_TARGET_MISSING to have been issued on either a primitive attribute or a primitive's indices, and then expects the value at that JSON pointer to be the ID of a valid accessor with a bufferView ID included, and expects that bufferView to be in need of a target of type determined by whether the original key was indices or not, and inserts the value there.

QuickFixAddTarget

This now offers an option to fix all bufferViews in the file.

There is an additional QuickFix for ACCESSOR_JOINTS_USED_ZERO_WEIGHT.

The README has been updated to explain the Quick Fixes.

emackey commented 2 years ago

I'm fairly confident in this now, so I'm merging it. If anyone finds problems, file a new issue please.

emackey commented 2 years ago

This is now published as glTF Tools v2.3.14.