Page MenuHome

Custom Properties within PropertyGroups cannot be animated when attached to a PoseBone
Confirmed, NormalPublicTO DO

Description

System Information
Ubuntu Linux 14.04 (64-bit)
NVIDIA GTX 960 (NVIDIA Driver Version 367.35)

Blender Version
Broken: 2.77a abf6f08
Worked: N/A

I've found that custom properties stored within PropertyGroups and/or CollectionPropertys cannot actually be animated if they are associated with a PoseBone (Error returned when inserting keyframe is "Failed to resolve path to property, try manually specifying this using a Keying Set instead"). (If the exact same custom properties are associated with an Object, they can be animated by inserting keyframes normally.)

It's possible that I'm mistaken and it is possible to manually specify the property within a CollectionProperty/PropertyGroup using a Keying Set in a more straightforward manner (or at all), but to manually add a Keying Set for every potential instance of a property within a CollectionProperty for every PoseBone that uses the custom properties is an unrealistic for any use case involving a CollectionProperty (and honestly I'm doubtful whether this is even possible, I was unable to successfully create a Keying Set for keyframing a property within a CollectionProperty/PropertyGroup, getting error 'Keying set failed to insert any key frames', although I can't deny the possibility I got the path to the property wrong somehow).

Exact steps for others to reproduce the error

  1. Open the provided .blend file
  2. Install/Enable the provided add-on
  3. Select a bone in the armature in pose mode.
  4. Go to the Bone panel. At the bottom, you'll see a new section called 'Custom Properties Bug'.
  5. Try to insert a keyframe for 'Animatable PropGroup Property'. It will fail.
  6. Click the 'Add Collection Item' button to add an item to a CollectionProperty.
  7. Try to insert a keyframe for 'Animatable Collection Property' (a property within the Item you just added to a collection associated with the PoseBone). It will fail.

Event Timeline

sn0w75 created this task.Jul 29 2016, 11:08 PM
sn0w75 updated the task description. (Show Details)

I've added a second .zip (bug_report_2.zip) that contains a revised version of the add-on used for showcasing the bug that adds a section under the Object panel so you try setting keyframes for custom properties within PropertyGroup/CollectionPropertys of Objects as well as PoseBones (it works for Objects, but not for PoseBones).

Sergey Sharybin (sergey) lowered the priority of this task from 90 to Normal.Aug 2 2016, 10:00 AM

A bit weird. @Joshua Leung (aligorith), mind having a look here? :)

P.S. It's not required to install the addon, script can be run from text editor in Blender.

This "bug" is still present in the official 2.78 RC as of 9/11/2016. I just ran in to this while working on my own addon involving PoseBones.

The conditions in my scene file and property setup are virtually identical to the ones described above.

@Graham Unit (GCRev)

FYI, I did a workaround for this by, instead of storing the properties within a PropertyGroup or CollectionProperty, to just associate a set of custom properties directly with the PoseBone that use a naming scheme you can use to 'emulate' an array/CollectionProperty. (Since custom properties associated directly with the PoseBone that aren't inside of any PropertyGroup/CollectionProperty can still be animated.)

So, for example, if you wanted an array of a particular type of custom property, you'd make a set of variables that look like this:
num_things
thing0_propA
thing0_propB
thing0_propC
thing1_propA
thing1_propB
thing1_propC

etc...

It's a very dirty workaround imo, but it'll get the job done if you don't have time to wait for a fix.
This worked for my use case since I knew I wouldn't need an array size of more than a few items,
But for a use case that involves tens or hundreds of array items, this may not be a great workaround.

This is apparently a known limitation, it's documented as TODO in rna_path_from_ID_to_idpgroup() (the TODO was added in rB19efa4301a5f2545eddfd4e5e56943d9a1d9f5cf in 2010). As such this isn't considered a bug. It's still clearly useful functionality, though, so I'll mark it as a To Do.

Any status on this becoming implemented? Have quite a few properties written in collection properties in an add-on of mine -- none of which are related to rigging or bones.

At this time there is no concrete plan to implement this.

Here to second this...this limitation also affects pointer properties. Fortunately for me though that is much easier to work around.