Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-09-22 17:11:16 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-09-22 17:12:43 +0300
commit4e031073df3658f3bf9c807bfdfd70cdeca73102 (patch)
tree890840eed549d7384631f7fd16e6e2ac92747626 /source/blender/blenkernel/intern/library_query.c
parent9937f2887742e22b0bca33d6f8cdeaa4333e8fb1 (diff)
Fix T49427: Drivers of Shapekeys break when Append a group.
Optimization attempt with BKE_library_idtype_can_use_idtype() was not taking into account the fact that drivers may link virtually against any datablock... Has to be rethinked, but for after 2.78 release, this commit is safe to backport.
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r--source/blender/blenkernel/intern/library_query.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index cb864334208..392ac68150e 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -897,10 +897,12 @@ void BKE_library_update_ID_link_user(ID *id_dst, ID *id_src, const int cd_flag)
* This is a 'simplified' abstract version of #BKE_library_foreach_ID_link() above, quite useful to reduce
* useless iterations in some cases.
*/
+/* XXX This has to be fully rethink, basing check on ID type is not really working anymore (and even worth once
+ * IDProps will support ID pointers), we'll have to do some quick checks on IDs themselves... */
bool BKE_library_idtype_can_use_idtype(const short id_type_owner, const short id_type_used)
{
- if (id_type_used == ID_AC) {
- return id_type_can_have_animdata(id_type_owner);
+ if (id_type_can_have_animdata(id_type_owner)) {
+ return true; /* AnimationData can use virtually any kind of datablocks, through drivers especially. */
}
switch ((ID_Type)id_type_owner) {
@@ -999,10 +1001,10 @@ static int foreach_libblock_id_users_callback(void *user_data, ID *self_id, ID *
IDUsersIter *iter = user_data;
/* XXX This is actually some kind of hack...
- * Issue is, only ID pointer from shapekeys is the 'from' one, which is not actually ID usage.
+ * Issue is, shapekeys' 'from' ID pointer is not actually ID usage.
* Maybe we should even nuke it from BKE_library_foreach_ID_link, not 100% sure yet...
*/
- if (GS(self_id->name) == ID_KE) {
+ if ((GS(self_id->name) == ID_KE) && (((Key *)self_id)->from == *id_p)) {
return IDWALK_RET_NOP;
}