Spaces:
Sleeping
Sleeping
kolibril13
commited on
Commit
·
34d7aa0
1
Parent(s):
f6fad86
add download
Browse files- pages/01_widget.ipynb +4 -38
pages/01_widget.ipynb
CHANGED
|
@@ -2,45 +2,9 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"metadata": {},
|
| 7 |
-
"outputs": [
|
| 8 |
-
{
|
| 9 |
-
"name": "stdout",
|
| 10 |
-
"output_type": "stream",
|
| 11 |
-
"text": [
|
| 12 |
-
"13:25:11 | ERROR: Draco mesh compression is not available because library could not be found at /Users/jan-hendrik/projects/bpy-sol-interacitve/pages/Resources/3.6/python/lib/python3.10/site-packages/libextern_draco.dylib\n",
|
| 13 |
-
"13:25:11 | INFO: Starting glTF 2.0 export\n",
|
| 14 |
-
"13:25:11 | INFO: Extracting primitive: Cube.017\n",
|
| 15 |
-
"13:25:11 | INFO: Primitives created: 1\n",
|
| 16 |
-
"13:25:11 | INFO: Finished glTF 2.0 export in 0.00244140625 s\n",
|
| 17 |
-
"\n",
|
| 18 |
-
"13:25:11 | ERROR: Draco mesh compression is not available because library could not be found at /Users/jan-hendrik/projects/bpy-sol-interacitve/pages/Resources/3.6/python/lib/python3.10/site-packages/libextern_draco.dylib\n",
|
| 19 |
-
"13:25:11 | INFO: Starting glTF 2.0 export\n",
|
| 20 |
-
"13:25:11 | INFO: Extracting primitive: Cube.018\n",
|
| 21 |
-
"13:25:11 | INFO: Primitives created: 1\n",
|
| 22 |
-
"13:25:11 | INFO: Finished glTF 2.0 export in 0.002207040786743164 s\n",
|
| 23 |
-
"\n"
|
| 24 |
-
]
|
| 25 |
-
},
|
| 26 |
-
{
|
| 27 |
-
"data": {
|
| 28 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 29 |
-
"model_id": "b843398fcd2449c9a3c8bdc5ae1867ec",
|
| 30 |
-
"version_major": 2,
|
| 31 |
-
"version_minor": 0
|
| 32 |
-
},
|
| 33 |
-
"text/html": [
|
| 34 |
-
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 35 |
-
],
|
| 36 |
-
"text/plain": [
|
| 37 |
-
"Cannot show ipywidgets in text"
|
| 38 |
-
]
|
| 39 |
-
},
|
| 40 |
-
"metadata": {},
|
| 41 |
-
"output_type": "display_data"
|
| 42 |
-
}
|
| 43 |
-
],
|
| 44 |
"source": [
|
| 45 |
"import bpy\n",
|
| 46 |
"from IPython.display import display\n",
|
|
@@ -97,6 +61,8 @@
|
|
| 97 |
" solara.Success(\"Rendering complete. \")\n",
|
| 98 |
" if result.value:\n",
|
| 99 |
" viewer = Viewer(gltf_data=result.value)\n",
|
|
|
|
|
|
|
| 100 |
" display(viewer)\n",
|
| 101 |
"Page()"
|
| 102 |
]
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": null,
|
| 6 |
"metadata": {},
|
| 7 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
"source": [
|
| 9 |
"import bpy\n",
|
| 10 |
"from IPython.display import display\n",
|
|
|
|
| 61 |
" solara.Success(\"Rendering complete. \")\n",
|
| 62 |
" if result.value:\n",
|
| 63 |
" viewer = Viewer(gltf_data=result.value)\n",
|
| 64 |
+
" solara.FileDownload(data, filename=\"model_cube.gltf\", label=\"Download model_cube.gltf\")\n",
|
| 65 |
+
"\n",
|
| 66 |
" display(viewer)\n",
|
| 67 |
"Page()"
|
| 68 |
]
|