Skip to content

Conversation

@Annoa
Copy link

@Annoa Annoa commented Dec 5, 2025

This PR fixes the AttributeError: 'Action' object has no attribute 'fcurves' error when importing COLMAP cameras with animation in Blender 5.x (see #94).

Blender 5 introduced slotted actions and removed Action.fcurves. The addon still relied on the old API in camera_animation_utility.py, which caused the import to fail.

Changes:

  • Add _get_action_fcurves(target_obj) helper that:

    • Uses action.fcurves on Blender 4.x (legacy path).
    • Falls back to the slotted-actions API on Blender 5.x using action.slots, animation_data.action_slot and strip.channelbag(slot).fcurves.
  • Add _find_fcurve(...) helper to abstract fcurve lookup.

  • Update _remove_quaternion_discontinuities and _set_fcurve_interpolation to use the new helpers instead of accessing action.fcurves directly.

This keeps compatibility with Blender 4.x while allowing the COLMAP camera import (with animation and quaternion cleanup) to work correctly in Blender 5.x.

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.

1 participant