Fix Blender OBJ output path handling - #7281
Conversation
Greptile SummaryFixes Blender OBJ conversion when writing to the current directory and prevents directory-name corruption during optional USD export.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or test-integration issues identified. The revised path logic preserves the OBJ destination, creates parents only when needed, and derives the USD destination within the same directory; the added tests exercise both reported regressions. Important Files Changed
Reviews (1): Last reviewed commit: "Fix Blender OBJ output path handling" | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
Reviewed the localized path-handling changes in scripts/tools/blender_obj.py and their mocked regression coverage. The empty-parent-directory guard fixes basename outputs, while extension-only USD derivation prevents directory-name corruption without broadening the change.
- Design and architecture: The converter retains its existing single-function flow and responsibilities. Using a separate
usd_filevariable also preserves the normalized OBJ path rather than rebinding it during optional USD export. - API: The
convert_to_obj(in_file, out_file, save_usd)signature, return behavior, CLI wiring, and existing.objsuffix normalization remain unchanged. No public symbol or documentation surface is altered. - Implementation: The changed paths directly address both regressions:
os.makedirs("")is skipped for current-directory basenames, andobjects/robot.objmaps toobjects/robot.usd. Focused mocked tests cover both observable Blender export calls. The test’s repository-relative script lookup is coupled to the script location, but this is a non-blocking maintenance tradeoff.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
There was a problem hiding this comment.
AI review disclosure: This review was produced with assistance from multiple AI systems.
Thank you for putting this PR together.
Assessment: Both basename-directory handling and final-extension replacement are correct.
Findings: Managed isaaclab tests are touched without a required changelog fragment.
Requested changes: Add source/isaaclab/changelog.d/.skip and rerun the changelog gate.
Test scope: Two mocked tests cover two distinct regressions and pass.
Documentation / AI skills: No additional documentation update is required: no public API or documented behavior surface changed. No AI-skill update is required.
Description
Fixes two path-handling bugs in
scripts/tools/blender_obj.py.When the output is a basename such as
robot.obj,os.path.dirname()returns an empty string. The converter previously tried to create that empty path withos.makedirs(""), so writing directly to the current working directory failed.The optional USD export also used
out_file.replace("obj", "usd"), which replaces every matching substring in the full path. A valid path such asobjects/robot.objcould therefore be changed tousdects/robot.usd.The converter now creates a parent directory only when one is present and derives the USD path by replacing only the file extension.
Type of change
Validation
objects/robot.objmaps toobjects/robot.usdwithout changing directory names.isaaclab.skipchangelog marker because managed package tests are touched.Checklist