Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-08-31 11:42:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-31 11:45:00 +0300
commit732f70a151c47dc55e9da33c0bf346764bb54ab6 (patch)
tree2662364fdee1240178eb5a4f78767cd2dc250711 /source/blender/makesrna/intern/rna_wm.c
parent4f1b510d75aea996dcdc65dd147d9f798a50bc1c (diff)
RNA: existing type check used wrong identifier
Own error in recent type checks, in many cases the 'idname' is used for the struct identifier, not the 'identifier' which is the Python class name in this context.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 2114c22b428..8547c50f78e 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1157,15 +1157,17 @@ static StructRNA *rna_Operator_register(
if (!RNA_struct_available_or_report(reports, identifier)) {
return NULL;
}
- if (!WM_operator_py_idname_ok_or_report(reports, identifier, temp_buffers.idname)) {
+
+ char idname_conv[sizeof(dummyop.idname)];
+ WM_operator_bl_idname(idname_conv, temp_buffers.idname); /* convert the idname from python */
+
+ if (!WM_operator_py_idname_ok_or_report(reports, idname_conv, temp_buffers.idname)) {
return NULL;
}
/* Convert foo.bar to FOO_OT_bar
* allocate all strings at once. */
{
- char idname_conv[sizeof(dummyop.idname)];
- WM_operator_bl_idname(idname_conv, temp_buffers.idname); /* convert the idname from python */
const char *strings[] = {
idname_conv,
temp_buffers.name,
@@ -1292,18 +1294,21 @@ static StructRNA *rna_MacroOperator_register(
if (ot && ot->ext.srna)
rna_Operator_unregister(bmain, ot->ext.srna);
}
- if (!RNA_struct_available_or_report(reports, identifier)) {
+
+ if (!WM_operator_py_idname_ok_or_report(reports, identifier, temp_buffers.idname)) {
return NULL;
}
- if (!WM_operator_py_idname_ok_or_report(reports, identifier, temp_buffers.idname)) {
+
+ char idname_conv[sizeof(dummyop.idname)];
+ WM_operator_bl_idname(idname_conv, temp_buffers.idname); /* convert the idname from python */
+
+ if (!RNA_struct_available_or_report(reports, idname_conv)) {
return NULL;
}
/* Convert foo.bar to FOO_OT_bar
* allocate all strings at once. */
{
- char idname_conv[sizeof(dummyop.idname)];
- WM_operator_bl_idname(idname_conv, temp_buffers.idname); /* convert the idname from python */
const char *strings[] = {
idname_conv,
temp_buffers.name,