MohamedRashad commited on
Commit
b54b529
·
1 Parent(s): 2ef8a44

Replace LitModel3D with gr.Model3D and restore functionality for GLB extraction

Browse files
Files changed (1) hide show
  1. app.py +14 -13
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
- # extract_glb_btn.click(
297
- # extract_glb,
298
- # inputs=[output_buf, mesh_simplify, texture_size],
299
- # outputs=[model_output, download_glb],
300
- # ).then(
301
- # activate_button,
302
- # outputs=[download_glb],
303
- # )
304
-
305
- # model_output.clear(
306
- # deactivate_button,
307
- # outputs=[download_glb],
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