diff options
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_ui_common.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c index 821c74496f2..6b2facc16a2 100644 --- a/source/blender/modifiers/intern/MOD_ui_common.c +++ b/source/blender/modifiers/intern/MOD_ui_common.c @@ -409,13 +409,9 @@ static void modifier_panel_header(const bContext *C, Panel *panel) */ PanelType *modifier_panel_register(ARegionType *region_type, ModifierType type, PanelDrawFn draw) { - /* Get the name for the modifier's panel. */ - char panel_idname[BKE_ST_MAXNAME]; - BKE_modifier_type_panel_id(type, panel_idname); + PanelType *panel_type = MEM_callocN(sizeof(PanelType), __func__); - PanelType *panel_type = MEM_callocN(sizeof(PanelType), panel_idname); - - BLI_strncpy(panel_type->idname, panel_idname, BKE_ST_MAXNAME); + BKE_modifier_type_panel_id(type, panel_type->idname); BLI_strncpy(panel_type->label, "", BKE_ST_MAXNAME); BLI_strncpy(panel_type->context, "modifier", BKE_ST_MAXNAME); BLI_strncpy(panel_type->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA, BKE_ST_MAXNAME); @@ -450,13 +446,9 @@ PanelType *modifier_subpanel_register(ARegionType *region_type, PanelDrawFn draw, PanelType *parent) { - /* Create the subpanel's ID name. */ - char panel_idname[BKE_ST_MAXNAME]; - BLI_snprintf(panel_idname, BKE_ST_MAXNAME, "%s_%s", parent->idname, name); - - PanelType *panel_type = MEM_callocN(sizeof(PanelType), panel_idname); + PanelType *panel_type = MEM_callocN(sizeof(PanelType), __func__); - BLI_strncpy(panel_type->idname, panel_idname, BKE_ST_MAXNAME); + BLI_snprintf(panel_type->idname, BKE_ST_MAXNAME, "%s_%s", parent->idname, name); BLI_strncpy(panel_type->label, label, BKE_ST_MAXNAME); BLI_strncpy(panel_type->context, "modifier", BKE_ST_MAXNAME); BLI_strncpy(panel_type->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA, BKE_ST_MAXNAME); |