Skip to content

Commit

Permalink
Merge pull request princeton-vl#273 from princeton-vl/export_fix
Browse files Browse the repository at this point in the history
fix export bug when optimize_terrain_diskusage is on; fix input folde…
  • Loading branch information
pvl-bot authored Sep 16, 2024
2 parents 8b853fe + c01e498 commit aaf86e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion infinigen/core/execute_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def execute_tasks(
col.hide_viewport = False

if need_terrain_processing and (
Task.Render in task or Task.GroundTruth in task or Task.MeshSave in task
Task.Render in task or Task.GroundTruth in task or Task.MeshSave in task or Task.Export in task
):
terrain = Terrain(
scene_seed,
Expand Down
16 changes: 15 additions & 1 deletion infinigen/datagen/job_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,21 @@ def queue_export(
**kwargs,
):
input_suffix = get_suffix(input_indices)
input_folder = f"{folder}/coarse{input_suffix}"
input_folder_priority_options = [
f"fine{input_suffix}",
"fine",
f"coarse{input_suffix}",
"coarse",
]

for option in input_folder_priority_options:
input_folder = f"{folder}/{option}"
if (Path(input_folder) / "scene.blend").exists():
break
else:
logger.warning(
f"No scene.blend found in {input_folder} for any of {input_folder_priority_options}"
)

cmd = (
get_cmd(
Expand Down
1 change: 0 additions & 1 deletion infinigen/tools/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ def export_scene(
task_uniqname=None,
**kwargs,
):
bpy.ops.wm.open_mainfile(filepath=str(input_blend))
folder = output_folder / f"export_{input_blend.name}"
folder.mkdir(exist_ok=True, parents=True)
export_curr_scene(folder, **kwargs)
Expand Down

0 comments on commit aaf86e7

Please sign in to comment.