Currently inserting keyframes on a CollectionProperty uses the rna path similar to "collection[n].value". This leads to fcurves depending on the element's index. If the collection is modified, items added or removed, then all fcurves with a higher index are invalidated, now associated with the wrong element. Animations that relied on the old indices are now corrupted. Fixing them is non trivial due to the unreliable index-based association.
By changing the rna_path built to use the element's name ("collection["element name"].value"), collection modifications do not corrupt existing animations. This is optional and applies to CollectionProperties constructed using the newly added subtype='DICTIONARY'.
- In the Graph Editor and DopeSheet editor, the channels will have the name "Value" instead of something meaningful. This is a minor problem since we can manually group those channels to give them more meaningful names. This only applies when the keyed property is referenced from the named element. If the property is part of the same named element, it appears as "Value (Element Name)" which is good.
- The CollectionProperty doesn't enforce unique names. This is minor since addon creators can handle this behaviour.
Here's a blend file just to view the effect on keyframed properties. There's a script that will create the new subtype and provide a panel for some debug prints.
Here's the print results from the attached blend file. Being able to access a CollectionProperty element by name is existing behavior.
test_dictionary.name = "D_item"
test_dictionary["D_item"].name = "D_item"
test_collection.name = "C_item"
test_collection["C_item"].name = "C_item"