2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2010 Blender Foundation.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 #ifndef __BKE_LINESTYLE_H__
29 #define __BKE_LINESTYLE_H__
31 /** \file BKE_linestyle.h
33 * \brief Blender kernel freestyle line style functionality.
36 #include "DNA_linestyle_types.h"
42 #define LS_MODIFIER_TYPE_COLOR 1
43 #define LS_MODIFIER_TYPE_ALPHA 2
44 #define LS_MODIFIER_TYPE_THICKNESS 3
45 #define LS_MODIFIER_TYPE_GEOMETRY 4
53 void BKE_linestyle_init(struct FreestyleLineStyle *linestyle);
54 FreestyleLineStyle *BKE_linestyle_new(struct Main *bmain, const char *name);
55 void BKE_linestyle_free(FreestyleLineStyle *linestyle);
56 void BKE_linestyle_copy_data(
57 struct Main *bmain, struct FreestyleLineStyle *linestyle_dst, const struct FreestyleLineStyle *linestyle_src,
59 FreestyleLineStyle *BKE_linestyle_copy(struct Main *bmain, const FreestyleLineStyle *linestyle);
61 void BKE_linestyle_make_local(struct Main *bmain, struct FreestyleLineStyle *linestyle, const bool lib_local);
63 FreestyleLineStyle *BKE_linestyle_active_from_view_layer(struct ViewLayer *view_layer);
65 LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
66 LineStyleModifier *BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
67 LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
68 LineStyleModifier *BKE_linestyle_geometry_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
70 LineStyleModifier *BKE_linestyle_color_modifier_copy(
71 FreestyleLineStyle *linestyle, const LineStyleModifier *m, const int flag);
72 LineStyleModifier *BKE_linestyle_alpha_modifier_copy(
73 FreestyleLineStyle *linestyle, const LineStyleModifier *m, const int flag);
74 LineStyleModifier *BKE_linestyle_thickness_modifier_copy(
75 FreestyleLineStyle *linestyle, const LineStyleModifier *m, const int flag);
76 LineStyleModifier *BKE_linestyle_geometry_modifier_copy(
77 FreestyleLineStyle *linestyle, const LineStyleModifier *m, const int flag);
79 int BKE_linestyle_color_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
80 int BKE_linestyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
81 int BKE_linestyle_thickness_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
82 int BKE_linestyle_geometry_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
84 bool BKE_linestyle_color_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
85 bool BKE_linestyle_alpha_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
86 bool BKE_linestyle_thickness_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
87 bool BKE_linestyle_geometry_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
89 void BKE_linestyle_modifier_list_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
90 char *BKE_linestyle_path_to_color_ramp(FreestyleLineStyle *linestyle, struct ColorBand *color_ramp);
92 bool BKE_linestyle_use_textures(FreestyleLineStyle *linestyle, const bool use_shading_nodes);
94 void BKE_linestyle_default_shader(const struct bContext *C, FreestyleLineStyle *linestyle);
100 #endif /* __BKE_LINESTYLE_H__ */