diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-08-22 15:40:10 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-08-22 15:46:37 +0300 |
commit | 8f578150eaf494a03bed7389046e44f2bdf7d748 (patch) | |
tree | 5370042609d04907eff0a154e8a4b6ae858af182 /source/blender/editors/include/ED_keyframing.h | |
parent | 443586f34d3a0730c67b5d8787e519bec2af3656 (diff) |
Fix T68971: Copy As New Driver from Material node creates a bad reference.
NodeTree structures of materials and some other data blocks are
effectively node group data block objects that are contained inside
the parent block. Thus, direct references to them are only valid
while blender is running, and are lost on save.
Fix Copy As New Driver to create a reference that goes through
the owner data block, by adding a new runtime field to bNodeTree.
Diffstat (limited to 'source/blender/editors/include/ED_keyframing.h')
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index bbeeeade822..455337b9cc0 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -403,6 +403,11 @@ bool ANIM_driver_vars_paste(struct ReportList *reports, struct FCurve *fcu, bool /* -------- */ +/** Compute an ID pointer and path to property valid for use in a driver. + * Corrects for ID references that are not independent (e.g. material NodeTree). */ +bool ANIM_get_target_ID_and_path_to_property( + struct PointerRNA *ptr, struct PropertyRNA *prop, int index, struct ID **r_id, char **r_path); + /* Create a driver & variable that reads the specified property, * and store it in the buffers for Paste Driver and Paste Variables. */ void ANIM_copy_as_driver(struct ID *target_id, const char *target_path, const char *var_name); |