Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/idtype.c
| Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | if (id_type != NULL && (id_type->flags & IDTYPE_FLAGS_ONLY_APPEND) != 0) { | ||||
| /* Only appendable ID types should also always be linkable. */ | /* Only appendable ID types should also always be linkable. */ | ||||
| BLI_assert((id_type->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0); | BLI_assert((id_type->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0); | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /** | /** | ||||
| * Check if an ID type can try to reuse and existing matching local one when being appended again. | |||||
| * | |||||
| * \param idcode: The IDType code to check. | |||||
| * \return Boolean, false when it cannot be re-used, true otherwise. | |||||
| */ | |||||
| bool BKE_idtype_idcode_append_is_reusable(const short idcode) | |||||
| { | |||||
| const IDTypeInfo *id_type = BKE_idtype_get_info_from_idcode(idcode); | |||||
| BLI_assert(id_type != NULL); | |||||
| if (id_type != NULL && (id_type->flags & IDTYPE_FLAGS_APPEND_IS_REUSABLE) != 0) { | |||||
| /* All appendable ID types should also always be linkable. */ | |||||
| BLI_assert((id_type->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0); | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| /** | |||||
| * Convert an \a idcode into an \a idfilter (e.g. ID_OB -> FILTER_ID_OB). | * Convert an \a idcode into an \a idfilter (e.g. ID_OB -> FILTER_ID_OB). | ||||
| */ | */ | ||||
| uint64_t BKE_idtype_idcode_to_idfilter(const short idcode) | uint64_t BKE_idtype_idcode_to_idfilter(const short idcode) | ||||
| { | { | ||||
| #define CASE_IDFILTER(_id) \ | #define CASE_IDFILTER(_id) \ | ||||
| case ID_##_id: \ | case ID_##_id: \ | ||||
| return FILTER_ID_##_id | return FILTER_ID_##_id | ||||
| ▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines | |||||