In src/env.js
, there's declaration for Shotgun URL.
const baseUrl = '<shotgun_url>'
To access to Shotgun, you have to set credential info to src/env.js
.
Basic access uses Shotgun script/api-key info with Grant Type: client_credentials
.
However there's other Grant Types to access with REST API. The document is here.
'use strict'
const credentialParams = {
'client_id': '<script_name>',
'client_secret': '<api_key>',
'grant_type': 'client_credentials'
}
module.exports = credentialParams
'use strict'
const credentialParams = {
'username': '<your_username>',
'password': '<your_password>',
'grant_type': 'password'
}
module.exports = credentialParams
npm install
npm run build
docker build -t sg-3d-previewer .
docker run -p 9080:9080 -d sg-3d-previewer
Then, accessing on a browser at http://localhost:9080 .
- Create
sg_preview_geometry
fileld on Version entity. - Open a design page at Asset entity item page.
- Add new URL type tab.
- Insert URL with query:
Query Name | Value | Required/Optional | Description |
---|---|---|---|
assetId (Int) | {id} | Required | Asset ID to recognize which asset will be displayed. |
envmap (Int) | 0,1,2 | Optional | Set default Environment map from defined set. |
- Create Version entity item with a preview geoemtry file [.glt, .glb, .fbx].
- Open the tab previously created.
npm run dev
To test server with routing:
cd serve
npm install
npm start (This is also available at root level)
- Currently Embded(textures) or Binary type of GLTF file is only supported, for GLTF file format.
- Loading lights also works as FBX scene loading.