RNA: fix the id_data pointer of PoseBone.bone to point at the Armature.
authorAlexander Gavrilov <angavrilov@gmail.com>
Tue, 14 May 2019 09:38:04 +0000 (12:38 +0300)
committerAlexander Gavrilov <angavrilov@gmail.com>
Tue, 14 May 2019 09:39:36 +0000 (12:39 +0300)
commit1c106e189aafe235ca5e83c97ce477c80ccc437a
tree263ffa89f81fae9bf70106d9fdfcd3be199b4891
parent02e3bf22ab6059db03c856f1d34b27a24ef8ec31
RNA: fix the id_data pointer of PoseBone.bone to point at the Armature.

The owning ID reference of RNA pointers is supposed to point at the
ID container that owns the object, but for PoseBone.bone it wasn't
updated to point at the Armature data ID instead of Armature Object.

This caused issues, like pose_bone.bone.driver_add() adding the
driver to the Armature Object animation data, which violates the
intended design of the animation data structures.

Since RNA code generally assumes that all pointers that don't
refer directly to an ID remain within the current ID, a custom
getter is required to fix this.
source/blender/makesrna/intern/rna_pose.c