Anim: rename RNA Slot.id_root to Slot.target_id_type

The name `id_root` was not descriptive, and was just a hold-over from the
equivalent (now deprecated) property on the Action itself.  `target_id_type`
is more clear, reflecting that this is the type of ID the Slot is intended
to animate.

This PR also renames the corresponding `id_root_icon` to
`target_id_type_icon`.

Note that this PR updates the GLTF import/export core addon to adhere to
these name changes as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/133164
This commit is contained in:
Nathan Vegdahl
2025-01-20 15:24:08 +01:00
committed by Nathan Vegdahl
parent bbfc49be83
commit 9f2ab9cba0
9 changed files with 83 additions and 74 deletions

View File

@@ -27,13 +27,13 @@ class ActionSlotCreationTest(unittest.TestCase):
slot3 = self.action.slots.new('LIGHT', "Bob")
self.assertEqual("OBBob", slot1.identifier)
self.assertEqual('OBJECT', slot1.id_root)
self.assertEqual('OBJECT', slot1.target_id_type)
self.assertEqual("CABob", slot2.identifier)
self.assertEqual('CAMERA', slot2.id_root)
self.assertEqual('CAMERA', slot2.target_id_type)
self.assertEqual("LABob", slot3.identifier)
self.assertEqual('LIGHT', slot3.id_root)
self.assertEqual('LIGHT', slot3.target_id_type)
def test_same_name_same_type(self):
slot1 = self.action.slots.new('OBJECT', "Bob")
@@ -41,13 +41,13 @@ class ActionSlotCreationTest(unittest.TestCase):
slot3 = self.action.slots.new('OBJECT', "Bob")
self.assertEqual("OBBob", slot1.identifier)
self.assertEqual('OBJECT', slot1.id_root)
self.assertEqual('OBJECT', slot1.target_id_type)
self.assertEqual("OBBob.001", slot2.identifier)
self.assertEqual('OBJECT', slot2.id_root)
self.assertEqual('OBJECT', slot2.target_id_type)
self.assertEqual("OBBob.002", slot3.identifier)
self.assertEqual('OBJECT', slot3.id_root)
self.assertEqual('OBJECT', slot3.target_id_type)
def test_invalid_arguments(self):
with self.assertRaises(TypeError):

View File

@@ -124,7 +124,7 @@ class NLAStripActionSlotSelectionTest(AbstractNlaStripTest):
strip1 = track.strips.new("name", 1, action)
self.assertEqual(action.slots[0], strip1.action_slot)
self.assertEqual('OBJECT', action.slots[0].id_root, "Slot should have been rooted to object")
self.assertEqual('OBJECT', action.slots[0].target_id_type, "Slot should have been rooted to object")
strip2 = track.strips.new("name", 10, action)
self.assertEqual(action.slots[0], strip2.action_slot)
@@ -144,11 +144,13 @@ class NLAStripActionSlotSelectionTest(AbstractNlaStripTest):
strip = track.strips.new("name", 1, action1)
self.assertEqual(action1.slots[0], strip.action_slot)
self.assertEqual('OBJECT', action1.slots[0].id_root, "Slot of Action 1 should have been rooted to object")
self.assertEqual('OBJECT', action1.slots[0].target_id_type,
"Slot of Action 1 should have been rooted to object")
strip.action = action2
self.assertEqual(action2.slots[0], strip.action_slot)
self.assertEqual('OBJECT', action2.slots[0].id_root, "Slot of Action 2 should have been rooted to object")
self.assertEqual('OBJECT', action2.slots[0].target_id_type,
"Slot of Action 2 should have been rooted to object")
if __name__ == "__main__":