Spaces:
Runtime error
Runtime error
Commit
·
b54b529
1
Parent(s):
2ef8a44
Replace LitModel3D with gr.Model3D and restore functionality for GLB extraction
Browse files
app.py
CHANGED
|
@@ -239,6 +239,7 @@ with gr.Blocks(title="Game Items Generator") as demo:
|
|
| 239 |
with gr.Column():
|
| 240 |
video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
|
| 241 |
# model_output = LitModel3D(label="Extracted GLB", exposure=20.0, height=300)
|
|
|
|
| 242 |
download_glb = gr.DownloadButton(label="Download GLB", interactive=False)
|
| 243 |
|
| 244 |
trial_id = gr.Textbox(visible=False)
|
|
@@ -293,19 +294,19 @@ with gr.Blocks(title="Game Items Generator") as demo:
|
|
| 293 |
outputs=[extract_glb_btn],
|
| 294 |
)
|
| 295 |
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
|
| 310 |
|
| 311 |
# Launch the Gradio app
|
|
|
|
| 239 |
with gr.Column():
|
| 240 |
video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
|
| 241 |
# model_output = LitModel3D(label="Extracted GLB", exposure=20.0, height=300)
|
| 242 |
+
model_output = gr.Model3D(label="Extracted GLB", height=300)
|
| 243 |
download_glb = gr.DownloadButton(label="Download GLB", interactive=False)
|
| 244 |
|
| 245 |
trial_id = gr.Textbox(visible=False)
|
|
|
|
| 294 |
outputs=[extract_glb_btn],
|
| 295 |
)
|
| 296 |
|
| 297 |
+
extract_glb_btn.click(
|
| 298 |
+
extract_glb,
|
| 299 |
+
inputs=[output_buf, mesh_simplify, texture_size],
|
| 300 |
+
outputs=[model_output, download_glb],
|
| 301 |
+
).then(
|
| 302 |
+
activate_button,
|
| 303 |
+
outputs=[download_glb],
|
| 304 |
+
)
|
| 305 |
+
|
| 306 |
+
model_output.clear(
|
| 307 |
+
deactivate_button,
|
| 308 |
+
outputs=[download_glb],
|
| 309 |
+
)
|
| 310 |
|
| 311 |
|
| 312 |
# Launch the Gradio app
|