princeton-vl / infinigen

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

Error while exporting .ply and .obj files. #247

Closed lastbasket closed 2 weeks ago

lastbasket commented 3 weeks ago

Describe the bug

Error while exporting the .ply files for the individuals in the scene. Same error for the .obj files.

Steps to Reproduce

Exporting the helloworld scene to ply with command

What version of the code were you using?

Tell us the commit & commit hash from git log

What command did you run?

python -m infinigen.tools.export --input_folder infinigen/outputs/hello_world/fine --output_folder outputs/my_export -f ply -r 1024 --individual -v

What are your FULL output logs?

Read blend: "infinigen/outputs/hello_world/fine/scene.blend" INFO:root:Exporting to directory export_folder=PosixPath('outputs/my_export/scene.blend') INFO:root:--------------------------- INFO:root:atmosphere INFO:root:Mesh hidden from render, skipping ... INFO:root:--------------------------- INFO:root:atmosphere_fine Traceback (most recent call last): File "/home/lastbasket/miniconda3/envs/infinigen/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/lastbasket/miniconda3/envs/infinigen/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "infinigen/infinigen/tools/export.py", line 632, in main(args) File "infinigen/infinigen/tools/export.py", line 591, in main folder = export_scene( File "infinigen/infinigen/tools/export.py", line 472, in export_scene result = export_curr_scene(folder, **kwargs) File "infinigen/infinigen/tools/export.py", line 533, in export_curr_scene bake_scene( File "infinigen/infinigen/tools/export.py", line 424, in bake_scene bakeVertexColors(obj) File "infinigen/infinigen/tools/export.py", line 165, in bakeVertexColors bpy.ops.object.bake(type='DIFFUSE', pass_filter={'COLOR'}, target ='VERTEX_COLORS') File "/home/lastbasket/miniconda3/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: Operator bpy.ops.object.bake.poll() failed, context is incorrect

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

Run pip install -vv -e . > logs.txt 2>&1 and send logs.txt as an attachment.

Platform

Additional context

Add any other context about the problem here.

lastbasket commented 3 weeks ago

It seems like the problem of https://github.com/princeton-vl/infinigen/blob/f98b9575c73c322f1cbcc2dd48d26bbe8d6239f6/infinigen/tools/export.py#L523

lastbasket commented 3 weeks ago

It seems like the problem of

https://github.com/princeton-vl/infinigen/blob/f98b9575c73c322f1cbcc2dd48d26bbe8d6239f6/infinigen/tools/export.py#L523

When I replace export_usd with True the export is fine.

lastbasket commented 3 weeks ago

However, I cannot find the vertex color information in the exported .ply and .obj.

David-Yan1 commented 3 weeks ago

The bug is indeed caused by some of the objects being set to invisible in the blend file, which requires slightly different handling of visibility while baking. I have a patch that fixes this that will likely be out soon.

araistrick commented 2 weeks ago

should be fixed by v1.3.4