UI: remove redundant RNA_TYPE property in the key-map editor
authorCampbell Barton <ideasman42@gmail.com>
Sun, 16 Jun 2019 23:08:17 +0000 (09:08 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 16 Jun 2019 23:08:17 +0000 (09:08 +1000)
.clang-format
source/blender/editors/interface/interface_templates.c
source/blender/makesrna/RNA_access.h

index 36c5643..6286087 100644 (file)
@@ -236,6 +236,7 @@ ForEachMacros:
   - RNA_BEGIN
   - RNA_PROP_BEGIN
   - RNA_STRUCT_BEGIN
+  - RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
   - SEQP_BEGIN
   - SEQ_BEGIN
   - foreach
index 58d352a..5d3ef5c 100644 (file)
@@ -6450,7 +6450,7 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title,
 
   flow = uiLayoutColumnFlow(layout, 2, false);
 
-  RNA_STRUCT_BEGIN (ptr, prop) {
+  RNA_STRUCT_BEGIN_SKIP_RNA_TYPE (ptr, prop) {
     const bool is_set = RNA_property_is_set(ptr, prop);
     uiBut *but;
 
index 9316f27..5045137 100644 (file)
@@ -1264,6 +1264,17 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name);
          RNA_property_collection_next(&rna_macro_iter)) { \
       PropertyRNA *prop = (PropertyRNA *)rna_macro_iter.ptr.data;
 
+#define RNA_STRUCT_BEGIN_SKIP_RNA_TYPE(sptr, prop) \
+  { \
+    CollectionPropertyIterator rna_macro_iter; \
+    RNA_property_collection_begin( \
+        sptr, RNA_struct_iterator_property((sptr)->type), &rna_macro_iter); \
+    if (rna_macro_iter.valid) { \
+      RNA_property_collection_next(&rna_macro_iter); \
+    } \
+    for (; rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { \
+      PropertyRNA *prop = (PropertyRNA *)rna_macro_iter.ptr.data;
+
 #define RNA_STRUCT_END \
   } \
   RNA_property_collection_end(&rna_macro_iter); \