Refactor: Anim, rename and adjust ActionKeyframeStrip.channels()
Rename `ActionKeyframeStrip.channels()` to `.channelbag()`, and change its first parameter from `slot_handle` to `slot`. This is to be consistent with `ActionKeyframeStrip.channelbags`, which is the array of channelbags in the keyframe strip. Having a function that's singluar makes sense for finding a single element in the array. The change from using the slot handle to using the slot is to be consistent with `.channelbags.new(slot)`. Furthermore, the Python API should be using slot handles as little as possible (they're basically meaningless numbers). Using the slots directly is preferred. If that's not possible, it is recommended to use the slot identifier (`slot.identifier`) instead, as that can be used to look up the slot (`action.slots[slot_identifier]`). This breaks the glTF add-on, which will be fixed in !133915. Pull Request: https://projects.blender.org/blender/blender/pulls/133868
This commit is contained in:
@@ -475,7 +475,11 @@ class ChannelbagsTest(unittest.TestCase):
|
||||
self.assertEqual([], list(self.strip.channelbags))
|
||||
|
||||
def test_ensure_channelbag(self):
|
||||
channelbag = self.strip.channels(self.slot.handle, ensure=True)
|
||||
channelbag = self.strip.channelbag(self.slot, ensure=False)
|
||||
self.assertIsNone(channelbag)
|
||||
self.assertEqual([], list(self.strip.channelbags))
|
||||
|
||||
channelbag = self.strip.channelbag(self.slot, ensure=True)
|
||||
self.assertEqual([channelbag], list(self.strip.channelbags))
|
||||
|
||||
def test_create_remove_fcurves(self):
|
||||
|
||||
Reference in New Issue
Block a user