[Bf-blender-cvs] [ac3d4774810] blender2.8: RNA: Query is_updated flag from object data ID's rather than from object itself

Sergey Sharybin noreply at git.blender.org
Wed Dec 13 16:44:20 CET 2017


Commit: ac3d477481006933be2359581eb590cd3f2bf2d6
Author: Sergey Sharybin
Date:   Wed Dec 13 16:22:35 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBac3d477481006933be2359581eb590cd3f2bf2d6

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

===================================================================

M	source/blender/makesrna/intern/rna_ID.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 44df8916796..c7446b5674a 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -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);



More information about the Bf-blender-cvs mailing list