allow action groups with "" name, (just uses "Group" instead)

This commit is contained in:
Campbell Barton
2010-04-01 08:39:08 +00:00
parent 86a112e8a5
commit d1fef786b7
2 changed files with 4 additions and 2 deletions

View File

@@ -244,7 +244,7 @@ bActionGroup *action_groups_add_new (bAction *act, const char name[])
bActionGroup *agrp;
/* sanity check: must have action and name */
if (ELEM(NULL, act, name) || (name[0] == 0))
if (ELEM(NULL, act, name))
return NULL;
/* allocate a new one */
@@ -252,7 +252,7 @@ bActionGroup *action_groups_add_new (bAction *act, const char name[])
/* make it selected, with default name */
agrp->flag = AGRP_SELECTED;
strncpy(agrp->name, name, sizeof(agrp->name));
strncpy(agrp->name, name[0] ? name : "Group", sizeof(agrp->name));
/* add to action, and validate */
BLI_addtail(&act->groups, agrp);

View File

@@ -38,6 +38,8 @@
#include "BLI_math.h"
#include "BKE_action.h"
#include "WM_types.h"
#include "ED_keyframing.h"