[Bf-blender-cvs] [9361fea99f1] master: RNA: disable undo on OperatorProperties and its subclasses.
Alexander Gavrilov
noreply at git.blender.org
Mon May 13 11:38:18 CEST 2019
Commit: 9361fea99f18b5533011b5a12abfe862ba91b3e7
Author: Alexander Gavrilov
Date: Mon May 13 12:36:39 2019 +0300
Branches: master
https://developer.blender.org/rB9361fea99f18b5533011b5a12abfe862ba91b3e7
RNA: disable undo on OperatorProperties and its subclasses.
Since these are temporary properties, changing them shouldn't cause
undo pushes. There already is a flag to disable that, but since each
operator inherits its own properties from the base, RNA define code
also had to be changed to allow inheriting the flag.
===================================================================
M source/blender/makesrna/intern/rna_define.c
M source/blender/makesrna/intern/rna_wm.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 20fbbed572c..8e24e9a8364 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -890,9 +890,9 @@ StructRNA *RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRN
srna->description = "";
/* may be overwritten later RNA_def_struct_translation_context */
srna->translation_context = BLT_I18NCONTEXT_DEFAULT_BPYRNA;
- srna->flag |= STRUCT_UNDO;
if (!srnafrom) {
srna->icon = ICON_DOT;
+ srna->flag |= STRUCT_UNDO;
}
if (DefRNA.preprocess) {
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 3f904df6e00..66904cae82c 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1868,6 +1868,7 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_struct_idprops_func(srna, "rna_OperatorProperties_idprops");
RNA_def_struct_property_tags(srna, rna_enum_operator_property_tags);
RNA_def_struct_flag(srna, STRUCT_NO_DATABLOCK_IDPROPERTIES);
+ RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
}
static void rna_def_macro_operator(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list