How can I add keyframes to custom properties with python? Usually, I can use the function
but I couldn't find the right data_path of a custom property.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
Keyframes on custom properties use Python's getitem/setitem syntax rather then getattr/setattr.
This matches python api, where you would access
object.location as an attribute and
object["prop"] for a custom property.
So you would need to write it like this:
Note that you have to use
" quotes, not
'["prop"]' can be written as
"[\"prop\"]" too of course.
I think we have this documented, I'll have to double check though.