diff options
Diffstat (limited to 'source/blender/python/intern/bpy_rna_driver.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna_driver.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_driver.c b/source/blender/python/intern/bpy_rna_driver.c index 482508a8d85..b4c0de51c04 100644 --- a/source/blender/python/intern/bpy_rna_driver.c +++ b/source/blender/python/intern/bpy_rna_driver.c @@ -77,3 +77,24 @@ PyObject *pyrna_driver_get_variable_value( return driver_arg; } + +PyObject *pyrna_driver_self_from_anim_rna(PathResolvedRNA *anim_rna) +{ + return pyrna_struct_CreatePyObject(&anim_rna->ptr); +} + +bool pyrna_driver_is_equal_anim_rna(const PathResolvedRNA *anim_rna, const PyObject *py_anim_rna) +{ + if (BPy_StructRNA_Check(py_anim_rna)) { + const PointerRNA *ptr_a = &anim_rna->ptr; + const PointerRNA *ptr_b = &(((const BPy_StructRNA *)py_anim_rna)->ptr); + + if ((ptr_a->id.data == ptr_b->id.data) && + (ptr_a->type == ptr_b->type) && + (ptr_a->data == ptr_b->data)) + { + return true; + } + } + return false; +} |