Refactor: change light linking object storage be dynamically allocated #108090

Closed
Brecht Van Lommel wants to merge 128 commits from light-linking-dna into cycles-light-linking

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

View File

@ -1396,7 +1396,6 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll)
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
PointerRNA ptr, lptr; PointerRNA ptr, lptr;
PropertyRNA *prop, *lprop; PropertyRNA *prop, *lprop;
bool success = false;
int index; int index;
/* try to reset the nominated setting to its default value */ /* try to reset the nominated setting to its default value */
@ -1407,36 +1406,31 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll)
return false; return false;
} }
bool success = false;
char *path = nullptr; char *path = nullptr;
bool use_path_from_id; bool use_path_from_id;
ListBase lb = {nullptr}; ListBase lb = {nullptr};
if (!UI_context_copy_to_selected_list(C, &ptr, prop, &lb, &use_path_from_id, &path)) { if (UI_context_copy_to_selected_list(C, &ptr, prop, &lb, &use_path_from_id, &path)) {
return false; LISTBASE_FOREACH (CollectionPointerLink *, link, &lb) {
} if (link->ptr.data == ptr.data) {
if (BLI_listbase_is_empty(&lb)) { continue;
MEM_SAFE_FREE(path); }
return false;
}
LISTBASE_FOREACH (CollectionPointerLink *, link, &lb) { if (!UI_context_copy_to_selected_check(
if (link->ptr.data == ptr.data) { &ptr, &link->ptr, prop, path, use_path_from_id, &lptr, &lprop))
continue; {
} continue;
}
if (!UI_context_copy_to_selected_check( if (poll) {
&ptr, &link->ptr, prop, path, use_path_from_id, &lptr, &lprop)) success = true;
{ break;
continue; }
} if (RNA_property_copy(bmain, &lptr, &ptr, prop, (all) ? -1 : index)) {
RNA_property_update(C, &lptr, prop);
if (poll) { success = true;
success = true; }
break;
}
if (RNA_property_copy(bmain, &lptr, &ptr, prop, (all) ? -1 : index)) {
RNA_property_update(C, &lptr, prop);
success = true;
} }
} }