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

Feature request: preview enhancements #266

Open mr0x13f opened 1 month ago

mr0x13f commented 1 month ago

Based on my workflow I came up with four enhancements for the glTF preview I think would be a good fit.

1 Add preview settings to extension settings

The options available as part of the glTF preview (toggling the background, debug mode, render grid etc) are not extension settings and therefore get reset every time a preview is opened. Adding these as extension settings would be more convenient.

2 Allow for opening .gltf and .glb files as the preview by default

For markdown files, VSCode allows for setting the default editor as the markdown preview with workbench.editorAssociations. It would be great to be able to do the same for the glTF preview. I find myself opening a .gltf file to preview it much more often than to edit it as text.

3 Automatically refresh on file change

I would like to see the preview refresh automatically when the model file on disk changes from being re-exported or edited. Currently the preview needs to be manually closed and reopened, or the "Developer: Reload Webviews" command needs to be used. Combined with the fact preview options aren't saved, this can get pretty cumbersome.

4 Add ruler overlay and/or reference model

I find myself often wanting to check whether a model is at the right scale. Currently I'm having to open Blender or Godot for this. This could be done from the glTF preview if the preview had the option to display a ruler next to the model. It would be even better to also have the option to specify a scale reference model of sorts in the settings, to be rendered alongside the model.

gltftools_previewmockup

Thanks!