diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-10 18:32:22 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-11 12:57:40 +0400 |
commit | 39c078202d6441fad4de1c92d0b61d05937595be (patch) | |
tree | 6b289642ffa2edc6d3b6e5c16a8ece99c8e8785a /source/blender/blenkernel/intern | |
parent | c88e65da61ff8a0aeaa2df0330e69654b08f7b7e (diff) |
Added BKE_freestyle_lineset_delete() by generalizing FRS_delete_active_lineset().
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/freestyle.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c index f5a9ba4e241..2ab49538ba2 100644 --- a/source/blender/blenkernel/intern/freestyle.c +++ b/source/blender/blenkernel/intern/freestyle.c @@ -195,6 +195,21 @@ FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config) return lineset; } +bool BKE_freestyle_lineset_delete(FreestyleConfig *config, FreestyleLineSet *lineset) +{ + if (BLI_findindex(&config->linesets, lineset) == -1) + return false; + if (lineset->group) { + lineset->group->id.us--; + } + if (lineset->linestyle) { + lineset->linestyle->id.us--; + } + BLI_remlink(&config->linesets, lineset); + MEM_freeN(lineset); + return true; +} + FreestyleLineSet *BKE_freestyle_lineset_get_active(FreestyleConfig *config) { FreestyleLineSet *lineset; |