princeton-vl / infinigen

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

Cannot edit hidden object when export to Omniverse #288

Closed YandanYang closed 1 month ago

YandanYang commented 2 months ago

Steps to Reproduce

I just want to export the blender scene into omniverse USD file. And get the error saying RuntimeError: Operator bpy.ops.object.mode_set.poll() Cannot edit hidden object In call to configurable 'export_curr_scene' when calling bpy.ops.object.mode_set(mode="EDIT").

What version of the code were you using?

4a4411e92611d059f2476f4384141de3529d1f9f

What command did you run?

python -m infinigen.tools.export --input_folder outputs/indoors/coarse_p --output_folder outputs/my_export_omni -f usdc -r 1024 --omniverse

What are your FULL output logs?

log.txt

If this is your first time running Infinigen, what are the full install logs?**

logs.txt

Platform

Additional context

Add any other context about the problem here.

David-Yan1 commented 2 months ago

Hi,

If possible, could you provide either the blend file or the commands to generate the blend file (found in run_pipeline.sh)?

YandanYang commented 2 months ago

Hi, I follow the readme and run this command : python -m infinigen_examples.generate_indoors --seed 0 --task coarse --output_folder outputs/indoors/coarse -g fast_solve.gin overhead.gin singleroom.gin -p compose_indoors.terrain_enabled=False compose_indoors.overhead_cam_enabled=True compose_indoors.solve_max_rooms=1 compose_indoors.invisible_room_ceilings_enabled=True compose_indoors.restrict_single_supported_roomtype=True

Since the blend file is too large to upload, I provide the screenshot of the scene loaded in blender. Screenshot from 2024-08-09 16-33-55

David-Yan1 commented 2 months ago

This is likely caused by compose_indoors.invisible_room_ceilings_enabled=True. In export.py, you can add a conditional in split_glass_mats(), which should fix the problem.

 for obj in bpy.data.objects:
        if obj.hide_render or obj.hide_viewport:
            continue
        if any( 
            exclude in obj.name
            for exclude in ["BowlFactory", "CupFactory", "OvenFactory", "BottleFactory"]
        ):
            continue
YandanYang commented 2 months ago

Thanks for your reply. It works. I converted it into usd for omniverse successfully.

However, when I try to load the usd with isaac_sim.py, something is wrong with the texture. This is the log of isaac sim log.txt It seems that most of the texture does not reflect light and becomes dark.

This is the usd loaded in blender (I modify some light power): Screenshot from 2024-08-28 18-56-28 And this is usd loaded in isaac sim (nothing changes when I modify the light): Screenshot from 2024-08-28 18-37-45 And this is the shader of floor mesh: Screenshot from 2024-08-28 18-39-00 When I change the shader of floor into the same shader of wall, the floor can reflect light, but with no color: Screenshot from 2024-08-28 18-49-00

YandanYang commented 2 months ago

I upload the file here. coarse_p.zip is the file before converting to usd. export_scene.zip is the converted omniverse usd.

YandanYang commented 1 month ago

Hi, I found the problem of texture comes from the --scene-path. The args of scene-path need to be an absolute path when running issac_sim.py. I do not know why. Maybe it is a bug of isaac sim?