OSS stands for Object Storage Service which enables you to store your files on Forge and do further processing on them using other services like the Model Derivative Service
This utility app lets you to see and create new buckets on OSS, upload and download files, convert them to other formats, view them online and quesry meta data from them
https://oss-manager.autodesk.io
The first time you use this app with the credentials of a given Forge app, it will generate all the neccessary app bundles and activities:
If app bundles and activities with the specific names already exist for the given Forge app then they will not be overwritten with the correct ones. The best thing is to create a new Forge app and use its credentials with this sample app.
On the left side you'll find all the OSS related functionality: listing all your buckets and files, creating new buckets, uploading/downloading files \ When translating to the OBJ format then what will be included in that file depends on the object selection in the Hieararchy Tree (if no object is selected then the whole file will be translated) - all other translations will translate the whole file no matter which objects are selected
In the center you'll find all the Model Derivative functionality: showing the hierarchy of objects inside the file, providing translations available for the given file, and showing meta data for selected component \ Using the Delete button you can delete the current manifest of the file - it can be useful if the translation failed for a given file and you want to try it again (maybe in the meantime you also uploaded a new version of the file under the same name so you do need a new translatoin)
On the right side you'll find the Forge Viewer that will display the model in its default format: may that be 2D or 3D
Install NodeJS.
Clone this project or download it. It's recommended to install GitHub desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):
git clone https://github.com/Autodesk-Forge/forge-buckets-tools
To run it, install the required packages, set the enviroment variables with your client ID & secret and finally start it. Via command line, navigate to the folder where this repository was cloned and use the following:
Mac OSX/Linux (Terminal) / Windows (use Node.js command line from Start menu)
npm install
npm start
Open the browser: http://localhost:3000.
Important: when testing locally, comment out the app.use(enforce.HTTPS({ trustProtoHeader: true }));
line in the server.js
file before running the app, since we won't be using HTTPS, only HTTP
To deploy this application to Heroku, the Callback URL for Forge must use your .herokuapp.com
address. After clicking on the button below, at the Heroku Create New App page, set your Client ID, Secret and Callback URL for Forge.
Watch this video on how deploy samples to Heroku.
All Autodesk Forge NPM packages are included by default, see complete list of what's available at NPM website. OAuth, Model Derivative and OSS are used. Some other non-Autodesk packaged are used, including express and its session/cookie middlewares (express-session and cookie-parser) for user session handling. The front-end uses bootsrap and jquery.
For local development/testing, consider use nodemon package, which auto restart your node application after any modification on your code. To install it, use:
sudo npm install -g nodemon
Then, instead of npm run dev, use the following:
npm run nodemon
Which executes nodemon server.js --ignore www/, where the --ignore parameter indicates that the app should not restart if files under www folder are modified.
Documentation:
Tutorials:
Blogs:
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Adam Nagy (Forge Partner Development)
http://forge.autodesk.com