petrbroz / vscode-forge-tools

Visual Studio Code extension for accessing Autodesk Forge services and content.
https://marketplace.visualstudio.com/items?itemName=petrbroz.vscode-forge-tools
MIT License
75 stars 17 forks source link

Non svf(2) model derivatives #75

Closed CADBIMDeveloper closed 9 months ago

CADBIMDeveloper commented 1 year ago

Hi @petrbroz ,

In this PR I added a support for non-SVF(2) translations using Model Derivative service:

  1. Show the derivatives in the tree if they are not SVF or SVF2
  2. Add an ability to download such files using context menu or a command Treeview
  3. Add an ability to select target available output file format from the list in the custom translation dialog Custom translation (SVF2 is still a default option if it's available there)
petrbroz commented 9 months ago

Thank you @CADBIMDeveloper, the code changes look good :+1:. I think the "Custom Translation" webview will need an overhaul (e.g., only showing output types available for a specific input format, allowing multiple output types, etc.), and this PR is moving in the right direction.

CADBIMDeveloper commented 9 months ago

Hi @petrbroz src/providers/model-derivative.ts does the trick, it queries available translations and provides findAvailableOutputFormats method https://github.com/petrbroz/vscode-forge-tools/blob/068b6ba65be1acf2cdace247c4e587b445db6064/src/providers/model-derivative.ts#L34C10-L34C10 which is used to filter supported translations