RNA: demote non-strict class naming to warning
authorCampbell Barton <ideasman42@gmail.com>
Fri, 1 Sep 2017 07:06:14 +0000 (17:06 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 1 Sep 2017 07:06:14 +0000 (17:06 +1000)
This stops a lot of add-ons from registering,
while this must be resolved but there no need to force error just now.

source/blender/makesrna/intern/rna_access.c

index 09d2d91a51ca5ef88feb2e1206befaa464e3e0e2..bfa1e7cef9356ad5be9e5eb0035dd61a51cf4120 100644 (file)
@@ -855,9 +855,17 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi
        const int len_sep = strlen(sep);
        const int len_id = strlen(identifier);
        const char *p = strstr(identifier, sep);
+       /* TODO: make error, for now warning until add-ons update. */
+#if 1
+       const int report_level = RPT_WARNING;
+       const bool failure = true;
+#else
+       const int report_level = RPT_ERROR;
+       const bool failure = false;
+#endif
        if (p == NULL || p == identifier || p + len_sep >= identifier + len_id) {
-               BKE_reportf(reports, RPT_ERROR, "'%s' doesn't contain '%s' with prefix & suffix", identifier, sep);
-               return false;
+               BKE_reportf(reports, report_level, "'%s' doesn't contain '%s' with prefix & suffix", identifier, sep);
+               return failure;
        }
 
        const char *c, *start, *end, *last;
@@ -869,8 +877,8 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi
                     ((c != start) && (*c >= '0' && *c <= '9')) ||
                     ((c != start) && (c != last) && (*c == '_'))) == 0)
                {
-                       BKE_reportf(reports, RPT_ERROR, "'%s' doesn't have upper case alpha-numeric prefix", identifier);
-                       return false;
+                       BKE_reportf(reports, report_level, "'%s' doesn't have upper case alpha-numeric prefix", identifier);
+                       return failure;
                }
        }
 
@@ -883,8 +891,8 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi
                     (*c >= '0' && *c <= '9') ||
                     ((c != start) && (c != last) && (*c == '_'))) == 0)
                {
-                       BKE_reportf(reports, RPT_ERROR, "'%s' doesn't have an alpha-numeric suffix", identifier);
-                       return false;
+                       BKE_reportf(reports, report_level, "'%s' doesn't have an alpha-numeric suffix", identifier);
+                       return failure;
                }
        }
        return true;