petrbroz / svf-utils

Utilities for working with the SVF file format used by Autodesk Platform Services.
https://petrbroz.github.io/svf-utils/
MIT License
122 stars 51 forks source link

Request failed with status code 401 #31

Open DominikJanecky opened 3 years ago

DominikJanecky commented 3 years ago

Hello, I can't get through the following error (picture) even though I checked the client, secret id and URN of the model several times and they are entered correctly in the script. Would you please help me in some way with this error?

image

I have no problem with the classic bash method: set FORGE_CLIENT_ID= set FORGE_CLIENT_SECRET= forge-convert --output-folder

But when I try node JS method I cant process this script.

I will be very grateful for any help.

petrbroz commented 3 years ago

Hi @DominikJanecky, the 401 error indicates problems with authentication. Are you sure that you're using the same Forge credentials and model URN as when using the converter from bash?

DominikJanecky commented 3 years ago

Hi @petrbroz, yeah problem was on my side, because I´m have created forge app only on "https://forge.autodesk.com/myapps/" and I didn't know I had to create an app in "admin.b360.autodesk.com" too... Now I can process the 3D model with nodejs method without errors but now I have problem with incomplete output... When I processed 3D model with bash converter everything looks great my output looks like that: image But when I use a nodejs script for the same 3D model (same URN), my output is incomplete as if only part of the model was processed. The size of the "gltf" file is much smaller and "bin" files are also missing. As if only part of that 3D model had been processed. image Please do not know where the problem may occur. I didn't change anything in the script except to read the client ID and secret ID ... then I tried basic changes such as "deduplicate" and "skipunusedUVS" and other minor changes, but it didn't change my output.

petrbroz commented 3 years ago

That's strange... the command-line tool uses the exact same Node.js code under the hood so it should yield the same results. Can you share the Node.js code snippet that's responsible for the conversion? And are the two output files actually valid (i.e., can those be viewed in some glTF viewer)?

One idea that comes to mind is that the conversion is perhaps not "awaited" and exits before Node.js can download and convert everything?