diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-01 12:39:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-01 12:39:08 +0400 |
commit | d1fef786b721183ebe20eeb7ada887db804d2560 (patch) | |
tree | 15aa6659f3a0443124d5e10b296fd57ea86c3ad4 | |
parent | 86a112e8a521001669eeb939eeae3a87acac7f1a (diff) |
allow action groups with "" name, (just uses "Group" instead)
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 7f8ae06a848..365ac2371b8 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -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); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 0e60616c4db..c1887a40583 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -38,6 +38,8 @@ #include "BLI_math.h" +#include "BKE_action.h" + #include "WM_types.h" #include "ED_keyframing.h" |