[Bf-blender-cvs] [54d7dea2833] master: Fix: buttons whose property contains an 'owner_id' ignore rna undo check

Germano Cavalcante noreply at git.blender.org
Tue Mar 30 21:13:47 CEST 2021


Commit: 54d7dea283360a8a4f46733feb7b3ec731eafafc
Author: Germano Cavalcante
Date:   Tue Mar 30 16:10:58 2021 -0300
Branches: master
https://developer.blender.org/rB54d7dea283360a8a4f46733feb7b3ec731eafafc

Fix: buttons whose property contains an 'owner_id' ignore rna undo check

Introduced in rBce462fa1 but harmless since curretly only `StructRNA`
without `owner_id` have the `STRUCT_UNDO` flag cleared.

So this commit does not bring any functional changes but it will be
useful for {D10695}.

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

M	source/blender/editors/interface/interface.c
M	source/blender/makesrna/RNA_types.h

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

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 29d26359c8b..6caee42ac33 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1038,7 +1038,6 @@ static bool ui_but_is_rna_undo(const uiBut *but)
     if (ID_CHECK_UNDO(id) == false) {
       return false;
     }
-    return true;
   }
   if (but->rnapoin.type && !RNA_struct_undo_check(but->rnapoin.type)) {
     return false;
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index c4f6707dad5..78192f937e6 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -619,7 +619,7 @@ typedef enum StructFlag {
   /** Indicates that this struct is an ID struct, and to use reference-counting. */
   STRUCT_ID = (1 << 0),
   STRUCT_ID_REFCOUNT = (1 << 1),
-  /** defaults on, clear for user preferences and similar */
+  /** defaults on, indicates when changes in members of a StructRNA should trigger undo steps. */
   STRUCT_UNDO = (1 << 2),
 
   /* internal flags */



More information about the Bf-blender-cvs mailing list