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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-08-26 16:43:33 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-08-26 16:49:55 +0400
commit3d6ed42c3bd8a36fca074457271712d56bd4c8e5 (patch)
tree26fbfed41306ca1e462ac9cec6b81e088cbaa420 /source/blender/makesrna/intern/rna_ui.c
parent8f15be2feef6b4aee3c7de34080ccdd5bbad6658 (diff)
Fix T38999: Tool tabs and Old Addons living in perfect harmony.
Just have a default 'Misc' category (harmless for panels in non-cat context). In case we would still want a panel to show in all tabs (rather unlikely), just explicitely give an empty string to its bl_category property. Note I choose 'Misc' because it's much shorter than 'Uncategorized' (space is an issue here), it's a one-liner to change it anyway if UI Mafia does not like it!
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c5
1 files changed, 4 insertions, 1 deletions
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);