52 "Add Remote Asset Library",
53 "Add an asset library referencing a remote repository "
54 "with support for listing and updating asset libraries"},
58 "Add Local Asset Library",
59 "Add an asset library managed via the file system without referencing an external "
61 {0,
nullptr, 0,
nullptr,
nullptr},
73 spref = MEM_new<SpaceUserPref>(
"inituserpref");
74 spref->
runtime = MEM_new<SpaceUserPref_Runtime>(__func__);
112 return reinterpret_cast<SpaceLink *
>(spref);
130 sprefn->
runtime = MEM_new<SpaceUserPref_Runtime>(__func__);
132 return reinterpret_cast<SpaceLink *
>(sprefn);
203 bool is_project_defined,
204 std::optional<UUID> uuid,
205 std::optional<char *> auth_token)
212 switch (library_type) {
215 STRNCPY(final_dirpath, dirpath);
219 if (!final_name[0] && !
STREQ(final_dirpath,
"{project_root}")) {
222 if (!final_name[0]) {
226 if (is_project_defined) {
228 &
U, final_name, final_dirpath, uuid);
236 if (!final_name[0]) {
239 if (!final_name[0]) {
243 if (is_project_defined) {
245 &
U, final_name, dirpath, auth_token.value_or(
nullptr));
249 &
U, final_name, dirpath, auth_token.value_or(
nullptr));
255 if (!is_project_defined) {
261 first_project_library = &
library;
266 if (first_project_library) {
292 if (is_remote_library && !use_remote_libraries) {
305 CLAMP(
U.active_asset_library, 0, count_remaining - 1);
318 char lower[64] = {0};
319 const char *name =
nullptr;
323 const char *contexts[2] = {lower,
nullptr};
331 int current_tab_index = 0;
332 for (
const int i : context_tabs_array.
index_range()) {
333 if (
U.space_data.section_active == context_tabs_array[i]) {
334 current_tab_index = i;
339 for (
int i = current_tab_index + 1; i < context_tabs_array.
size(); i++) {
346 for (
int i = 0; i < current_tab_index; i++) {
370 sprefs_copy.
runtime = MEM_new<SpaceUserPref_Runtime>(__func__, *sprefs->
runtime);
375 for (
const int i : context_tabs_array.
index_range()) {
377 if (context_tabs_array[i] == -1) {
384 if (context_tabs_array[i] ==
U.space_data.section_active) {
393 MEM_delete(region_copy);
410 bool current_tab_has_search_match =
false;
413 current_tab_has_search_match =
true;
417 int current_tab_index = -1;
419 if (tabs[i] ==
U.space_data.section_active) {
420 current_tab_index = i;
427 if (!current_tab_has_search_match) {
439 const char *contexts[2] = {id_lower,
nullptr};
530 spref->
runtime = MEM_new<SpaceUserPref_Runtime>(__func__);
537 struct_writer.shallow_data.runtime =
nullptr;
543 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
#define STRNCPY_UTF8_RLEN(dst, src)
#define STRNCPY_UTF8(dst, src)
#define USER_EXPERIMENTAL_TEST(userdef, member)
Read Blender memory allocation and freeing.
#define UI_NAVIGATION_REGION_WIDTH
#define UI_NARROW_NAVIGATION_REGION_WIDTH
#define ND_SPACE_ASSET_PARAMS
constexpr int64_t size() const
constexpr IndexRange index_range() const
IndexRange index_range() const
void remote_library_request_download(const RemoteLibraryDefinitionRef &library_definition)
void free(Subdiv *subdiv)
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
void clear_all_library(const bContext *C)
void blocklist_free(const bContext *C, ARegion *region)
bool panel_matches_search_filter(const Panel *panel)
bool panel_is_active(const Panel *panel)
void WM_main_add_notifier(uint type, void *reference)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
const EnumPropertyItem custom_library_type_items[]
static void userpref_operatortypes()
ScrArea * CTX_wm_area(const bContext *C)
static void userpref_header_listener(const wmRegionListenerParams *)
char * STRNCPY(char(&dst)[N], const char *src)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void userpref_navigation_region_draw(const bContext *C, ARegion *region)
const EnumPropertyItem * BKE_preferences_active_section_itemf(const UserDef *userdef, bool *r_free)
@ ASSET_LIBRARY_PROJECT_DEFINED
@ ASSET_LIBRARY_USE_REMOTE_URL
void userpref_panels_register(ARegionType ®ion_type)
struct bUserAssetLibrary * BKE_preferences_asset_library_add(struct UserDef *userdef, const char *name, const char *dirpath) ATTR_NONNULL(1)
void BKE_area_region_free(SpaceType *st, ARegion *region)
SpaceUserPref * CTX_wm_space_userpref(const bContext *C)
struct bUserAssetLibrary * BKE_preferences_remote_asset_library_add(struct UserDef *userdef, const char *name, const char *remote_url, const char *auth_token) ATTR_NONNULL(1
bool ED_region_property_search(const bContext *C, ARegion *region, ListBaseT< PanelType > *paneltypes, const char *contexts[], const char *category_override)
void BKE_preferences_asset_library_remove(struct UserDef *userdef, struct bUserAssetLibrary *library) ATTR_NONNULL()
static void userpref_free(SpaceLink *sl)
static void userpref_main_region_layout(const bContext *C, ARegion *region)
static void userpref_header_region_draw(const bContext *C, ARegion *region)
bool ED_userpref_tab_has_search_result(SpaceUserPref *sprefs, int index)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
ARegion * BKE_area_region_copy(const SpaceType *st, const ARegion *region)
static SpaceLink * userpref_duplicate(SpaceLink *sl)
static void userpref_search_all_tabs(const bContext *C, SpaceUserPref *sprefs, ARegion *region_original, const Span< int > context_tabs_array)
static SpaceLink * userpref_create(const ScrArea *area, const Scene *)
struct bUserAssetLibrary * BKE_preferences_project_asset_library_add(struct UserDef *userdef, const char *name, const char *dirpath, std::optional< UUID > uuid=std::nullopt) ATTR_NONNULL(1)
void BKE_preferences_remote_to_name(const char *remote_url, char name[64])
void BLI_path_slash_rstrip(char *path) ATTR_NONNULL(1)
@ USER_SECTION_EXTENSIONS
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void userpref_main_region_listener(const wmRegionListenerParams *)
void ED_userpref_asset_library_remove(bContext *C, struct bUserAssetLibrary *asset_library)
struct bUserAssetLibrary * ED_userpref_asset_library_new(const struct bContext *C, const char *name, const char *dirpath, bUserAssetLibraryAddType library_type, bool is_project_defined, std::optional< UUID > uuid, std::optional< char * > auth_token)
static void userpref_blend_read_data(BlendDataReader *, SpaceLink *sl)
void ED_region_panels(const bContext *C, ARegion *region)
struct bUserAssetLibrary bUserAssetLibrary * BKE_preferences_project_remote_asset_library_add(UserDef *userdef, const char *name, const char *remote_url, const char *auth_token) ATTR_NONNULL(1
static void userpref_main_region_init(wmWindowManager *wm, ARegion *region)
Vector< int > ED_userpref_tabs_list(SpaceUserPref *prefs)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
static void userpref_init(wmWindowManager *, ScrArea *)
static bool property_search_for_context(const bContext *C, ARegion *region, SpaceProperties *sbuts)
static void userpref_main_region_property_search(const bContext *C, SpaceUserPref *sprefs, ARegion *region)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
ARegion * BKE_area_region_new()
const char * ED_userpref_search_string_get(SpaceUserPref *sprefs)
void ED_region_panels_layout_ex(const bContext *C, ARegion *region, ListBaseT< PanelType > *paneltypes, wm::OpCallContext op_context, const char *contexts[], const char *category_override)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_str_tolower_ascii(char *str, size_t len) ATTR_NONNULL(1)
int ED_userpref_search_string_length(SpaceUserPref *sprefs)
void ED_userpref_search_string_set(SpaceUserPref *sprefs, const char *value)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
@ V2D_SCROLL_VERTICAL_HIDE
const EnumPropertyItem rna_enum_preference_section_items[]
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
void ED_spacetype_userpref()
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void userpref_keymap(wmKeyConfig *keyconf)
static void userpref_execute_region_init(wmWindowManager *wm, ARegion *region)
int userpref_ui_asset_libraries_count()
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
static void userpref_navigation_region_listener(const wmRegionListenerParams *)
static bool userpref_execute_region_poll(const RegionPollParams *params)
void ED_region_header_init(ARegion *region)
@ HideSinglePanelCategories
static void userpref_header_region_init(wmWindowManager *, ARegion *region)
void CTX_wm_region_set(bContext *C, ARegion *region)
void ED_region_panels_layout(const bContext *C, ARegion *region)
@ RGN_FLAG_INDICATE_OVERFLOW
@ RGN_FLAG_NO_USER_RESIZE
@ RGN_FLAG_SEARCH_FILTER_ACTIVE
@ RGN_FLAG_SEARCH_FILTER_UPDATE
void ED_userpref_asset_library_active_set(const struct bUserAssetLibrary &asset_library)
void ED_region_header(const bContext *C, ARegion *region)
static void userpref_search_move_to_next_tab_with_results(SpaceUserPref *sbuts, const Span< int > context_tabs_array)
void ED_region_panels_draw(const bContext *C, ARegion *region)
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
static void userpref_execute_region_listener(const wmRegionListenerParams *)
static void userpref_space_blend_write(BlendWriter *writer, SpaceLink *sl)
static void userpref_navigation_region_init(wmWindowManager *wm, ARegion *region)
void CTX_wm_area_set(bContext *C, ScrArea *area)
void(*) draw(const bContext *C, ARegion *region)
void(*) listener(const wmRegionListenerParams *params)
void(*) layout(const bContext *C, ARegion *region)
bool(*) poll(const RegionPollParams *params)
ListBaseT< PanelType > paneltypes
void(*) init(wmWindowManager *wm, ARegion *region)
ListBaseT< Panel > panels
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
ListBaseT< SpaceLink > spacedata
std::array< bool, USER_SECTION_DEVELOPER_TOOLS *2 > tab_search_results
std::string search_string
SpaceUserPref_Runtime * runtime
ListBaseT< ARegion > regionbase
eView2D_KeepZoom keepzoom
ListBaseT< wmEventHandler > handlers
struct ARegionType * type