You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can get your developer API key from the Cognitive3D web dashboard. Look for the "Manage developer key" option in the settings (gear icon) menu.
43
+
#### Parameters
53
44
54
-
> Note: We strongly recommend you _do not_ store your developer API key in version control.
45
+
*`--scene_dir <scene_directory>` (required): Path to a folder containing:
46
+
*`scene.bin`
47
+
*`scene.gltf`
48
+
*`screenshot.png`
49
+
*`settings.json`
50
+
*`[--env <prod/dev>]` (optional): Either `prod` (default) or `dev`
51
+
*`[--scene_id <scene_id_from_dashboard>]` (optional): Scene ID to append to the API endpoint to upload a new version of an existing scene
55
52
56
53
### Example
57
54
58
55
For the first time you upload your scene you won't have a scene ID, so we don't pass that parameter. The first time you run this script, without a scene ID, it creates the scene and returns the new scene ID (output to the console at the end of the script.)
For subsequent (new) versions of the same scene, pass in your scene ID as the third parameter to the script. This will upload the scene assets again and the platform will auto-increment the scene version.
66
63
67
64
You can find the scene ID on the Cognitive3D dashboard on the Scenes page. Look for the "information" icon (letter 'i' in a circle) and hover over it.
This Bash script uploads dynamic 3D object assets to the Cognitive3D platform, supporting GLTF + BIN files, optional textures, and thumbnail metadata. It supports both development and production environments.
89
+
90
+
Uploading a scene to the platform is required before you can upload any dynamic object models. The scene_id is a required parameter.
91
+
92
+
### Dynamic object uploader usage
93
+
94
+
```bash
95
+
./upload-object.sh \
96
+
--scene_id <scene-uuid> \
97
+
--object_filename <object-name> \
98
+
--object_dir <path-to-object-directory> \
99
+
[--object_id <existing-object-id>] \
100
+
[--env dev|prod] \
101
+
[--verbose] \
102
+
[--dry_run]
103
+
```
104
+
105
+
#### Required Parameters
106
+
107
+
*`--scene_id`: The Scene ID UUID where the object will be uploaded.
108
+
*`--object_filename`: The base filename (no extension) of the object, used to find `.gltf` and `.bin` files.
109
+
*`--object_dir`: The directory containing the object files.
110
+
111
+
#### Optional Parameters
112
+
113
+
*`--object_id`: If specified, uploads as a new version of an existing object.
114
+
*`--env`: Target environment (`prod` or `dev`). Defaults to `prod`.
115
+
*`--verbose`: Enables detailed logging.
116
+
*`--dry_run`: Prints the constructed `curl` command but skips execution.
117
+
118
+
### Dynamic object uploader environment variables
119
+
120
+
*`C3D_DEVELOPER_API_KEY`: Your Cognitive3D Developer API key (required).
121
+
122
+
### File Requirements
123
+
124
+
The following files must exist in the `--object_dir`:
125
+
126
+
*`<object_filename>.gltf`
127
+
*`<object_filename>.bin`
128
+
* (Optional, recommended) `cvr_object_thumbnail.png`, a representative screenshot of the object; used by the dashboard
129
+
* (Optional) Any additional `.png` textures used by the model
130
+
131
+
### Dynamic object uploader example
132
+
133
+
```bash
134
+
export C3D_DEVELOPER_API_KEY=<your-api-key>
135
+
136
+
./upload-object.sh \
137
+
--scene_id <scene_id_goes_here> \
138
+
--object_filename cube \
139
+
--object_dir object-test \
140
+
--env prod \
141
+
--object_id cube
142
+
--verbose
143
+
```
144
+
145
+
### Exit Codes
146
+
147
+
*`0`: Success
148
+
*`1`: Missing argument or setup error
149
+
* Non-zero: Returned by `curl` if upload fails
150
+
151
+
### Logging
152
+
153
+
*`--verbose` prints detailed steps
154
+
*`--dry_run` shows the `curl` command without executing it
155
+
* Colored output highlights info, warnings, errors, and debug details
156
+
157
+
### Uploading the object manifest
158
+
159
+
After uploading the dynamic object asset files (mesh, textures) you must upload the dynamic object manifest file to display the objects on the Cognitive3D dashboard for your project and scene.
160
+
161
+
### Dynamic object manifest uploader usage
162
+
163
+
The dynamic object manifest for your scene and object is created automatically after successfully uploading the dynamic object assets. It will be in a file named `<scene_id>_object_manifest.json`.
The following files must exist in the same directory where you are calling the script from:
190
+
191
+
*`<scene_id>_object_manifest.json`, which is automatically created after successfully uploading your dynamic object meshes
192
+
193
+
### Dynamic object manifest uploader example
194
+
195
+
```bash
196
+
export C3D_DEVELOPER_API_KEY=<your-api-key>
197
+
198
+
./upload-object-manifest.sh \
199
+
--scene_id <scene_id_goes_here> \
200
+
--env prod \
201
+
--verbose
202
+
```
203
+
204
+
The reason we don't automatically upload the manifest after uploading the object assets is to allow you to modify the manifest JSON before uploading.
205
+
206
+
If you have any questions or problems using these scripts contact our customer support team using the Intercom button (public circle) on any Cognitive3D web page.
0 commit comments