WIP: Basic Blender Project Support (experimental feature) #107655

Draft
Julian Eisel wants to merge 94 commits from blender-projects-basics into main

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

View File

@ -9678,8 +9678,7 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi
for (int i = 0; i < len; i++) {
if (!dyn_data->items_filter_flags ||
(((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM_NEVER_SHOW) == 0) &&
(dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude))
((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude))
{
org_order[new_order ? new_order[++org_idx] : ++org_idx] = i;
if (i == value) {

View File

@ -251,7 +251,7 @@ void UI_list_filter_and_sort_items(uiList *ui_list,
const eUIListFilterResult filter_result = item_filter_fn(itemptr, name, i);
if (filter_result == UI_LIST_ITEM_NEVER_SHOW) {
dyn_data->items_filter_flags[i] = UILST_FLT_ITEM_NEVER_SHOW;
/* Pass. */
}
else if (filter_result == UI_LIST_ITEM_FILTER_MATCHES) {
dyn_data->items_filter_flags[i] = UILST_FLT_ITEM;
@ -432,8 +432,7 @@ static void ui_template_list_collect_items(PointerRNA *list_ptr,
RNA_PROP_BEGIN (list_ptr, itemptr, list_prop) {
if (!dyn_data->items_filter_flags ||
(((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM_NEVER_SHOW) == 0) &&
((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)))
((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude))
{
int new_order_idx;
if (dyn_data->items_filter_neworder) {

View File

@ -614,8 +614,7 @@ enum {
/* WARNING! Those values are used by integer RNA too, which does not handle well values > INT_MAX.
* So please do not use 32nd bit here. */
enum {
UILST_FLT_ITEM_NEVER_SHOW = (1 << 0), /* Filtering returned #UI_LIST_ITEM_NEVER_SHOW. */
UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
};
/** #uiList.filter_flag */

View File

@ -615,9 +615,7 @@ static void uilist_filter_items(uiList *ui_list,
int t_idx, t_ni, prev_ni;
flt_data->items_shown = 0;
for (i = 0, shown_idx = 0; i < len; i++) {
if (((filter_flags[i] & UILST_FLT_ITEM_NEVER_SHOW) == 0) &&
(filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)
{
if ((filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude) {
filter_neworder[shown_idx++] = filter_neworder[i];
}
}
@ -644,9 +642,7 @@ static void uilist_filter_items(uiList *ui_list,
/* we still have to set flt_data->items_shown... */
flt_data->items_shown = 0;
for (i = 0; i < len; i++) {
if (((filter_flags[i] & UILST_FLT_ITEM_NEVER_SHOW) == 0) &&
(filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)
{
if ((filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude) {
flt_data->items_shown++;
}
}