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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-05-11 12:50:16 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-05-11 12:57:43 +0400
commit3844e30e452238eaab58c458916a57fc600ce531 (patch)
treea080e334b4834873eb9766cfec5f10add74f47a7 /source/blender/blenkernel/intern/freestyle.c
parentd930c63f0367bbd56832be3eecbc39bbbb7f024a (diff)
Freestyle: Added handling of a user-specified name for creating a new line set.
Diffstat (limited to 'source/blender/blenkernel/intern/freestyle.c')
-rw-r--r--source/blender/blenkernel/intern/freestyle.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c
index 4bf68af8b65..495e99d61af 100644
--- a/source/blender/blenkernel/intern/freestyle.c
+++ b/source/blender/blenkernel/intern/freestyle.c
@@ -169,7 +169,7 @@ static FreestyleLineSet *alloc_lineset(void)
return (FreestyleLineSet *)MEM_callocN(sizeof(FreestyleLineSet), "Freestyle line set");
}
-FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config)
+FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config, const char *name)
{
int lineset_index = BLI_countlist(&config->linesets);
@@ -186,10 +186,15 @@ FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config)
lineset->edge_types = FREESTYLE_FE_SILHOUETTE | FREESTYLE_FE_BORDER | FREESTYLE_FE_CREASE;
lineset->exclude_edge_types = 0;
lineset->group = NULL;
- if (lineset_index > 0)
+ if (name) {
+ BLI_strncpy(lineset->name, name, sizeof(lineset->name));
+ }
+ else if (lineset_index > 0) {
sprintf(lineset->name, "LineSet %i", lineset_index + 1);
- else
+ }
+ else {
strcpy(lineset->name, "LineSet");
+ }
BKE_freestyle_lineset_unique_name(config, lineset);
return lineset;