princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.39k stars 467 forks source link

RuntimeError: Error: No valid selected objects #309

Closed DreamerYinYu closed 1 month ago

DreamerYinYu commented 2 months ago

Hello, I encountered an error while executing the following command: python -m infinigen.tools.export --input_folder outputs/scene_14_sunder_water/0/fine --output_folder outputs/my_SceneExport -f usdc -r 1024

report errors: RuntimeError: Error: No valid selected objects In call to configurable 'export_curr_scene' (<function export_curr_scene at 0x7ff3e4bd9f30>)

How can I solve it? thank you

GCChen97 commented 2 months ago

The errors came from which lines of the code?

DreamerYinYu commented 2 months ago

//Crashed: 09/03 04:26PM outputs/ExportTest_01/0/logs/export.err reason='Error: Evaluated geometry from modifier does not contain a mesh,Error: Evaluated geometry from modifier does not contain a mesh,Error: No valid selected objects,RuntimeError: Error: No valid selected objects' node=None fatal=True

txOdyssey commented 2 months ago

same issue when exporting a nature scene to .fbx file.

python -m infinigen.tools.export --input_folder outputs/river/0/fine --output_folder outputs/export_river -f fbx -r 1024

report like this:

Error: No valid selected objects
Traceback (most recent call last):
  File "/opt/conda/envs/infinigen/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/envs/infinigen/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 1037, in <module>
    main(args)
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 993, in main
    folder = export_scene(
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 767, in export_scene
    export_curr_scene(folder, **kwargs)
  File "/opt/conda/envs/infinigen/lib/python3.10/site-packages/gin/config.py", line 1605, in gin_wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/opt/conda/envs/infinigen/lib/python3.10/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
    raise proxy.with_traceback(exception.__traceback__) from None
  File "/opt/conda/envs/infinigen/lib/python3.10/site-packages/gin/config.py", line 1582, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 920, in export_curr_scene
    bake_scene(
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 695, in bake_scene
    bake_object(obj, folderPath, image_res, export_usd)
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 667, in bake_object
    bake_pass(obj, dest, img_size, bake_type, export_usd)
  File "/media/diskd/code/infinigen/infinigen/tools/export.py", line 472, in bake_pass
    bpy.ops.object.bake(
  File "/opt/conda/envs/infinigen/lib/python3.10/site-packages/bpy/3.6/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: No valid selected objects

  In call to configurable 'export_curr_scene' (<function export_curr_scene at 0x7f01481f27a0>)
zoctipus commented 2 months ago

same issue exporting to usdc or with --omniverse arguments

christian-jacobsen commented 1 month ago

Currently experiencing the same issue. Trying to export the 'hello world' demo generation to usdc (both with and without --omniverse arguments), and I get the same error

David-Yan1 commented 1 month ago

To fix the issue you should perform the following modification in export.py

def update_visibility():
    outliner_area = next(a for a in bpy.context.screen.areas if a.type == "OUTLINER")
    space = outliner_area.spaces[0]
    space.show_restrict_column_viewport = True  # Global visibility (Monitor icon)
    collection_view = {}
    obj_view = {}
    for collection in bpy.data.collections:
        collection_view[collection] = collection.hide_render
        collection.hide_viewport = False  # reenables viewports for all
        collection.hide_render = False  # enables renders for all collections

    # disables viewports and renders for all objs
    for obj in bpy.data.objects:
        obj_view[obj] = obj.hide_render
        obj.hide_viewport = True
        obj.hide_render = True
        obj.hide_set(0) # <-------- ADD THIS LINE

Apologies for the delay - this will be fixed next patch.