WIP: Fix #105260: Skip nla tracks with library linked strips #107758

Draft
Denys Hsu wants to merge 2 commits from cgtinker/blender:nla_linked_lib into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 22 additions and 2 deletions
Showing only changes of commit 1bd0378df5 - Show all commits

View File

@ -1106,7 +1106,8 @@ static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id
/* Check for selected nodes. */
if (fcu->rna_path &&
BLI_str_quoted_substr(fcu->rna_path, "nodes[", node_name, sizeof(node_name))) {
BLI_str_quoted_substr(fcu->rna_path, "nodes[", node_name, sizeof(node_name)))
{
/* Get strip name, and check if this strip is selected. */
node = nodeFindNodebyName(ntree, node_name);
@ -1256,7 +1257,8 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads,
if (ads && owner_id) {
if ((filter_mode & ANIMFILTER_TMP_IGNORE_ONLYSEL) == 0) {
if ((ads->filterflag & ADS_FILTER_ONLYSEL) ||
(ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0) {
(ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0)
{
if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode)) {
continue;
}
@ -1565,6 +1567,24 @@ static size_t animfilter_nla(bAnimContext *UNUSED(ac),
}
}
/* Skip library linked nla strips when filtering for edit. */
bool is_lib_linked = false;
if (filter_mode & ANIMFILTER_FOREDIT) {
NlaStrip *strip;
for (strip = nlt->strips.first; strip; strip = strip->next) {
if (strip->act) {
if (ID_IS_LINKED(strip->act)) {
is_lib_linked = true;
break;
}
}
}
}
if (is_lib_linked) {
continue;
}
/* add the track now that it has passed all our tests */
ANIMCHANNEL_NEW_CHANNEL(nlt, ANIMTYPE_NLATRACK, owner_id, NULL);
}