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:
-rw-r--r--source/blender/makesdna/DNA_screen_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_ui.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 556923cea54..b96349e3d07 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -315,6 +315,9 @@ enum {
#define PNL_DEFAULT_CLOSED 1
#define PNL_NO_HEADER 2
+/* Default panel category. */
+#define PNL_DEFAULT_CATEGORY "Misc"
+
/* uiList layout_type */
enum {
UILST_LAYOUT_DEFAULT = 0,
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index f14fadfa722..03578649d2b 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -201,6 +201,9 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
/* We have to set default context! Else we get a void string... */
strcpy(dummypt.translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA);
+ /* We have to set default category! Else we get a void string, and panel goes everywhere! */
+ strcpy(dummypt.category, PNL_DEFAULT_CATEGORY);
+
/* validate the python class */
if (validate(&dummyptr, data, have_function) != 0)
return NULL;
@@ -987,7 +990,7 @@ static void rna_def_panel(BlenderRNA *brna)
prop = RNA_def_property(srna, "bl_category", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->category");
- RNA_def_property_string_default(prop, BLF_I18NCONTEXT_DEFAULT_BPYRNA);
+ RNA_def_property_string_default(prop, PNL_DEFAULT_CATEGORY);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);