Skip to content

Conversation

@CedricThebault
Copy link
Member

This pull request updates the method for importing .obj files in the loadModel function to align with changes in Blender's API. The key change replaces the deprecated bpy.ops.import_scene.obj operator with the bpy.ops.wm.obj_import operator. This ensures compatibility with older and newer versions of Blender. (versions 3 and 4)

@CedricThebault CedricThebault requested a review from Copilot July 9, 2025 14:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the .obj import call in loadModel to use the new Blender 4 operator, ensuring compatibility across Blender 3 and 4.

  • Replaces deprecated bpy.ops.import_scene.obj with bpy.ops.wm.obj_import
  • Adjusts axis parameter names to match the new API
Comments suppressed due to low confidence (1)

meshroom/blender/scripts/preview.py:216

  • [nitpick] The docstring mentions "Alembic of OBJ format", which can be confusing. Consider splitting into two cases or clarifying that this function handles both .abc and .obj formats.
    '''Load model in Alembic of OBJ format. Make sure orientation matches camera orientation.'''

@CedricThebault CedricThebault changed the title [blender] Fix obj import for blender 4 [blender] Fix .obj import for blender 4 Jul 9, 2025
@servantftransperfect servantftransperfect self-requested a review July 11, 2025 11:03
Copy link
Contributor

@servantftransperfect servantftransperfect left a comment

Choose a reason for hiding this comment

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

Works

@servantftransperfect servantftransperfect merged commit e8f0dc3 into develop Jul 11, 2025
4 checks passed
@servantftransperfect servantftransperfect deleted the fix/blenderObjImport branch July 11, 2025 11:03
@cbentejac cbentejac added this to the 3.3.0 milestone Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants