Skip to content

Fix Blender OBJ output path handling - #7281

Open
sylvesterkaczmarek wants to merge 2 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/blender-obj-output-paths
Open

Fix Blender OBJ output path handling#7281
sylvesterkaczmarek wants to merge 2 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/blender-obj-output-paths

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 21, 2026

Copy link
Copy Markdown

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 with os.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 as objects/robot.obj could therefore be changed to usdects/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

  • Bug fix

Validation

  • Added a unit regression test for an OBJ basename in the current working directory.
  • Added a regression test verifying objects/robot.obj maps to objects/robot.usd without changing directory names.
  • Blender is mocked, so the tests do not require a Blender installation.
  • Added the required isaaclab .skip changelog marker because managed package tests are touched.

Checklist

  • I have read and understood the contribution guidelines
  • I have added regression tests
  • No new dependencies

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team August 21, 2026 16:31
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 21, 2026
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes Blender OBJ conversion when writing to the current directory and prevents directory-name corruption during optional USD export.

  • Creates an output directory only when the destination includes a parent path.
  • Derives the USD filename by replacing only the final extension.
  • Adds mocked-Blender regression tests for basename and nested-directory outputs.

Confidence Score: 5/5

The 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

Filename Overview
scripts/tools/blender_obj.py Correctly guards empty parent paths and uses extension-aware USD path derivation without altering directory components.
source/isaaclab/test/tools/test_blender_obj.py Adds isolated unit regressions covering both corrected path-handling cases without requiring Blender.

Reviews (1): Last reviewed commit: "Fix Blender OBJ output path handling" | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_file variable 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 .obj suffix 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, and objects/robot.obj maps to objects/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.

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants