PyAPI: Allow prop collection raw array read access for non-editable props #114063
|
@ -454,6 +454,7 @@ bool RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, Pointe
|
|||
int RNA_property_collection_raw_array(PointerRNA *ptr,
|
||||
PropertyRNA *prop,
|
||||
|
||||
PropertyRNA *itemprop,
|
||||
int set,
|
||||
RawArray *array);
|
||||
int RNA_property_collection_raw_get(struct ReportList *reports,
|
||||
PointerRNA *ptr,
|
||||
|
|
|
@ -4408,6 +4408,7 @@ bool RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, Pointe
|
|||
int RNA_property_collection_raw_array(PointerRNA *ptr,
|
||||
PropertyRNA *prop,
|
||||
PropertyRNA *itemprop,
|
||||
int set,
|
||||
RawArray *array)
|
||||
{
|
||||
CollectionPropertyIterator iter;
|
||||
|
@ -4429,7 +4430,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr,
|
|||
internal = &iter.internal.array;
|
||||
arrayp = (iter.valid) ? static_cast<char *>(iter.ptr.data) : nullptr;
|
||||
|
||||
if (internal->skip || !RNA_property_editable(&iter.ptr, itemprop)) {
|
||||
if (internal->skip || (set && !RNA_property_editable(&iter.ptr, itemprop))) {
|
||||
/* we might skip some items, so it's not a proper array */
|
||||
RNA_property_collection_end(&iter);
|
||||
return 0;
|
||||
|
@ -4587,7 +4588,7 @@ static int rna_raw_access(ReportList *reports,
|
|||
itemprop = nullptr;
|
||||
}
|
||||
/* try to access as raw array */
|
||||
else if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
|
||||
else if (RNA_property_collection_raw_array(ptr, prop, itemprop, set, &out)) {
|
||||
int arraylen = (itemlen == 0) ? 1 : itemlen;
|
||||
if (in.len != arraylen * out.len) {
|
||||
BKE_reportf(reports,
|
||||
|
|
Loading…
Reference in New Issue
Would rather use
bool
when adding new boolean parameters. usage ofint
for these is only for historical reasons, and (still) needs to be cleaned up...