diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_freestyle.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/freestyle.c | 11 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 |
4 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_freestyle.h b/source/blender/blenkernel/BKE_freestyle.h index e3e73cddbc0..195c15fd837 100644 --- a/source/blender/blenkernel/BKE_freestyle.h +++ b/source/blender/blenkernel/BKE_freestyle.h @@ -50,7 +50,7 @@ void BKE_freestyle_module_move_up(FreestyleConfig *config, FreestyleModuleConfig void BKE_freestyle_module_move_down(FreestyleConfig *config, FreestyleModuleConfig *module_conf); /* FreestyleConfig.linesets */ -FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config); +FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config, const char *name); bool BKE_freestyle_lineset_delete(FreestyleConfig *config, FreestyleLineSet *lineset); FreestyleLineSet *BKE_freestyle_lineset_get_active(FreestyleConfig *config); short BKE_freestyle_lineset_get_active_index(FreestyleConfig *config); 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; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 73659db8910..97f6b346666 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -712,7 +712,7 @@ static int freestyle_lineset_add_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); - BKE_freestyle_lineset_add(&srl->freestyleConfig); + BKE_freestyle_lineset_add(&srl->freestyleConfig, NULL); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a97c0cf5da3..bf2858c44e6 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1586,7 +1586,7 @@ static void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value static FreestyleLineSet *FreestyleSettings_lineset_add(ID *id, struct FreestyleSettings *config, const char *name) { Scene *scene = (Scene *)id; - FreestyleLineSet *lineset = BKE_freestyle_lineset_add((FreestyleConfig *)config); + FreestyleLineSet *lineset = BKE_freestyle_lineset_add((FreestyleConfig *)config, name); DAG_id_tag_update(&scene->id, 0); WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); |