RNA: Query is_updated flag from object data ID's rather than from object itself

This commit is contained in:
Sergey Sharybin 2017-12-13 16:22:35 +01:00
parent 84c5ccca74
commit ac3d477481
1 changed files with 15 additions and 1 deletions

View File

@ -772,6 +772,20 @@ static PointerRNA rna_IDPreview_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_ImagePreview, prv_img);
}
static int rna_ID_is_updated_data_get(PointerRNA *ptr)
{
ID *id = (ID *)ptr->data;
if (GS(id->name) != ID_OB) {
return 0;
}
Object *object = (Object *)id;
ID *data = object->data;
if (data == NULL) {
return 0;
}
return ((data->tag & LIB_TAG_ID_RECALC_ALL) != 0);
}
static PointerRNA rna_ID_override_reference_get(PointerRNA *ptr)
{
ID *id = (ID *)ptr->data;
@ -1028,8 +1042,8 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Is Updated", "Data-block is tagged for recalculation");
prop = RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tag", LIB_TAG_ID_RECALC_DATA);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_ID_is_updated_data_get", NULL);
RNA_def_property_ui_text(prop, "Is Updated Data", "Data-block data is tagged for recalculation");
prop = RNA_def_property(srna, "is_library_indirect", PROP_BOOLEAN, PROP_NONE);