diff options
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r-- | source/blender/freestyle/FRS_freestyle.h | 3 | ||||
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | 26 |
2 files changed, 27 insertions, 2 deletions
diff --git a/source/blender/freestyle/FRS_freestyle.h b/source/blender/freestyle/FRS_freestyle.h index 9a40fc3e019..376663e0a21 100644 --- a/source/blender/freestyle/FRS_freestyle.h +++ b/source/blender/freestyle/FRS_freestyle.h @@ -65,7 +65,8 @@ extern "C" { void FRS_move_module_up(FreestyleConfig *config, FreestyleModuleConfig *module_conf); void FRS_move_module_down(FreestyleConfig *config, FreestyleModuleConfig *module_conf); - void FRS_add_lineset(FreestyleConfig *config); + FreestyleLineSet *FRS_add_lineset(FreestyleConfig *config); + void FRS_copy_active_lineset(FreestyleConfig *config); void FRS_delete_active_lineset(FreestyleConfig *config); void FRS_move_active_lineset_up(FreestyleConfig *config); void FRS_move_active_lineset_down(FreestyleConfig *config); diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index d88331b7a04..d85ab0b6e82 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -542,7 +542,7 @@ extern "C" { BLI_insertlinkafter(&config->modules, module_conf->next, module_conf); } - void FRS_add_lineset(FreestyleConfig *config) + FreestyleLineSet *FRS_add_lineset(FreestyleConfig *config) { int lineset_index = BLI_countlist(&config->linesets); @@ -563,6 +563,30 @@ extern "C" { else strcpy(lineset->name, "LineSet"); BLI_uniquename(&config->linesets, lineset, "FreestyleLineSet", '.', offsetof(FreestyleLineSet, name), sizeof(lineset->name)); + + return lineset; + } + + void FRS_copy_active_lineset(FreestyleConfig *config) + { + FreestyleLineSet *lineset = FRS_get_active_lineset(config); + + if (lineset) { + FreestyleLineSet *new_lineset = FRS_add_lineset(config); + new_lineset->linestyle = lineset->linestyle; + new_lineset->linestyle->id.us++; + new_lineset->flags = lineset->flags; + new_lineset->selection = lineset->selection; + new_lineset->qi = lineset->qi; + new_lineset->qi_start = lineset->qi_start; + new_lineset->qi_end = lineset->qi_end; + new_lineset->edge_types = lineset->edge_types; + if (lineset->group) { + new_lineset->group = lineset->group; + new_lineset->group->id.us++; + } + new_lineset->flags |= FREESTYLE_LINESET_CURRENT; + } } void FRS_delete_active_lineset(FreestyleConfig *config) |