Fix (unreported) invalid handling of IDs usercount in BKE_mesh_new_from_object_to_bmain().

Would have broken usercount of mesh used as texco reference e.g.
This commit is contained in:
Bastien Montagne
2019-05-27 16:46:45 +02:00
parent 270faa4e9c
commit 392e58afb3

View File

@@ -1179,7 +1179,15 @@ static int foreach_libblock_make_original_and_usercount_callback(void *user_data
return IDWALK_RET_NOP;
}
*id_p = DEG_get_original_id(*id_p);
id_us_plus(*id_p);
if (cb_flag & IDWALK_CB_USER) {
id_us_plus(*id_p);
}
else if (cb_flag & IDWALK_CB_USER_ONE) {
/* Note: in that context, that one should not be needed (since there should be at least already
* one USER_ONE user of that ID), but better be consistent. */
id_us_ensure_real(*id_p);
}
return IDWALK_RET_NOP;
}