2012-12-11 22:00:22 +00:00
|
|
|
/*
|
2010-06-25 22:45:42 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2010 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2012-12-11 22:00:22 +00:00
|
|
|
#ifndef __BKE_LINESTYLE_H__
|
|
|
|
#define __BKE_LINESTYLE_H__
|
2012-12-20 07:57:26 +00:00
|
|
|
|
2012-12-11 22:00:22 +00:00
|
|
|
/** \file BKE_linestyle.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \brief Blender kernel freestyle line style functionality.
|
|
|
|
*/
|
2010-06-25 22:45:42 +00:00
|
|
|
|
2010-07-20 17:57:33 +00:00
|
|
|
#include "DNA_linestyle_types.h"
|
|
|
|
|
2014-07-19 15:33:15 +09:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-07-20 17:57:33 +00:00
|
|
|
#define LS_MODIFIER_TYPE_COLOR 1
|
|
|
|
#define LS_MODIFIER_TYPE_ALPHA 2
|
|
|
|
#define LS_MODIFIER_TYPE_THICKNESS 3
|
2011-08-19 14:05:11 +00:00
|
|
|
#define LS_MODIFIER_TYPE_GEOMETRY 4
|
2010-06-25 22:45:42 +00:00
|
|
|
|
|
|
|
struct Main;
|
2010-11-29 21:24:55 +00:00
|
|
|
struct Object;
|
2013-03-23 03:00:37 +00:00
|
|
|
struct ColorBand;
|
2014-07-16 15:25:10 +09:00
|
|
|
struct bContext;
|
2010-06-25 22:45:42 +00:00
|
|
|
|
First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.
That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.
Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.
Future plans are also to be able to relocate missing libs and reload them at runtime.
Code notes:
- Placeholder ID is just a regular datablock of same type as expected linked one,
with 'default' data, and a LIB_MISSING bitflag set.
- To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
+ Allocation of memory itself.
+ Setting of all internal data to default values.
See also the design task (T43351).
Reviewed by @campbellbarton, thanks a bunch!
Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
|
|
|
void BKE_linestyle_init(struct FreestyleLineStyle *linestyle);
|
2015-03-19 14:33:05 +11:00
|
|
|
FreestyleLineStyle *BKE_linestyle_new(struct Main *bmain, const char *name);
|
2014-07-16 15:13:40 +10:00
|
|
|
void BKE_linestyle_free(FreestyleLineStyle *linestyle);
|
2017-06-14 22:36:30 +02:00
|
|
|
FreestyleLineStyle *BKE_linestyle_copy(struct Main *bmain, const FreestyleLineStyle *linestyle);
|
2011-11-14 00:43:37 +00:00
|
|
|
|
2016-07-21 16:09:08 +02:00
|
|
|
void BKE_linestyle_make_local(struct Main *bmain, struct FreestyleLineStyle *linestyle, const bool lib_local);
|
|
|
|
|
2014-07-16 15:13:40 +10:00
|
|
|
FreestyleLineStyle *BKE_linestyle_active_from_scene(struct Scene *scene);
|
2014-07-16 13:36:39 +09:00
|
|
|
|
2014-07-17 09:23:30 +09:00
|
|
|
LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
|
|
|
|
LineStyleModifier *BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
|
|
|
|
LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
|
|
|
|
LineStyleModifier *BKE_linestyle_geometry_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type);
|
2010-07-20 17:57:33 +00:00
|
|
|
|
2017-06-14 22:36:30 +02:00
|
|
|
LineStyleModifier *BKE_linestyle_color_modifier_copy(FreestyleLineStyle *linestyle, const LineStyleModifier *m);
|
|
|
|
LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linestyle, const LineStyleModifier *m);
|
|
|
|
LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *linestyle, const LineStyleModifier *m);
|
|
|
|
LineStyleModifier *BKE_linestyle_geometry_modifier_copy(FreestyleLineStyle *linestyle, const LineStyleModifier *m);
|
2010-07-20 17:57:33 +00:00
|
|
|
|
2014-07-17 09:23:30 +09:00
|
|
|
int BKE_linestyle_color_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
|
|
|
|
int BKE_linestyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
|
|
|
|
int BKE_linestyle_thickness_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
|
|
|
|
int BKE_linestyle_geometry_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
|
2010-07-20 17:57:33 +00:00
|
|
|
|
2016-09-18 21:36:34 +02:00
|
|
|
bool BKE_linestyle_color_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
|
|
|
|
bool BKE_linestyle_alpha_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
|
|
|
|
bool BKE_linestyle_thickness_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
|
|
|
|
bool BKE_linestyle_geometry_modifier_move(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
|
2010-09-18 00:31:22 +00:00
|
|
|
|
2014-07-16 15:13:40 +10:00
|
|
|
void BKE_linestyle_modifier_list_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
|
|
|
|
char *BKE_linestyle_path_to_color_ramp(FreestyleLineStyle *linestyle, struct ColorBand *color_ramp);
|
2010-11-29 21:24:55 +00:00
|
|
|
|
2014-07-19 15:33:15 +09:00
|
|
|
bool BKE_linestyle_use_textures(FreestyleLineStyle *linestyle, const bool use_shading_nodes);
|
|
|
|
|
2014-07-16 15:25:10 +09:00
|
|
|
void BKE_linestyle_default_shader(const struct bContext *C, FreestyleLineStyle *linestyle);
|
|
|
|
|
2014-07-19 15:33:15 +09:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif /* __BKE_LINESTYLE_H__ */
|