Liboverride: Add rna array index return value to BKE_lib_override_rna_property_find
.
Very useful e.g. for dealing with FCurves search.
This commit is contained in:
@@ -281,11 +281,14 @@ void BKE_lib_override_library_property_delete(struct IDOverrideLibrary *override
|
||||
*
|
||||
* \param idpoin: Pointer to the override ID.
|
||||
* \param library_prop: The library override property to find the matching RNA property for.
|
||||
* \param r_index: The RNA array flat index (i.e. flatened index in case of multi-dimensional array
|
||||
* properties). See #RNA_path_resolve_full familly of functions for details.
|
||||
*/
|
||||
bool BKE_lib_override_rna_property_find(struct PointerRNA *idpoin,
|
||||
const struct IDOverrideLibraryProperty *library_prop,
|
||||
struct PointerRNA *r_override_poin,
|
||||
struct PropertyRNA **r_override_prop);
|
||||
struct PropertyRNA **r_override_prop,
|
||||
int *r_index);
|
||||
|
||||
/**
|
||||
* Find override property operation from given sub-item(s), if it exists.
|
||||
|
@@ -312,7 +312,6 @@ bool BKE_lib_override_library_is_user_edited(const ID *id)
|
||||
|
||||
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id)
|
||||
{
|
||||
|
||||
if (ID_IS_OVERRIDE_LIBRARY(id)) {
|
||||
const ID *override_owner_id;
|
||||
lib_override_get(bmain, id, &override_owner_id);
|
||||
@@ -2677,11 +2676,12 @@ IDOverrideLibraryProperty *BKE_lib_override_library_property_get(IDOverrideLibra
|
||||
bool BKE_lib_override_rna_property_find(PointerRNA *idpoin,
|
||||
const IDOverrideLibraryProperty *library_prop,
|
||||
PointerRNA *r_override_poin,
|
||||
PropertyRNA **r_override_prop)
|
||||
PropertyRNA **r_override_prop,
|
||||
int *r_index)
|
||||
{
|
||||
BLI_assert(RNA_struct_is_ID(idpoin->type) && ID_IS_OVERRIDE_LIBRARY(idpoin->data));
|
||||
return RNA_path_resolve_property(
|
||||
idpoin, library_prop->rna_path, r_override_poin, r_override_prop);
|
||||
return RNA_path_resolve_property_full(
|
||||
idpoin, library_prop->rna_path, r_override_poin, r_override_prop, r_index);
|
||||
}
|
||||
|
||||
void lib_override_library_property_copy(IDOverrideLibraryProperty *op_dst,
|
||||
|
@@ -67,8 +67,10 @@ void TreeElementOverridesBase::expand(SpaceOutliner &space_outliner) const
|
||||
|
||||
for (auto *override_prop :
|
||||
ListBaseWrapper<IDOverrideLibraryProperty>(id.override_library->properties)) {
|
||||
int rnaprop_index = 0;
|
||||
const bool is_rna_path_valid = BKE_lib_override_rna_property_find(
|
||||
&idpoin, override_prop, &override_rna_ptr, &override_rna_prop);
|
||||
&idpoin, override_prop, &override_rna_ptr, &override_rna_prop, &rnaprop_index);
|
||||
|
||||
if (is_rna_path_valid && !show_system_overrides &&
|
||||
ELEM(override_prop->rna_prop_type, PROP_POINTER, PROP_COLLECTION) &&
|
||||
RNA_struct_is_ID(RNA_property_pointer_type(&override_rna_ptr, override_rna_prop))) {
|
||||
|
Reference in New Issue
Block a user