A major code update for making the DNA file specification of Freestyle settings

and RNA for it independent of the build flag for enabling Freestyle.  Suggested
by Sergey Sharybin through a code review of the branch.

* Many #ifdef WITH_FREESTYLE blocks were removed to always have Freestyle-specific
DNA file specification and RNA for it built in Blender.  This will allow Freestyle
setting survive even when a non-Freestyle build is used for loading and saving
files.  It is noted that operations are still conditionally built through #ifdef
WITH_FREESTYLE blocks.

* To this end, new blenkernel files BKE_freestyle.h and intern/freestyle.c have
been added.  All API functions in FRS_freestyle_config.h as well as some of those
in FRS_freestyle.h were moved to the new files.  Now the relocated API functions
have BKE_ prefix instead of FRS_.
This commit is contained in:
2013-03-23 03:00:37 +00:00
parent 865e80f0f4
commit 62cede96d3
71 changed files with 486 additions and 777 deletions

View File

@@ -43,6 +43,7 @@ set(SRC_DNA_INC
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_dynamicpaint_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_effect_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_fileglobal_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_freestyle_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_genfile.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_gpencil_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_group_types.h
@@ -51,6 +52,7 @@ set(SRC_DNA_INC
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_key_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_lamp_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_lattice_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_linestyle_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_listBase.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_material_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_mesh_types.h
@@ -140,9 +142,6 @@ if(WITH_OPENCOLLADA)
endif()
if(WITH_FREESTYLE)
list(APPEND SRC_DNA_INC
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_linestyle_types.h
)
add_subdirectory(freestyle)
endif()

View File

@@ -66,5 +66,6 @@ if env['WITH_BF_COLLADA']:
if env['WITH_BF_COMPOSITOR']:
SConscript (['compositor/SConscript'])
if env['WITH_BF_FREESTYLE']:
SConscript (['freestyle/SConscript'])

View File

@@ -134,9 +134,7 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
#define BLF_I18NCONTEXT_ID_BRUSH "Brush"
#define BLF_I18NCONTEXT_ID_CAMERA "Camera"
#define BLF_I18NCONTEXT_ID_CURVE "Curve"
#ifdef WITH_FREESTYLE
# define BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE "FreestyleLineStyle"
#endif
#define BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE "FreestyleLineStyle"
#define BLF_I18NCONTEXT_ID_GPENCIL "GPencil"
#define BLF_I18NCONTEXT_ID_GROUP "Group"
#define BLF_I18NCONTEXT_ID_ID "ID"

View File

@@ -59,10 +59,6 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
add_definitions(-DGLEW_STATIC)
blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -43,7 +43,4 @@ if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross':
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
env.BlenderLib ( 'bf_blenfont', sources, Split(incs), defines=defs, libtype=['core','player'], priority=[210,210] )

View File

@@ -0,0 +1,64 @@
/*
* ***** 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) 2013 Blender Foundation
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BKE_FREESTYLE_H__
#define __BKE_FREESTYLE_H__
/** \file BKE_freestyle.h
* \ingroup bke
*/
#include "DNA_scene_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* FreestyleConfig */
void BKE_freestyle_config_init(FreestyleConfig *config);
void BKE_freestyle_config_free(FreestyleConfig *config);
void BKE_freestyle_config_copy(FreestyleConfig *new_config, FreestyleConfig *config);
/* FreestyleConfig.modules */
void BKE_freestyle_module_add(FreestyleConfig *config);
void BKE_freestyle_module_delete(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
void BKE_freestyle_module_move_up(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
void BKE_freestyle_module_move_down(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
/* FreestyleConfig.linesets */
FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config);
FreestyleLineSet *BKE_freestyle_lineset_get_active(FreestyleConfig *config);
short BKE_freestyle_lineset_get_active_index(FreestyleConfig *config);
void BKE_freestyle_lineset_set_active_index(FreestyleConfig *config, short index);
void BKE_freestyle_lineset_unique_name(FreestyleConfig *config, FreestyleLineSet *lineset);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -33,8 +33,6 @@
* \brief Blender kernel freestyle line style functionality.
*/
#ifdef WITH_FREESTYLE
#include "DNA_linestyle_types.h"
#define LS_MODIFIER_TYPE_COLOR 1
@@ -44,36 +42,35 @@
struct Main;
struct Object;
struct ColorBand;
FreestyleLineStyle *FRS_new_linestyle(const char *name, struct Main *main);
void FRS_free_linestyle(FreestyleLineStyle *linestyle);
FreestyleLineStyle *FRS_copy_linestyle(FreestyleLineStyle *linestyle);
FreestyleLineStyle *BKE_new_linestyle(const char *name, struct Main *main);
void BKE_free_linestyle(FreestyleLineStyle *linestyle);
FreestyleLineStyle *BKE_copy_linestyle(FreestyleLineStyle *linestyle);
LineStyleModifier *FRS_add_linestyle_color_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *FRS_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *FRS_add_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *BKE_add_linestyle_color_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *BKE_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type);
LineStyleModifier *FRS_copy_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *FRS_copy_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *FRS_copy_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *FRS_copy_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m);
void FRS_remove_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void FRS_remove_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void FRS_remove_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void FRS_remove_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void BKE_remove_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void BKE_remove_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void BKE_remove_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void BKE_remove_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier);
void FRS_move_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void FRS_move_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void FRS_move_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void FRS_move_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void BKE_move_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void BKE_move_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void BKE_move_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void BKE_move_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction);
void FRS_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *color_ramp);
void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
char *BKE_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, struct ColorBand *color_ramp);
void FRS_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob);
#endif /* WITH_FREESTYLE */
void BKE_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob);
#endif /* __BKE_LINESTYLE_H__ */

View File

@@ -88,9 +88,7 @@ typedef struct Main {
ListBase gpencil;
ListBase movieclip;
ListBase mask;
#ifdef WITH_FREESTYLE
ListBase linestyle;
#endif
char id_tag_update[256];
} Main;

View File

@@ -90,6 +90,7 @@ set(SRC
intern/fluidsim.c
intern/fmodifier.c
intern/font.c
intern/freestyle.c
intern/gpencil.c
intern/group.c
intern/icons.c
@@ -103,6 +104,7 @@ set(SRC
intern/lamp.c
intern/lattice.c
intern/library.c
intern/linestyle.c
intern/mask.c
intern/mask_evaluate.c
intern/mask_rasterize.c
@@ -188,6 +190,7 @@ set(SRC
BKE_fcurve.h
BKE_fluidsim.h
BKE_font.h
BKE_freestyle.h
BKE_global.h
BKE_gpencil.h
BKE_group.h
@@ -200,6 +203,7 @@ set(SRC
BKE_lamp.h
BKE_lattice.h
BKE_library.h
BKE_linestyle.h
BKE_main.h
BKE_mask.h
BKE_material.h
@@ -425,13 +429,6 @@ if(WITH_INTERNATIONAL)
endif()
if(WITH_FREESTYLE)
list(APPEND SRC
intern/linestyle.c
BKE_linestyle.h
)
list(APPEND INC
../freestyle
)
add_definitions(-DWITH_FREESTYLE)
endif()

View File

@@ -150,9 +150,6 @@ if env['WITH_BF_INTERNATIONAL']:
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
incs += ' ../freestyle'
else:
sources.remove(os.path.join('intern', 'linestyle.c'))
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']

View File

@@ -86,9 +86,7 @@ short id_type_can_have_animdata(ID *id)
case ID_PA:
case ID_MA: case ID_TE: case ID_NT:
case ID_LA: case ID_CA: case ID_WO:
#ifdef WITH_FREESTYLE
case ID_LS:
#endif
case ID_SPK:
case ID_SCE:
case ID_MC:
@@ -831,10 +829,8 @@ void BKE_animdata_main_cb(Main *mainptr, ID_AnimData_Edit_Callback func, void *u
/* scenes */
ANIMDATA_NODETREE_IDS_CB(mainptr->scene.first, Scene);
#ifdef WITH_FREESTYLE
/* line styles */
ANIMDATA_IDS_CB(mainptr->linestyle.first);
#endif
}
/* Fix all RNA-Paths throughout the database (directly access the Global.main version)
@@ -920,10 +916,8 @@ void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const cha
/* worlds */
RENAMEFIX_ANIM_NODETREE_IDS(mainptr->world.first, World);
#ifdef WITH_FREESTYLE
/* linestyles */
RENAMEFIX_ANIM_IDS(mainptr->linestyle.first);
#endif
/* scenes */
RENAMEFIX_ANIM_NODETREE_IDS(mainptr->scene.first, Scene);
@@ -2410,10 +2404,8 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
/* movie clips */
EVAL_ANIM_IDS(main->movieclip.first, ADT_RECALC_ANIM);
#ifdef WITH_FREESTYLE
/* linestyles */
EVAL_ANIM_IDS(main->linestyle.first, ADT_RECALC_ANIM);
#endif
/* objects */
/* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets

View File

@@ -70,9 +70,7 @@
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
#include "DNA_smoke_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_freestyle_types.h"
#endif
#include "DNA_freestyle_types.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
@@ -582,7 +580,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
}
SEQ_END
}
#ifdef WITH_FREESTYLE
{
SceneRenderLayer *srl = scene->r.layers.first;
@@ -593,7 +590,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
}
}
}
#endif
break;
}
case ID_ME:

View File

@@ -0,0 +1,234 @@
/*
* ***** 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) 2013 Blender Foundation
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenkernel/intern/freestyle.c
* \ingroup bke
*/
#include "MEM_guardedalloc.h"
#include "DNA_freestyle_types.h"
#include "DNA_group_types.h"
#include "BKE_freestyle.h"
#include "BKE_linestyle.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
// function declarations
static FreestyleLineSet *alloc_lineset();
static void copy_lineset(FreestyleLineSet *new_lineset, FreestyleLineSet *lineset);
static FreestyleModuleConfig *alloc_module();
static void copy_module(FreestyleModuleConfig *new_module, FreestyleModuleConfig *module);
void BKE_freestyle_config_init(FreestyleConfig *config)
{
config->mode = FREESTYLE_CONTROL_EDITOR_MODE;
config->modules.first = config->modules.last = NULL;
config->flags = 0;
config->sphere_radius = 1.0f;
config->dkr_epsilon = 0.0f;
config->crease_angle = DEG2RADF(134.43f);
config->linesets.first = config->linesets.last = NULL;
}
void BKE_freestyle_config_free(FreestyleConfig *config)
{
FreestyleLineSet *lineset;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
if (lineset->group) {
lineset->group->id.us--;
lineset->group = NULL;
}
lineset->linestyle->id.us--;
lineset->linestyle = NULL;
}
BLI_freelistN(&config->linesets);
BLI_freelistN(&config->modules);
}
void BKE_freestyle_config_copy(FreestyleConfig *new_config, FreestyleConfig *config)
{
FreestyleLineSet *lineset, *new_lineset;
FreestyleModuleConfig *module, *new_module;
new_config->mode = config->mode;
new_config->raycasting_algorithm = config->raycasting_algorithm; /* deprecated */
new_config->flags = config->flags;
new_config->sphere_radius = config->sphere_radius;
new_config->dkr_epsilon = config->dkr_epsilon;
new_config->crease_angle = config->crease_angle;
new_config->linesets.first = new_config->linesets.last = NULL;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
new_lineset = alloc_lineset();
copy_lineset(new_lineset, lineset);
BLI_addtail(&new_config->linesets, (void *)new_lineset);
}
new_config->modules.first = new_config->modules.last = NULL;
for (module = (FreestyleModuleConfig *)config->modules.first; module; module = module->next) {
new_module = alloc_module();
copy_module(new_module, module);
BLI_addtail(&new_config->modules, (void *)new_module);
}
}
static void copy_lineset(FreestyleLineSet *new_lineset, FreestyleLineSet *lineset)
{
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;
new_lineset->exclude_edge_types = lineset->exclude_edge_types;
new_lineset->group = lineset->group;
if (new_lineset->group) {
new_lineset->group->id.us++;
}
strcpy(new_lineset->name, lineset->name);
}
static FreestyleModuleConfig *alloc_module()
{
return (FreestyleModuleConfig *)MEM_callocN(sizeof(FreestyleModuleConfig), "style module configuration");
}
void BKE_freestyle_module_add(FreestyleConfig *config)
{
FreestyleModuleConfig *module_conf = alloc_module();
const size_t maxlen = sizeof(module_conf->module_path);
BLI_addtail(&config->modules, (void *)module_conf);
BLI_strncpy(module_conf->module_path, BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "freestyle"), maxlen);
BLI_join_dirfile(module_conf->module_path, maxlen, module_conf->module_path, "style_modules");
BLI_join_dirfile(module_conf->module_path, maxlen, module_conf->module_path, "contour.py");
module_conf->is_displayed = 1;
}
static void copy_module(FreestyleModuleConfig *new_module, FreestyleModuleConfig *module)
{
strcpy(new_module->module_path, module->module_path);
new_module->is_displayed = module->is_displayed;
}
void BKE_freestyle_module_delete(FreestyleConfig *config, FreestyleModuleConfig *module_conf)
{
BLI_freelinkN(&config->modules, module_conf);
}
void BKE_freestyle_module_move_up(FreestyleConfig *config, FreestyleModuleConfig *module_conf)
{
BLI_remlink(&config->modules, module_conf);
BLI_insertlinkbefore(&config->modules, module_conf->prev, module_conf);
}
void BKE_freestyle_module_move_down(FreestyleConfig *config, FreestyleModuleConfig *module_conf)
{
BLI_remlink(&config->modules, module_conf);
BLI_insertlinkafter(&config->modules, module_conf->next, module_conf);
}
void BKE_freestyle_lineset_unique_name(FreestyleConfig *config, FreestyleLineSet *lineset)
{
BLI_uniquename(&config->linesets, lineset, "FreestyleLineSet", '.', offsetof(FreestyleLineSet, name),
sizeof(lineset->name));
}
static FreestyleLineSet *alloc_lineset()
{
return (FreestyleLineSet *)MEM_callocN(sizeof(FreestyleLineSet), "Freestyle line set");
}
FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config)
{
int lineset_index = BLI_countlist(&config->linesets);
FreestyleLineSet *lineset = alloc_lineset();
BLI_addtail(&config->linesets, (void *)lineset);
BKE_freestyle_lineset_set_active_index(config, lineset_index);
lineset->linestyle = BKE_new_linestyle("LineStyle", NULL);
lineset->flags |= FREESTYLE_LINESET_ENABLED;
lineset->selection = FREESTYLE_SEL_VISIBILITY | FREESTYLE_SEL_EDGE_TYPES | FREESTYLE_SEL_IMAGE_BORDER;
lineset->qi = FREESTYLE_QI_VISIBLE;
lineset->qi_start = 0;
lineset->qi_end = 100;
lineset->edge_types = FREESTYLE_FE_SILHOUETTE | FREESTYLE_FE_BORDER | FREESTYLE_FE_CREASE;
lineset->exclude_edge_types = 0;
lineset->group = NULL;
if (lineset_index > 0)
sprintf(lineset->name, "LineSet %i", lineset_index + 1);
else
strcpy(lineset->name, "LineSet");
BKE_freestyle_lineset_unique_name(config, lineset);
return lineset;
}
FreestyleLineSet *BKE_freestyle_lineset_get_active(FreestyleConfig *config)
{
FreestyleLineSet *lineset;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
if (lineset->flags & FREESTYLE_LINESET_CURRENT)
return lineset;
}
return NULL;
}
short BKE_freestyle_lineset_get_active_index(FreestyleConfig *config)
{
FreestyleLineSet *lineset;
short i;
for (lineset = (FreestyleLineSet *)config->linesets.first, i = 0; lineset; lineset = lineset->next, i++) {
if (lineset->flags & FREESTYLE_LINESET_CURRENT)
return i;
}
return 0;
}
void BKE_freestyle_lineset_set_active_index(FreestyleConfig *config, short index)
{
FreestyleLineSet *lineset;
short i;
for (lineset = (FreestyleLineSet *)config->linesets.first, i = 0; lineset; lineset = lineset->next, i++) {
if (i == index)
lineset->flags |= FREESTYLE_LINESET_CURRENT;
else
lineset->flags &= ~FREESTYLE_LINESET_CURRENT;
}
}

View File

@@ -79,6 +79,7 @@ void BKE_group_unlink(Group *group)
Object *ob;
Scene *sce;
SceneRenderLayer *srl;
FreestyleLineSet *lineset;
ParticleSystem *psys;
for (ma = bmain->mat.first; ma; ma = ma->id.next) {
@@ -103,16 +104,10 @@ void BKE_group_unlink(Group *group)
for (srl = sce->r.layers.first; srl; srl = srl->next) {
if (srl->light_override == group)
srl->light_override = NULL;
#ifdef WITH_FREESTYLE
{
FreestyleLineSet *lineset;
for(lineset = srl->freestyleConfig.linesets.first; lineset; lineset= lineset->next) {
if (lineset->group == group)
lineset->group = NULL;
}
for(lineset = srl->freestyleConfig.linesets.first; lineset; lineset= lineset->next) {
if (lineset->group == group)
lineset->group = NULL;
}
#endif
}
}

View File

@@ -63,9 +63,7 @@ static IDType idtypes[] = {
{ ID_KE, "Key", "shape_keys", 0 },
{ ID_LA, "Lamp", "lamps", IDTYPE_FLAGS_ISLINKABLE },
{ ID_LI, "Library", "libraries", 0 },
#ifdef WITH_FREESTYLE
{ ID_LS, "FreestyleLineStyle", "linestyles", IDTYPE_FLAGS_ISLINKABLE },
#endif
{ ID_LT, "Lattice", "lattices", IDTYPE_FLAGS_ISLINKABLE },
{ ID_MA, "Material", "materials", IDTYPE_FLAGS_ISLINKABLE },
{ ID_MB, "Metaball", "metaballs", IDTYPE_FLAGS_ISLINKABLE },

View File

@@ -93,6 +93,7 @@
#include "BKE_lamp.h"
#include "BKE_lattice.h"
#include "BKE_library.h"
#include "BKE_linestyle.h"
#include "BKE_mesh.h"
#include "BKE_material.h"
#include "BKE_main.h"
@@ -110,9 +111,6 @@
#include "BKE_text.h"
#include "BKE_texture.h"
#include "BKE_world.h"
#ifdef WITH_FREESTYLE
# include "BKE_linestyle.h"
#endif
#include "RNA_access.h"
@@ -282,10 +280,8 @@ bool id_make_local(ID *id, bool test)
return false; /* can't be linked */
case ID_GD:
return false; /* not implemented */
#ifdef WITH_FREESTYLE
case ID_LS:
return 0; /* not implemented */
#endif
}
return false;
@@ -384,11 +380,9 @@ bool id_copy(ID *id, ID **newid, bool test)
case ID_MSK:
if (!test) *newid = (ID *)BKE_mask_copy((Mask *)id);
return true;
#ifdef WITH_FREESTYLE
case ID_LS:
if(!test) *newid= (ID*)FRS_copy_linestyle((FreestyleLineStyle*)id);
if (!test) *newid = (ID *)BKE_copy_linestyle((FreestyleLineStyle *)id);
return 1;
#endif
}
return false;
@@ -519,10 +513,8 @@ ListBase *which_libbase(Main *mainlib, short type)
return &(mainlib->movieclip);
case ID_MSK:
return &(mainlib->mask);
#ifdef WITH_FREESTYLE
case ID_LS:
return &(mainlib->linestyle);
#endif
}
return NULL;
}
@@ -613,9 +605,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
lb[a++] = &(main->wm);
lb[a++] = &(main->movieclip);
lb[a++] = &(main->mask);
#ifdef WITH_FREESTYLE
lb[a++] = &(main->linestyle);
#endif
lb[a] = NULL;
@@ -734,11 +724,9 @@ static ID *alloc_libblock_notest(short type)
case ID_MSK:
id = MEM_callocN(sizeof(Mask), "Mask");
break;
#ifdef WITH_FREESTYLE
case ID_LS:
id = MEM_callocN(sizeof(FreestyleLineStyle), "Freestyle Line Style");
break;
#endif
}
return id;
}
@@ -974,11 +962,9 @@ void BKE_libblock_free(ListBase *lb, void *idv)
case ID_MSK:
BKE_mask_free(bmain, (Mask *)id);
break;
#ifdef WITH_FREESTYLE
case ID_LS:
FRS_free_linestyle((FreestyleLineStyle *)id);
BKE_free_linestyle((FreestyleLineStyle *)id);
break;
#endif
}
BLI_remlink(lb, id);

View File

@@ -94,12 +94,12 @@ static void default_linestyle_settings(FreestyleLineStyle *linestyle)
linestyle->thickness_modifiers.first = linestyle->thickness_modifiers.last = NULL;
linestyle->geometry_modifiers.first = linestyle->geometry_modifiers.last = NULL;
FRS_add_linestyle_geometry_modifier(linestyle, LS_MODIFIER_SAMPLING);
BKE_add_linestyle_geometry_modifier(linestyle, LS_MODIFIER_SAMPLING);
linestyle->caps = LS_CAPS_BUTT;
}
FreestyleLineStyle *FRS_new_linestyle(const char *name, struct Main *main)
FreestyleLineStyle *BKE_new_linestyle(const char *name, struct Main *main)
{
FreestyleLineStyle *linestyle;
@@ -113,28 +113,28 @@ FreestyleLineStyle *FRS_new_linestyle(const char *name, struct Main *main)
return linestyle;
}
void FRS_free_linestyle(FreestyleLineStyle *linestyle)
void BKE_free_linestyle(FreestyleLineStyle *linestyle)
{
LineStyleModifier *m;
BKE_free_animdata(&linestyle->id);
while ((m = (LineStyleModifier *)linestyle->color_modifiers.first))
FRS_remove_linestyle_color_modifier(linestyle, m);
BKE_remove_linestyle_color_modifier(linestyle, m);
while ((m = (LineStyleModifier *)linestyle->alpha_modifiers.first))
FRS_remove_linestyle_alpha_modifier(linestyle, m);
BKE_remove_linestyle_alpha_modifier(linestyle, m);
while ((m = (LineStyleModifier *)linestyle->thickness_modifiers.first))
FRS_remove_linestyle_thickness_modifier(linestyle, m);
BKE_remove_linestyle_thickness_modifier(linestyle, m);
while ((m = (LineStyleModifier *)linestyle->geometry_modifiers.first))
FRS_remove_linestyle_geometry_modifier(linestyle, m);
BKE_remove_linestyle_geometry_modifier(linestyle, m);
}
FreestyleLineStyle *FRS_copy_linestyle(FreestyleLineStyle *linestyle)
FreestyleLineStyle *BKE_copy_linestyle(FreestyleLineStyle *linestyle)
{
FreestyleLineStyle *new_linestyle;
LineStyleModifier *m;
new_linestyle = FRS_new_linestyle(linestyle->id.name + 2, NULL);
FRS_free_linestyle(new_linestyle);
new_linestyle = BKE_new_linestyle(linestyle->id.name + 2, NULL);
BKE_free_linestyle(new_linestyle);
new_linestyle->r = linestyle->r;
new_linestyle->g = linestyle->g;
@@ -160,13 +160,13 @@ FreestyleLineStyle *FRS_copy_linestyle(FreestyleLineStyle *linestyle)
new_linestyle->gap3 = linestyle->gap3;
new_linestyle->panel = linestyle->panel;
for (m = (LineStyleModifier *)linestyle->color_modifiers.first; m; m = m->next)
FRS_copy_linestyle_color_modifier(new_linestyle, m);
BKE_copy_linestyle_color_modifier(new_linestyle, m);
for (m = (LineStyleModifier *)linestyle->alpha_modifiers.first; m; m = m->next)
FRS_copy_linestyle_alpha_modifier(new_linestyle, m);
BKE_copy_linestyle_alpha_modifier(new_linestyle, m);
for (m = (LineStyleModifier *)linestyle->thickness_modifiers.first; m; m = m->next)
FRS_copy_linestyle_thickness_modifier(new_linestyle, m);
BKE_copy_linestyle_thickness_modifier(new_linestyle, m);
for (m = (LineStyleModifier *)linestyle->geometry_modifiers.first; m; m = m->next)
FRS_copy_linestyle_geometry_modifier(new_linestyle, m);
BKE_copy_linestyle_geometry_modifier(new_linestyle, m);
return new_linestyle;
}
@@ -214,7 +214,7 @@ static LineStyleModifier *alloc_color_modifier(int type)
return new_modifier(type, size);
}
LineStyleModifier *FRS_add_linestyle_color_modifier(FreestyleLineStyle *linestyle, int type)
LineStyleModifier *BKE_add_linestyle_color_modifier(FreestyleLineStyle *linestyle, int type)
{
LineStyleModifier *m;
@@ -248,7 +248,7 @@ LineStyleModifier *FRS_add_linestyle_color_modifier(FreestyleLineStyle *linestyl
return m;
}
LineStyleModifier *FRS_copy_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
LineStyleModifier *new_m;
@@ -302,7 +302,7 @@ LineStyleModifier *FRS_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
return new_m;
}
void FRS_remove_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
void BKE_remove_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
@@ -344,7 +344,7 @@ static LineStyleModifier *alloc_alpha_modifier(int type)
return new_modifier(type, size);
}
LineStyleModifier *FRS_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, int type)
LineStyleModifier *BKE_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, int type)
{
LineStyleModifier *m;
@@ -390,7 +390,7 @@ LineStyleModifier *FRS_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyl
return m;
}
LineStyleModifier *FRS_copy_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
LineStyleModifier *new_m;
@@ -444,7 +444,7 @@ LineStyleModifier *FRS_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
return new_m;
}
void FRS_remove_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
void BKE_remove_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
@@ -490,7 +490,7 @@ static LineStyleModifier *alloc_thickness_modifier(int type)
return new_modifier(type, size);
}
LineStyleModifier *FRS_add_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, int type)
LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, int type)
{
LineStyleModifier *m;
@@ -552,7 +552,7 @@ LineStyleModifier *FRS_add_linestyle_thickness_modifier(FreestyleLineStyle *line
return m;
}
LineStyleModifier *FRS_copy_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
LineStyleModifier *new_m;
@@ -625,7 +625,7 @@ LineStyleModifier *FRS_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
return new_m;
}
void FRS_remove_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
void BKE_remove_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
@@ -697,7 +697,7 @@ static LineStyleModifier *alloc_geometry_modifier(int type)
return new_modifier(type, size);
}
LineStyleModifier *FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type)
LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, int type)
{
LineStyleModifier *m;
@@ -815,7 +815,7 @@ LineStyleModifier *FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
return m;
}
LineStyleModifier *FRS_copy_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
LineStyleModifier *new_m;
@@ -947,7 +947,7 @@ LineStyleModifier *FRS_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
return new_m;
}
void FRS_remove_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
void BKE_remove_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
BLI_freelinkN(&linestyle->geometry_modifiers, m);
}
@@ -961,27 +961,27 @@ static void move_modifier(ListBase *lb, LineStyleModifier *modifier, int directi
BLI_insertlinkafter(lb, modifier->next, modifier);
}
void FRS_move_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
void BKE_move_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
{
move_modifier(&linestyle->color_modifiers, modifier, direction);
}
void FRS_move_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
void BKE_move_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
{
move_modifier(&linestyle->alpha_modifiers, modifier, direction);
}
void FRS_move_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
void BKE_move_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
{
move_modifier(&linestyle->thickness_modifiers, modifier, direction);
}
void FRS_move_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
void BKE_move_linestyle_geometry_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *modifier, int direction)
{
move_modifier(&linestyle->geometry_modifiers, modifier, direction);
}
void FRS_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase)
void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase)
{
LineStyleModifier *m;
ColorBand *color_ramp;
@@ -1011,7 +1011,7 @@ void FRS_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *list
}
}
char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *color_ramp)
char *BKE_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *color_ramp)
{
LineStyleModifier *m;
bool found = false;
@@ -1038,11 +1038,11 @@ char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *c
if (found)
return BLI_sprintfN("color_modifiers[\"%s\"].color_ramp", m->name);
}
printf("FRS_path_from_ID_to_color_ramp: No color ramps correspond to the given pointer.\n");
printf("BKE_path_from_ID_to_color_ramp: No color ramps correspond to the given pointer.\n");
return NULL;
}
void FRS_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob)
void BKE_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob)
{
LineStyleModifier *m;

View File

@@ -153,9 +153,7 @@ void init_material(Material *ma)
ma->tx_limit = 0.0;
ma->tx_falloff = 1.0;
ma->shad_alpha = 1.0f;
#ifdef WITH_FREESTYLE
ma->vcol_alpha = 0;
#endif
ma->gloss_mir = ma->gloss_tra = 1.0;
ma->samp_gloss_mir = ma->samp_gloss_tra = 18;

View File

@@ -90,6 +90,7 @@
#include "BKE_lamp.h"
#include "BKE_lattice.h"
#include "BKE_library.h"
#include "BKE_linestyle.h"
#include "BKE_mesh.h"
#include "BKE_tessmesh.h"
#include "BKE_mball.h"
@@ -119,10 +120,6 @@
#include "GPU_material.h"
#ifdef WITH_FREESTYLE
# include "FRS_freestyle.h"
#endif
/* Local function protos */
float originmat[3][3]; /* after BKE_object_where_is_calc(), can be used in other functions (bad!) */
@@ -427,6 +424,8 @@ void BKE_object_unlink(Object *ob)
World *wrld;
bScreen *sc;
Scene *sce;
SceneRenderLayer *srl;
FreestyleLineSet *lineset;
Curve *cu;
Tex *tex;
Group *group;
@@ -680,15 +679,12 @@ void BKE_object_unlink(Object *ob)
SEQ_END
}
#ifdef WITH_FREESTYLE
{
SceneRenderLayer *srl;
for (srl= sce->r.layers.first; srl; srl= srl->next) {
FRS_unlink_target_object(&srl->freestyleConfig, ob);
for (srl= sce->r.layers.first; srl; srl= srl->next) {
for (lineset = (FreestyleLineSet *)&srl->freestyleConfig.linesets.first;
lineset; lineset = lineset->next) {
BKE_unlink_linestyle_target_object(lineset->linestyle, ob);
}
}
#endif
}
sce = sce->id.next;

View File

@@ -63,6 +63,7 @@
#include "BKE_colortools.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_freestyle.h"
#include "BKE_global.h"
#include "BKE_group.h"
#include "BKE_idprop.h"
@@ -87,10 +88,6 @@
//XXX #include "BIF_previewrender.h"
//XXX #include "BIF_editseq.h"
#ifdef WITH_FREESTYLE
# include "FRS_freestyle_config.h"
#endif
#ifdef WIN32
#else
#include <sys/time.h>
@@ -144,6 +141,7 @@ static void remove_sequencer_fcurves(Scene *sce)
Scene *BKE_scene_copy(Scene *sce, int type)
{
Scene *scen;
SceneRenderLayer *srl, *new_srl;
ToolSettings *ts;
Base *base, *obase;
@@ -212,17 +210,12 @@ Scene *BKE_scene_copy(Scene *sce, int type)
if (type != SCE_COPY_FULL)
remove_sequencer_fcurves(scen);
#ifdef WITH_FREESTYLE
{
SceneRenderLayer *srl, *new_srl;
new_srl = scen->r.layers.first;
for (srl = sce->r.layers.first; srl; srl = srl->next) {
FRS_copy_freestyle_config(&new_srl->freestyleConfig, &srl->freestyleConfig);
new_srl = new_srl->next;
}
/* copy Freestyle settings */
new_srl = scen->r.layers.first;
for (srl = sce->r.layers.first; srl; srl = srl->next) {
BKE_freestyle_config_copy(&new_srl->freestyleConfig, &srl->freestyleConfig);
new_srl = new_srl->next;
}
#endif
}
/* tool settings */
@@ -305,6 +298,7 @@ Scene *BKE_scene_copy(Scene *sce, int type)
void BKE_scene_free(Scene *sce)
{
Base *base;
SceneRenderLayer *srl;
/* check all sequences */
BKE_sequencer_clear_scene_in_allseqs(G.main, sce);
@@ -351,15 +345,9 @@ void BKE_scene_free(Scene *sce)
sce->r.ffcodecdata.properties = NULL;
}
#ifdef WITH_FREESTYLE
{
SceneRenderLayer *srl;
for (srl = sce->r.layers.first; srl; srl = srl->next) {
FRS_free_freestyle_config(&srl->freestyleConfig);
}
for (srl = sce->r.layers.first; srl; srl = srl->next) {
BKE_freestyle_config_free(&srl->freestyleConfig);
}
#endif
BLI_freelistN(&sce->markers);
BLI_freelistN(&sce->transform_spaces);
@@ -1299,9 +1287,7 @@ SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
srl->lay = (1 << 20) - 1;
srl->layflag = 0x7FFF; /* solid ztra halo edge strand */
srl->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
#ifdef WITH_FREESTYLE
FRS_init_freestyle_config(&srl->freestyleConfig);
#endif
BKE_freestyle_config_init(&srl->freestyleConfig);
return srl;
}

View File

@@ -169,10 +169,6 @@ if(WITH_OPENMP)
add_definitions(-DPARALLEL=1)
endif()
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
if(WIN32)
list(APPEND INC
../../../intern/utfconv

View File

@@ -37,9 +37,6 @@ incs += ' ' + env['BF_FREETYPE_INC']
incs += ' ' + env['BF_ZLIB_INC']
defs = []
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
if env['WITH_BF_BINRELOC']:
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'

View File

@@ -66,8 +66,4 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
blender_add_lib(bf_blenloader "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -40,9 +40,6 @@ defs = []
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [167,30]) #, cc_compileflags=['/WX'] )
else:

View File

@@ -71,9 +71,7 @@
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_lamp_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_linestyle_types.h"
#endif
#include "DNA_linestyle_types.h"
#include "DNA_meta_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -5018,6 +5016,7 @@ static void lib_link_scene(FileData *fd, Main *main)
Sequence *seq;
SceneRenderLayer *srl;
TimeMarker *marker;
FreestyleLineSet *fls;
for (sce = main->scene.first; sce; sce = sce->id.next) {
if (sce->id.flag & LIB_NEED_LINK) {
@@ -5132,16 +5131,10 @@ static void lib_link_scene(FileData *fd, Main *main)
for (srl = sce->r.layers.first; srl; srl = srl->next) {
srl->mat_override = newlibadr_us(fd, sce->id.lib, srl->mat_override);
srl->light_override = newlibadr_us(fd, sce->id.lib, srl->light_override);
#ifdef WITH_FREESTYLE
{
FreestyleLineSet *fls;
for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
fls->linestyle = newlibadr_us(fd, sce->id.lib, fls->linestyle);
fls->group = newlibadr_us(fd, sce->id.lib, fls->group);
}
for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
fls->linestyle = newlibadr_us(fd, sce->id.lib, fls->linestyle);
fls->group = newlibadr_us(fd, sce->id.lib, fls->group);
}
#endif
}
/*Game Settings: Dome Warp Text*/
sce->gm.dome.warptext = newlibadr(fd, sce->id.lib, sce->gm.dome.warptext);
@@ -5211,6 +5204,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
Sequence *seq;
MetaStack *ms;
RigidBodyWorld *rbw;
SceneRenderLayer *srl;
sce->theDag = NULL;
sce->obedit = NULL;
@@ -5389,18 +5383,12 @@ static void direct_link_scene(FileData *fd, Scene *sce)
link_list(fd, &(sce->transform_spaces));
link_list(fd, &(sce->r.layers));
#ifdef WITH_FREESTYLE
{
SceneRenderLayer *srl;
for(srl = sce->r.layers.first; srl; srl = srl->next) {
link_list(fd, &(srl->freestyleConfig.modules));
}
for(srl = sce->r.layers.first; srl; srl = srl->next) {
link_list(fd, &(srl->freestyleConfig.linesets));
}
for(srl = sce->r.layers.first; srl; srl = srl->next) {
link_list(fd, &(srl->freestyleConfig.modules));
}
for(srl = sce->r.layers.first; srl; srl = srl->next) {
link_list(fd, &(srl->freestyleConfig.linesets));
}
#endif
sce->nodetree = newdataadr(fd, sce->nodetree);
if (sce->nodetree) {
@@ -6737,7 +6725,6 @@ static void lib_link_mask(FileData *fd, Main *main)
}
}
#ifdef WITH_FREESTYLE
/* ************ READ LINE STYLE ***************** */
static void lib_link_linestyle(FileData *fd, Main *main)
@@ -6910,7 +6897,6 @@ static void direct_link_linestyle(FileData *fd, FreestyleLineStyle *linestyle)
for(modifier = linestyle->geometry_modifiers.first; modifier; modifier = modifier->next)
direct_link_linestyle_geometry_modifier(fd, modifier);
}
#endif
/* ************** GENERAL & MAIN ******************** */
@@ -6946,9 +6932,7 @@ static const char *dataname(short id_code)
case ID_PA: return "Data from PA";
case ID_GD: return "Data from GD";
case ID_MC: return "Data from MC";
#ifdef WITH_FREESTYLE
case ID_LS: return "Data from LS";
#endif
}
return "Data from Lib Block";
@@ -7125,11 +7109,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
case ID_MSK:
direct_link_mask(fd, (Mask *)id);
break;
#ifdef WITH_FREESTYLE
case ID_LS:
direct_link_linestyle(fd, (FreestyleLineStyle *)id);
break;
#endif
}
oldnewmap_free_unused(fd->datamap);
@@ -9247,7 +9229,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
#ifdef WITH_FREESTYLE
/* default values in Freestyle settings */
{
Scene *sce;
@@ -9344,7 +9325,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
#endif
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init see do_versions_userdef() above! */
@@ -9395,9 +9375,7 @@ static void lib_link_all(FileData *fd, Main *main)
lib_link_particlesettings(fd, main);
lib_link_movieclip(fd, main);
lib_link_mask(fd, main);
#ifdef WITH_FREESTYLE
lib_link_linestyle(fd, main);
#endif
lib_link_mesh(fd, main); /* as last: tpage images with users at zero */
@@ -10340,6 +10318,7 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
{
Base *base;
SceneRenderLayer *srl;
FreestyleLineSet *lineset;
for (base = sce->base.first; base; base = base->next) {
expand_doit(fd, mainvar, base->object);
@@ -10360,18 +10339,11 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
for (srl = sce->r.layers.first; srl; srl = srl->next) {
expand_doit(fd, mainvar, srl->mat_override);
expand_doit(fd, mainvar, srl->light_override);
#ifdef WITH_FREESTYLE
{
FreestyleLineSet *lineset;
for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
if (lineset->group)
expand_doit(fd, mainvar, lineset->group);
expand_doit(fd, mainvar, lineset->linestyle);
}
for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
if (lineset->group)
expand_doit(fd, mainvar, lineset->group);
expand_doit(fd, mainvar, lineset->linestyle);
}
#endif
}
if (sce->r.dometext)
@@ -10470,7 +10442,6 @@ static void expand_mask(FileData *fd, Main *mainvar, Mask *mask)
}
}
#ifdef WITH_FREESTYLE
static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *linestyle)
{
LineStyleModifier *m;
@@ -10490,7 +10461,6 @@ static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *li
expand_doit(fd, mainvar, ((LineStyleThicknessModifier_DistanceFromObject *)m)->target);
}
}
#endif
void BLO_main_expander(void (*expand_doit_func)(void *, Main *, void *))
{
@@ -10582,11 +10552,9 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
case ID_MSK:
expand_mask(fd, mainvar, (Mask *)id);
break;
#ifdef WITH_FREESTYLE
case ID_LS:
expand_linestyle(fd, mainvar, (FreestyleLineStyle *)id);
break;
#endif
}
do_it = TRUE;

View File

@@ -111,9 +111,7 @@
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_lamp_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_linestyle_types.h"
#endif
#include "DNA_linestyle_types.h"
#include "DNA_meta_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -2198,6 +2196,8 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
TransformOrientation *ts;
SceneRenderLayer *srl;
ToolSettings *tos;
FreestyleModuleConfig *fmc;
FreestyleLineSet *fls;
sce= scebase->first;
while (sce) {
@@ -2323,22 +2323,12 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
for (srl = sce->r.layers.first; srl; srl = srl->next) {
writestruct(wd, DATA, "SceneRenderLayer", 1, srl);
#ifdef WITH_FREESTYLE
{
FreestyleModuleConfig *fmc;
FreestyleLineSet *fls;
for(fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
writestruct(wd, DATA, "FreestyleModuleConfig", 1, fmc);
}
for(fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
writestruct(wd, DATA, "FreestyleLineSet", 1, fls);
}
for(fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
writestruct(wd, DATA, "FreestyleModuleConfig", 1, fmc);
}
for(fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
writestruct(wd, DATA, "FreestyleLineSet", 1, fls);
}
#endif
}
if (sce->nodetree) {
@@ -3061,7 +3051,6 @@ static void write_masks(WriteData *wd, ListBase *idbase)
mywrite(wd, MYWRITE_FLUSH, 0);
}
#ifdef WITH_FREESTYLE
static void write_linestyle_color_modifiers(WriteData *wd, ListBase *modifiers)
{
LineStyleModifier *m;
@@ -3262,7 +3251,6 @@ static void write_linestyles(WriteData *wd, ListBase *idbase)
}
}
}
#endif
/* context is usually defined by WM, two cases where no WM is available:
* - for forward compatibility, curscreen has to be saved
@@ -3375,9 +3363,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
write_brushes (wd, &mainvar->brush);
write_scripts (wd, &mainvar->script);
write_gpencils (wd, &mainvar->gpencil);
#ifdef WITH_FREESTYLE
write_linestyles(wd, &mainvar->linestyle);
#endif
write_libraries(wd, mainvar->next);
if (write_user_block) {

View File

@@ -58,8 +58,4 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
blender_add_lib(bf_editor_animation "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -37,7 +37,4 @@ defs = []
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
env.BlenderLib ( 'bf_editors_animation', sources, Split(incs), defs, libtype=['core'], priority=[125] )

View File

@@ -49,9 +49,7 @@
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_linestyle_types.h"
#endif
#include "DNA_linestyle_types.h"
#include "DNA_mesh_types.h"
#include "DNA_material_types.h"
#include "DNA_meta_types.h"
@@ -2040,7 +2038,6 @@ static bAnimChannelType ACF_DSNTREE =
acf_dsntree_setting_ptr /* pointer for setting */
};
#ifdef WITH_FREESTYLE
/* LineStyle Expander ------------------------------------------- */
/* TODO: just get this from RNA? */
@@ -2117,7 +2114,6 @@ static bAnimChannelType ACF_DSLINESTYLE=
acf_dslinestyle_setting_flag, /* flag for setting */
acf_dslinestyle_setting_ptr /* pointer for setting */
};
#endif
/* Mesh Expander ------------------------------------------- */
@@ -2831,9 +2827,7 @@ static void ANIM_init_channel_typeinfo_data(void)
animchannelTypeInfo[type++] = &ACF_DSTEX; /* Texture Channel */
animchannelTypeInfo[type++] = &ACF_DSLAT; /* Lattice Channel */
animchannelTypeInfo[type++] = &ACF_DSSPK; /* Speaker Channel */
#ifdef WITH_FREESTYLE
animchannelTypeInfo[type++] = &ACF_DSLINESTYLE; /* LineStyle Channel */
#endif
animchannelTypeInfo[type++] = &ACF_SHAPEKEY; /* ShapeKey */

View File

@@ -124,9 +124,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
case ANIMTYPE_DSMESH:
case ANIMTYPE_DSTEX:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
/* need to verify that this data is valid for now */
@@ -172,9 +170,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
case ANIMTYPE_DSARM:
case ANIMTYPE_DSMESH:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
/* need to verify that this data is valid for now */
@@ -255,9 +251,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
case ANIMTYPE_DSNTREE:
case ANIMTYPE_DSTEX:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED))
@@ -352,9 +346,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
case ANIMTYPE_DSNTREE:
case ANIMTYPE_DSTEX:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
/* need to verify that this data is valid for now */
@@ -2431,9 +2423,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
case ANIMTYPE_DSNTREE:
case ANIMTYPE_DSTEX:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
/* sanity checking... */

View File

@@ -55,9 +55,7 @@
#include "DNA_camera_types.h"
#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_linestyle_types.h"
#endif
#include "DNA_linestyle_types.h"
#include "DNA_key_types.h"
#include "DNA_mask_types.h"
#include "DNA_material_types.h"
@@ -737,7 +735,6 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->adt = BKE_animdata_from_id(data);
}
break;
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
{
FreestyleLineStyle *linestyle = (FreestyleLineStyle *)data;
@@ -750,8 +747,7 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->adt = BKE_animdata_from_id(data);
}
break;
#endif
break;
case ANIMTYPE_DSPART:
{
ParticleSettings *part = (ParticleSettings *)ale->data;
@@ -1550,7 +1546,6 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data,
return items;
}
#ifdef WITH_FREESTYLE
static size_t animdata_filter_ds_linestyle (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
{
SceneRenderLayer *srl;
@@ -1598,7 +1593,6 @@ static size_t animdata_filter_ds_linestyle (bAnimContext *ac, ListBase *anim_dat
/* return the number of items added to the list */
return items;
}
#endif
/* NOTE: owner_id is either material, lamp, or world block, which is the direct owner of the texture stack in question */
static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, int filter_mode)
@@ -2234,12 +2228,10 @@ static size_t animdata_filter_dopesheet_scene(bAnimContext *ac, ListBase *anim_d
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)sce, ntree, filter_mode);
}
#ifdef WITH_FREESTYLE
/* line styles */
if ((ads->filterflag & ADS_FILTER_NOLINESTYLE) == 0) {
tmp_items += animdata_filter_ds_linestyle(ac, &tmp_data, ads, sce, filter_mode);
}
#endif
/* TODO: one day, when sequencer becomes its own datatype, perhaps it should be included here */
}

View File

@@ -155,9 +155,7 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_DSMESH,
ANIMTYPE_DSTEX,
ANIMTYPE_DSLAT,
#ifdef WITH_FREESTYLE
ANIMTYPE_DSLINESTYLE,
#endif
ANIMTYPE_DSSPK,
ANIMTYPE_SHAPEKEY,
@@ -239,9 +237,7 @@ typedef enum eAnimFilter_Flags {
#define EXPANDED_SCEC(sce) (CHECK_TYPE_INLINE(sce, Scene), ((sce->flag & SCE_DS_COLLAPSED) == 0))
/* 'Sub-Scene' channels (flags stored in Data block) */
#define FILTER_WOR_SCED(wo) (CHECK_TYPE_INLINE(wo, World), (wo->flag & WO_DS_EXPAND))
#ifdef WITH_FREESTYLE
# define FILTER_LS_SCED(linestyle) ((linestyle->flag & LS_DS_EXPAND))
#endif
#define FILTER_LS_SCED(linestyle) ((linestyle->flag & LS_DS_EXPAND))
/* 'Object' channels */
#define SEL_OBJC(base) (CHECK_TYPE_INLINE(base, Base), ((base->flag & SELECT)))
#define EXPANDED_OBJC(ob) (CHECK_TYPE_INLINE(ob, Object), ((ob->nlaflag & OB_ADS_COLLAPSED) == 0))

View File

@@ -208,10 +208,8 @@ enum {
TH_STITCH_PREVIEW_UNSTITCHABLE,
TH_STITCH_PREVIEW_ACTIVE,
/* #ifdef WITH_FREESTYLE */
TH_FREESTYLE_EDGE_MARK,
TH_FREESTYLE_FACE_MARK,
/* #endif */
TH_MATCH, /* highlight color for search matches */
TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */

View File

@@ -62,10 +62,6 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
if(WITH_HEADLESS)
add_definitions(-DWITH_HEADLESS)
endif()

View File

@@ -42,9 +42,6 @@ defs = []
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
if env['WITH_BF_PYTHON']:
defs.append('WITH_PYTHON')

View File

@@ -334,9 +334,7 @@ static const char *template_id_browse_tip(StructRNA *type)
case ID_MA: return N_("Browse Material to be linked");
case ID_TE: return N_("Browse Texture to be linked");
case ID_IM: return N_("Browse Image to be linked");
#ifdef WITH_FREESTYLE
case ID_LS: return N_("Browse Line Style Data to be linked");
#endif
case ID_LT: return N_("Browse Lattice Data to be linked");
case ID_LA: return N_("Browse Lamp Data to be linked");
case ID_CA: return N_("Browse Camera Data to be linked");
@@ -372,9 +370,7 @@ static const char *template_id_context(StructRNA *type)
case ID_MA: return BLF_I18NCONTEXT_ID_MATERIAL;
case ID_TE: return BLF_I18NCONTEXT_ID_TEXTURE;
case ID_IM: return BLF_I18NCONTEXT_ID_IMAGE;
#ifdef WITH_FREESTYLE
case ID_LS: return BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE;
#endif
case ID_LT: return BLF_I18NCONTEXT_ID_LATTICE;
case ID_LA: return BLF_I18NCONTEXT_ID_LAMP;
case ID_CA: return BLF_I18NCONTEXT_ID_CAMERA;
@@ -532,9 +528,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
BLF_I18NCONTEXT_ID_BRUSH,
BLF_I18NCONTEXT_ID_PARTICLESETTINGS,
BLF_I18NCONTEXT_ID_GPENCIL,
#ifdef WITH_FREESTYLE
BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE
#endif
BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE,
);
if (newop) {

View File

@@ -361,12 +361,10 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
cp = ts->handle_sel_vect; break;
case TH_HANDLE_SEL_ALIGN:
cp = ts->handle_sel_align; break;
#ifdef WITH_FREESTYLE
case TH_FREESTYLE_EDGE_MARK:
cp = ts->freestyle_edge_mark; break;
case TH_FREESTYLE_FACE_MARK:
cp = ts->freestyle_face_mark; break;
#endif
case TH_SYNTAX_B:
cp = ts->syntaxb; break;
@@ -768,10 +766,8 @@ void ui_theme_init_default(void)
rgba_char_args_set(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
rgba_char_args_set(btheme->tv3d.button_title, 0, 0, 0, 255);
rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255);
#ifdef WITH_FREESTYLE
rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
#endif
btheme->tv3d.facedot_size = 4;
@@ -2030,7 +2026,6 @@ void init_userdef_do_versions(void)
}
}
#ifdef WITH_FREESTYLE
/* Freestyle color settings */
{
bTheme *btheme;
@@ -2043,7 +2038,6 @@ void init_userdef_do_versions(void)
}
}
}
#endif
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {

View File

@@ -51,10 +51,12 @@
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_font.h"
#include "BKE_freestyle.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_linestyle.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_node.h"
@@ -70,7 +72,6 @@
#include "GPU_material.h"
#ifdef WITH_FREESTYLE
# include "BKE_linestyle.h"
# include "FRS_freestyle.h"
#endif
@@ -580,12 +581,13 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot)
}
#ifdef WITH_FREESTYLE
static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FRS_add_module(&srl->freestyleConfig);
BKE_freestyle_module_add(&srl->freestyleConfig);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -613,7 +615,7 @@ static int freestyle_module_remove_exec(bContext *C, wmOperator *UNUSED(op))
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
FreestyleModuleConfig *module = ptr.data;
FRS_delete_module(&srl->freestyleConfig, module);
BKE_freestyle_module_delete(&srl->freestyleConfig, module);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -643,10 +645,10 @@ static int freestyle_module_move_exec(bContext *C, wmOperator *op)
int dir = RNA_enum_get(op->ptr, "direction");
if (dir == 1) {
FRS_move_module_up(&srl->freestyleConfig, module);
BKE_freestyle_module_move_up(&srl->freestyleConfig, module);
}
else {
FRS_move_module_down(&srl->freestyleConfig, module);
BKE_freestyle_module_move_down(&srl->freestyleConfig, module);
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -681,7 +683,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);
FRS_add_lineset(&srl->freestyleConfig);
BKE_freestyle_lineset_add(&srl->freestyleConfig);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -707,7 +709,7 @@ static int freestyle_active_lineset_poll(bContext *C)
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
return FRS_get_active_lineset(&srl->freestyleConfig) != NULL;
return BKE_freestyle_lineset_get_active(&srl->freestyleConfig) != NULL;
}
static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op))
@@ -836,14 +838,14 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset to add a new line style to");
return OPERATOR_CANCELLED;
}
lineset->linestyle->id.us--;
lineset->linestyle = FRS_copy_linestyle(lineset->linestyle);
lineset->linestyle = BKE_copy_linestyle(lineset->linestyle);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -869,14 +871,14 @@ static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_color_modifier(lineset->linestyle, type) == NULL) {
if (BKE_add_linestyle_color_modifier(lineset->linestyle, type) == NULL) {
BKE_report(op->reports, RPT_ERROR, "Unknown line color modifier type.");
return OPERATOR_CANCELLED;
}
@@ -908,14 +910,14 @@ static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_alpha_modifier(lineset->linestyle, type) == NULL) {
if (BKE_add_linestyle_alpha_modifier(lineset->linestyle, type) == NULL) {
BKE_report(op->reports, RPT_ERROR, "Unknown alpha transparency modifier type");
return OPERATOR_CANCELLED;
}
@@ -947,14 +949,14 @@ static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_thickness_modifier(lineset->linestyle, type) == NULL) {
if (BKE_add_linestyle_thickness_modifier(lineset->linestyle, type) == NULL) {
BKE_report(op->reports, RPT_ERROR, "Unknown line thickness modifier type");
return OPERATOR_CANCELLED;
}
@@ -986,14 +988,14 @@ static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_geometry_modifier(lineset->linestyle, type) == NULL) {
if (BKE_add_linestyle_geometry_modifier(lineset->linestyle, type) == NULL) {
BKE_report(op->reports, RPT_ERROR, "Unknown stroke geometry modifier type");
return OPERATOR_CANCELLED;
}
@@ -1038,7 +1040,7 @@ static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
LineStyleModifier *modifier = ptr.data;
@@ -1049,16 +1051,16 @@ static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
FRS_remove_linestyle_color_modifier(lineset->linestyle, modifier);
BKE_remove_linestyle_color_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_ALPHA:
FRS_remove_linestyle_alpha_modifier(lineset->linestyle, modifier);
BKE_remove_linestyle_alpha_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_THICKNESS:
FRS_remove_linestyle_thickness_modifier(lineset->linestyle, modifier);
BKE_remove_linestyle_thickness_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
FRS_remove_linestyle_geometry_modifier(lineset->linestyle, modifier);
BKE_remove_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
@@ -1088,7 +1090,7 @@ static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
LineStyleModifier *modifier = ptr.data;
@@ -1099,16 +1101,16 @@ static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
FRS_copy_linestyle_color_modifier(lineset->linestyle, modifier);
BKE_copy_linestyle_color_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_ALPHA:
FRS_copy_linestyle_alpha_modifier(lineset->linestyle, modifier);
BKE_copy_linestyle_alpha_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_THICKNESS:
FRS_copy_linestyle_thickness_modifier(lineset->linestyle, modifier);
BKE_copy_linestyle_thickness_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
FRS_copy_linestyle_geometry_modifier(lineset->linestyle, modifier);
BKE_copy_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
@@ -1138,7 +1140,7 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
LineStyleModifier *modifier = ptr.data;
int dir = RNA_enum_get(op->ptr, "direction");
@@ -1150,16 +1152,16 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
FRS_move_linestyle_color_modifier(lineset->linestyle, modifier, dir);
BKE_move_linestyle_color_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_ALPHA:
FRS_move_linestyle_alpha_modifier(lineset->linestyle, modifier, dir);
BKE_move_linestyle_alpha_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_THICKNESS:
FRS_move_linestyle_thickness_modifier(lineset->linestyle, modifier, dir);
BKE_move_linestyle_thickness_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
FRS_move_linestyle_geometry_modifier(lineset->linestyle, modifier, dir);
BKE_move_linestyle_geometry_modifier(lineset->linestyle, modifier, dir);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
@@ -1193,7 +1195,8 @@ void SCENE_OT_freestyle_modifier_move(wmOperatorType *ot)
/* props */
RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to move, UP or DOWN");
}
#endif
#endif /* WITH_FREESTYLE */
static int texture_slot_move(bContext *C, wmOperator *op)
{

View File

@@ -50,8 +50,4 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
blender_add_lib(bf_editor_space_nla "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -37,7 +37,4 @@ defs = []
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), defs, libtype=['core'], priority=[85] )

View File

@@ -144,9 +144,7 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA
case ANIMTYPE_DSMESH:
case ANIMTYPE_DSTEX:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
/* for these channels, we only do AnimData */

View File

@@ -179,9 +179,7 @@ static int mouse_nla_channels(bAnimContext *ac, float x, int channel_index, shor
case ANIMTYPE_DSMESH:
case ANIMTYPE_DSTEX:
case ANIMTYPE_DSLAT:
#ifdef WITH_FREESTYLE
case ANIMTYPE_DSLINESTYLE:
#endif
case ANIMTYPE_DSSPK:
{
/* sanity checking... */

View File

@@ -40,7 +40,6 @@ extern "C" {
#include "DNA_scene_types.h"
#include "BKE_context.h"
#include "BKE_object.h"
struct Render;
@@ -61,28 +60,13 @@ void FRS_finish_stroke_rendering(struct Render *re);
void FRS_composite_result(struct Render *re, struct SceneRenderLayer *srl, struct Render *freestyle_render);
void FRS_exit(void);
/* FreestyleConfig.modules */
FreestyleModuleConfig *FRS_alloc_module(void);
void FRS_add_module(FreestyleConfig *config);
void FRS_delete_module(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
void FRS_move_module_up(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
void FRS_move_module_down(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
/* FreestyleConfig.linesets */
FreestyleLineSet *FRS_alloc_lineset(void);
FreestyleLineSet *FRS_add_lineset(FreestyleConfig *config);
void FRS_copy_active_lineset(FreestyleConfig *config);
void FRS_paste_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);
FreestyleLineSet *FRS_get_active_lineset(FreestyleConfig *config);
short FRS_get_active_lineset_index(FreestyleConfig *config);
void FRS_set_active_lineset_index(FreestyleConfig *config, short index);
void FRS_unlink_target_object(FreestyleConfig *config, struct Object *ob);
#ifdef __cplusplus
}
#endif

View File

@@ -1,50 +0,0 @@
/*
* ***** 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 *****
*/
#ifndef __FRS_FREESTYLE_CONFIG_H__
#define __FRS_FREESTYLE_CONFIG_H__
/** \file FRS_freestyle_config.h
* \ingroup freestyle
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "DNA_scene_types.h"
void FRS_init_freestyle_config(FreestyleConfig *config);
void FRS_free_freestyle_config(FreestyleConfig *config);
void FRS_copy_freestyle_config(FreestyleConfig *new_config, FreestyleConfig *config);
#ifdef __cplusplus
}
#endif
#endif // __FRS_FREESTYLE_CONFIG_H__

View File

@@ -38,14 +38,9 @@
#include "../application/AppView.h"
#include "../application/Controller.h"
#include "BKE_global.h"
using namespace std;
// XXX Are those "ifdef __cplusplus" useful here?
#ifdef __cplusplus
extern "C" {
#endif
#include "MEM_guardedalloc.h"
@@ -54,6 +49,7 @@ extern "C" {
#include "DNA_group_types.h"
#include "DNA_text_types.h"
#include "BKE_freestyle.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_linestyle.h"
@@ -69,7 +65,6 @@ extern "C" {
#include "pixelblending.h"
#include "FRS_freestyle.h"
#include "FRS_freestyle_config.h"
#define DEFAULT_SPHERE_RADIUS 1.0f
#define DEFAULT_DKR_EPSILON 0.0f
@@ -95,10 +90,6 @@ Scene *freestyle_scene;
static string default_module_path;
// function declarations
static void copy_lineset(FreestyleLineSet *new_lineset, FreestyleLineSet *lineset);
static void copy_module(FreestyleModuleConfig *new_module, FreestyleModuleConfig *module);
//=======================================================
// Initialization
//=======================================================
@@ -640,158 +631,9 @@ void FRS_finish_stroke_rendering(Render *re)
// Freestyle Panel Configuration
//=======================================================
void FRS_init_freestyle_config(FreestyleConfig *config)
{
config->mode = FREESTYLE_CONTROL_EDITOR_MODE;
config->modules.first = config->modules.last = NULL;
config->flags = 0;
config->sphere_radius = DEFAULT_SPHERE_RADIUS;
config->dkr_epsilon = DEFAULT_DKR_EPSILON;
config->crease_angle = DEG2RADF(134.43f);
config->linesets.first = config->linesets.last = NULL;
}
void FRS_free_freestyle_config(FreestyleConfig *config)
{
FreestyleLineSet *lineset;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
if (lineset->group) {
lineset->group->id.us--;
lineset->group = NULL;
}
lineset->linestyle->id.us--;
lineset->linestyle = NULL;
}
BLI_freelistN(&config->linesets);
BLI_freelistN(&config->modules);
}
void FRS_copy_freestyle_config(FreestyleConfig *new_config, FreestyleConfig *config)
{
FreestyleLineSet *lineset, *new_lineset;
FreestyleModuleConfig *module, *new_module;
new_config->mode = config->mode;
new_config->raycasting_algorithm = config->raycasting_algorithm; /* deprecated */
new_config->flags = config->flags;
new_config->sphere_radius = config->sphere_radius;
new_config->dkr_epsilon = config->dkr_epsilon;
new_config->crease_angle = config->crease_angle;
new_config->linesets.first = new_config->linesets.last = NULL;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
new_lineset = FRS_alloc_lineset();
copy_lineset(new_lineset, lineset);
BLI_addtail(&new_config->linesets, (void *)new_lineset);
}
new_config->modules.first = new_config->modules.last = NULL;
for (module = (FreestyleModuleConfig *)config->modules.first; module; module = module->next) {
new_module = FRS_alloc_module();
copy_module(new_module, module);
BLI_addtail(&new_config->modules, (void *)new_module);
}
}
static void copy_lineset(FreestyleLineSet *new_lineset, FreestyleLineSet *lineset)
{
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;
new_lineset->exclude_edge_types = lineset->exclude_edge_types;
new_lineset->group = lineset->group;
if (new_lineset->group) {
new_lineset->group->id.us++;
}
strcpy(new_lineset->name, lineset->name);
}
FreestyleModuleConfig *FRS_alloc_module()
{
return (FreestyleModuleConfig *)MEM_callocN(sizeof(FreestyleModuleConfig), "style module configuration");
}
void FRS_add_module(FreestyleConfig *config)
{
FreestyleModuleConfig *module_conf = (FreestyleModuleConfig *)MEM_callocN(sizeof(FreestyleModuleConfig),
"style module configuration");
BLI_addtail(&config->modules, (void *)module_conf);
strcpy(module_conf->module_path, default_module_path.c_str());
module_conf->is_displayed = 1;
}
static void copy_module(FreestyleModuleConfig *new_module, FreestyleModuleConfig *module)
{
strcpy(new_module->module_path, module->module_path);
new_module->is_displayed = module->is_displayed;
}
void FRS_delete_module(FreestyleConfig *config, FreestyleModuleConfig *module_conf)
{
BLI_freelinkN(&config->modules, module_conf);
}
void FRS_move_module_up(FreestyleConfig *config, FreestyleModuleConfig *module_conf)
{
BLI_remlink(&config->modules, module_conf);
BLI_insertlinkbefore(&config->modules, module_conf->prev, module_conf);
}
void FRS_move_module_down(FreestyleConfig *config, FreestyleModuleConfig *module_conf)
{
BLI_remlink(&config->modules, module_conf);
BLI_insertlinkafter(&config->modules, module_conf->next, module_conf);
}
static void unique_lineset_name(FreestyleConfig *config, FreestyleLineSet *lineset)
{
BLI_uniquename(&config->linesets, lineset, "FreestyleLineSet", '.', offsetof(FreestyleLineSet, name),
sizeof(lineset->name));
}
FreestyleLineSet *FRS_alloc_lineset()
{
return (FreestyleLineSet *)MEM_callocN(sizeof(FreestyleLineSet), "Freestyle line set");
}
FreestyleLineSet *FRS_add_lineset(FreestyleConfig *config)
{
int lineset_index = BLI_countlist(&config->linesets);
FreestyleLineSet *lineset = FRS_alloc_lineset();
BLI_addtail(&config->linesets, (void *)lineset);
FRS_set_active_lineset_index(config, lineset_index);
lineset->linestyle = FRS_new_linestyle("LineStyle", NULL);
lineset->flags |= FREESTYLE_LINESET_ENABLED;
lineset->selection = FREESTYLE_SEL_VISIBILITY | FREESTYLE_SEL_EDGE_TYPES | FREESTYLE_SEL_IMAGE_BORDER;
lineset->qi = FREESTYLE_QI_VISIBLE;
lineset->qi_start = 0;
lineset->qi_end = 100;
lineset->edge_types = FREESTYLE_FE_SILHOUETTE | FREESTYLE_FE_BORDER | FREESTYLE_FE_CREASE;
lineset->exclude_edge_types = 0;
lineset->group = NULL;
if (lineset_index > 0)
sprintf(lineset->name, "LineSet %i", lineset_index + 1);
else
strcpy(lineset->name, "LineSet");
unique_lineset_name(config, lineset);
return lineset;
}
void FRS_copy_active_lineset(FreestyleConfig *config)
{
FreestyleLineSet *lineset = FRS_get_active_lineset(config);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
if (lineset) {
lineset_buffer.linestyle = lineset->linestyle;
@@ -813,7 +655,7 @@ void FRS_paste_active_lineset(FreestyleConfig *config)
if (!lineset_copied)
return;
FreestyleLineSet *lineset = FRS_get_active_lineset(config);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
if (lineset) {
lineset->linestyle->id.us--;
@@ -835,14 +677,14 @@ void FRS_paste_active_lineset(FreestyleConfig *config)
lineset->group->id.us++;
}
strcpy(lineset->name, lineset_buffer.name);
unique_lineset_name(config, lineset);
BKE_freestyle_lineset_unique_name(config, lineset);
lineset->flags |= FREESTYLE_LINESET_CURRENT;
}
}
void FRS_delete_active_lineset(FreestyleConfig *config)
{
FreestyleLineSet *lineset = FRS_get_active_lineset(config);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
if (lineset) {
if (lineset->group) {
@@ -853,13 +695,13 @@ void FRS_delete_active_lineset(FreestyleConfig *config)
lineset->linestyle = NULL;
BLI_remlink(&config->linesets, lineset);
MEM_freeN(lineset);
FRS_set_active_lineset_index(config, 0);
BKE_freestyle_lineset_set_active_index(config, 0);
}
}
void FRS_move_active_lineset_up(FreestyleConfig *config)
{
FreestyleLineSet *lineset = FRS_get_active_lineset(config);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
if (lineset) {
BLI_remlink(&config->linesets, lineset);
@@ -869,7 +711,7 @@ void FRS_move_active_lineset_up(FreestyleConfig *config)
void FRS_move_active_lineset_down(FreestyleConfig *config)
{
FreestyleLineSet *lineset = FRS_get_active_lineset(config);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
if (lineset) {
BLI_remlink(&config->linesets, lineset);
@@ -877,51 +719,4 @@ void FRS_move_active_lineset_down(FreestyleConfig *config)
}
}
FreestyleLineSet *FRS_get_active_lineset(FreestyleConfig *config)
{
FreestyleLineSet *lineset;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
if (lineset->flags & FREESTYLE_LINESET_CURRENT)
return lineset;
}
return NULL;
}
short FRS_get_active_lineset_index(FreestyleConfig *config)
{
FreestyleLineSet *lineset;
short i;
for (lineset = (FreestyleLineSet *)config->linesets.first, i = 0; lineset; lineset = lineset->next, i++) {
if (lineset->flags & FREESTYLE_LINESET_CURRENT)
return i;
}
return 0;
}
void FRS_set_active_lineset_index(FreestyleConfig *config, short index)
{
FreestyleLineSet *lineset;
short i;
for (lineset = (FreestyleLineSet *)config->linesets.first, i = 0; lineset; lineset = lineset->next, i++) {
if (i == index)
lineset->flags |= FREESTYLE_LINESET_CURRENT;
else
lineset->flags &= ~FREESTYLE_LINESET_CURRENT;
}
}
void FRS_unlink_target_object(FreestyleConfig *config, Object *ob)
{
FreestyleLineSet *lineset;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
FRS_unlink_linestyle_target_object(lineset->linestyle, ob);
}
}
#ifdef __cplusplus
} // extern "C"
#endif

View File

@@ -212,9 +212,7 @@ typedef struct PreviewImage {
#define ID_WM MAKE_ID2('W', 'M') /* WindowManager */
#define ID_MC MAKE_ID2('M', 'C') /* MovieClip */
#define ID_MSK MAKE_ID2('M', 'S') /* Mask */
/* #ifdef WITH_FREESTYLE */
# define ID_LS MAKE_ID2('L', 'S') /* FreestyleLineStyle */
/* #endif */
#define ID_LS MAKE_ID2('L', 'S') /* FreestyleLineStyle */
/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
#define ID_SEQ MAKE_ID2('S', 'Q')

View File

@@ -560,9 +560,7 @@ typedef enum eDopeSheet_FilterFlag {
ADS_FILTER_NONTREE = (1 << 19),
ADS_FILTER_NOTEX = (1 << 20),
ADS_FILTER_NOSPK = (1 << 21),
/* #ifdef WITH_FREESTYLE */
ADS_FILTER_NOLINESTYLE = (1 << 22),
/* #endif */
/* NLA-specific filters */
ADS_FILTER_NLA_NOACT = (1 << 25), /* if the AnimData block has no NLA data, don't include to just show Action-line */

View File

@@ -177,10 +177,8 @@ typedef struct Material {
short shadowonly_flag; /* "shadowsonly" type */
short index; /* custom index for render passes */
/* #ifdef WITH_FREESTYLE */
short vcol_alpha;
short pad4[3];
/* #endif */
ListBase gpumaterial; /* runtime */
} Material;

View File

@@ -203,10 +203,8 @@ typedef struct TFace {
/* debug only option */
#define ME_DRAWEXTRA_INDICES (1 << 13)
/* #ifdef WITH_FREESTYLE */
#define ME_DRAW_FREESTYLE_EDGE (1 << 14)
#define ME_DRAW_FREESTYLE_FACE (1 << 15)
/* #endif */
/* Subsurf Type */
#define ME_CC_SUBSURF 0

View File

@@ -311,9 +311,7 @@ typedef struct FreestyleFace {
#define ME_LOOSEEDGE (1<<7)
/* #define ME_SEAM_LAST (1<<8) */ /* UNUSED */
#define ME_SHARP (1<<9) /* only reason this flag remains a 'short' */
/* #ifdef WITH_FREESTYLE */
#define ME_FREESTYLE_EDGE (1<<10) /* TO BE REMOVED when the trunk merger is done */
/* #endif */
/* puno = vertexnormal (mface) */
#define ME_PROJXY 16
@@ -330,9 +328,7 @@ typedef struct FreestyleFace {
/* flag (mface) */
#define ME_SMOOTH 1
#define ME_FACE_SEL 2
/* #ifdef WITH_FREESTYLE */
#define ME_FREESTYLE_FACE 4 /* TO BE REMOVED when the trunk merger is done */
/* #endif */
/* flag ME_HIDE==16 is used here too */
#define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])

View File

@@ -45,9 +45,7 @@ extern "C" {
#include "DNA_vec_types.h"
#include "DNA_listBase.h"
#include "DNA_ID.h"
/* #ifdef WITH_FREESTYLE */
#include "DNA_freestyle_types.h"
/* #endif */
struct Object;
struct Brush;
@@ -191,9 +189,7 @@ typedef struct SceneRenderLayer {
int samples;
int pad;
/* #ifdef WITH_FREESTYLE */
struct FreestyleConfig freestyleConfig;
/* #endif */
} SceneRenderLayer;
/* srl->layflag */
@@ -203,10 +199,8 @@ typedef struct SceneRenderLayer {
#define SCE_LAY_EDGE 8
#define SCE_LAY_SKY 16
#define SCE_LAY_STRAND 32
/* #ifdef WITH_FREESTYLE */
#define SCE_LAY_FRS 64
/* #endif */
/* flags between 64 and 0x8000 are set to 1 already, for future options */
/* flags between 128 and 0x8000 are set to 1 already, for future options */
#define SCE_LAY_ALL_Z 0x8000
#define SCE_LAY_XOR 0x10000
@@ -554,11 +548,9 @@ typedef struct RenderData {
float pad2;
struct Text *dometext DNA_DEPRECATED; // XXX deprecated since 2.5
/* #ifdef WITH_FREESTYLE */
/* Freestyle line thickness options */
int line_thickness_mode;
float unit_line_thickness; /* in pixels */
/* #endif */
/* render engine */
char engine[32];
@@ -1354,11 +1346,9 @@ typedef struct Scene {
/* simplify_flag */
#define R_SIMPLE_NO_TRIANGULATE 1
/* #ifdef WITH_FREESTYLE */
/* line_thickness_mode */
#define R_LINE_THICKNESS_ABSOLUTE 1
#define R_LINE_THICKNESS_RELATIVE 2
/* #endif */
/* sequencer seq_prev_type seq_rend_type */
@@ -1568,9 +1558,7 @@ typedef enum SculptFlags {
#define EDGE_MODE_TAG_SHARP 2
#define EDGE_MODE_TAG_CREASE 3
#define EDGE_MODE_TAG_BEVEL 4
/* #ifdef WITH_FREESTYLE */
#define EDGE_MODE_TAG_FREESTYLE 5
/* #endif */
/* toolsettings->gpencil_flags */
#define GP_TOOL_FLAG_PAINTSESSIONS_ON (1<<0)

View File

@@ -240,9 +240,7 @@ typedef struct ThemeSpace {
char bone_solid[4], bone_pose[4], bone_pose_active[4];
char strip[4], strip_select[4];
char cframe[4];
/* #ifdef WITH_FREESTYLE */
char freestyle_edge_mark[4], freestyle_face_mark[4];
/* #endif */
char nurb_uline[4], nurb_vline[4];
char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];

View File

@@ -34,10 +34,6 @@ blender_include_dirs(
..
)
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
# -----------------------------------------------------------------------------
# Build makesdna executable
set(SRC

View File

@@ -39,9 +39,6 @@ root_build_dir=normpath(env['BF_BUILDDIR'])
source_files = ['makesdna.c']
header_files = env.Glob('../*.h')
if env['WITH_BF_FREESTYLE']:
defines.append('WITH_FREESTYLE')
makesdna_tool = env.Clone()
dna = env.Clone()
makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')

View File

@@ -134,10 +134,8 @@ static const char *includefiles[] = {
"DNA_dynamicpaint_types.h",
"DNA_mask_types.h",
"DNA_rigidbody_types.h",
/* #ifdef WITH_FREESTYLE */
"DNA_freestyle_types.h",
"DNA_linestyle_types.h",
/* #endif */
/* empty string to indicate end of includefiles */
""
@@ -1272,8 +1270,6 @@ int main(int argc, char **argv)
#include "DNA_dynamicpaint_types.h"
#include "DNA_mask_types.h"
#include "DNA_rigidbody_types.h"
/* #ifdef WITH_FREESTYLE */
#include "DNA_freestyle_types.h"
#include "DNA_linestyle_types.h"
/* #endif */
/* end of list */

View File

@@ -243,12 +243,10 @@ extern StructRNA RNA_FluidFluidSettings;
extern StructRNA RNA_FluidSettings;
extern StructRNA RNA_FluidSimulationModifier;
extern StructRNA RNA_FollowPathConstraint;
#ifdef WITH_FREESTYLE
extern StructRNA RNA_FreestyleLineStyle;
extern StructRNA RNA_FreestyleLineSet;
extern StructRNA RNA_FreestyleModuleSettings;
extern StructRNA RNA_FreestyleSettings;
#endif
extern StructRNA RNA_Function;
extern StructRNA RNA_GPencilFrame;
extern StructRNA RNA_GPencilLayer;
@@ -305,7 +303,6 @@ extern StructRNA RNA_LimitDistanceConstraint;
extern StructRNA RNA_LimitLocationConstraint;
extern StructRNA RNA_LimitRotationConstraint;
extern StructRNA RNA_LimitScaleConstraint;
#ifdef WITH_FREESTYLE
extern StructRNA RNA_LineStyleAlphaModifier;
extern StructRNA RNA_LineStyleAlphaModifier_AlongStroke;
extern StructRNA RNA_LineStyleAlphaModifier_DistanceFromCamera;
@@ -337,7 +334,6 @@ extern StructRNA RNA_LineStyleThicknessModifier_Calligraphy;
extern StructRNA RNA_LineStyleThicknessModifier_DistanceFromCamera;
extern StructRNA RNA_LineStyleThicknessModifier_DistanceFromObject;
extern StructRNA RNA_LineStyleThicknessModifier_Material;
#endif
extern StructRNA RNA_LockedTrackConstraint;
extern StructRNA RNA_Macro;
extern StructRNA RNA_MagicTexture;

View File

@@ -163,12 +163,10 @@ extern EnumPropertyItem clip_editor_mode_items[];
extern EnumPropertyItem icon_items[];
extern EnumPropertyItem uilist_layout_type_items[];
#ifdef WITH_FREESTYLE
extern EnumPropertyItem linestyle_color_modifier_type_items[];
extern EnumPropertyItem linestyle_alpha_modifier_type_items[];
extern EnumPropertyItem linestyle_thickness_modifier_type_items[];
extern EnumPropertyItem linestyle_geometry_modifier_type_items[];
#endif
struct bContext;
struct PointerRNA;

View File

@@ -54,6 +54,7 @@ set(DEFSRC
rna_key.c
rna_lamp.c
rna_lattice.c
rna_linestyle.c
rna_main.c
rna_mask.c
rna_material.c
@@ -93,12 +94,6 @@ set(DEFSRC
rna_world.c
)
if(WITH_FREESTYLE)
list(APPEND DEFSRC
rna_linestyle.c
)
endif()
set(APISRC
rna_action_api.c
rna_actuator_api.c
@@ -277,9 +272,7 @@ blender_include_dirs(
)
if(WITH_FREESTYLE)
blender_include_dirs(
../../freestyle
)
# TO BE REMOVED when the trunk merger is done
add_definitions(-DWITH_FREESTYLE)
endif()

View File

@@ -139,8 +139,8 @@ if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_FREESTYLE']:
# TO BE REMOVED when the trunk merger is done
defs.append('WITH_FREESTYLE')
incs += ' ../../freestyle'
if not env['BF_DEBUG']:
defs.append('NDEBUG')

View File

@@ -3250,9 +3250,7 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_key.c", NULL, RNA_def_key},
{"rna_lamp.c", NULL, RNA_def_lamp},
{"rna_lattice.c", NULL, RNA_def_lattice},
#ifdef WITH_FREESTYLE
{"rna_linestyle.c", NULL, RNA_def_linestyle},
#endif
{"rna_main.c", "rna_main_api.c", RNA_def_main},
{"rna_material.c", "rna_material_api.c", RNA_def_material},
{"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},

View File

@@ -57,9 +57,7 @@ EnumPropertyItem id_type_items[] = {
{ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""},
{ID_LA, "LAMP", ICON_LAMP_DATA, "Lamp", ""},
{ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""},
#ifdef WITH_FREESTYLE
{ID_LS, "LINESTYLE", ICON_PARTICLE_DATA, "FreestyleLineStyle", ""}, /* FIXME proper icon */
#endif
{ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},
{ID_MA, "MATERIAL", ICON_MATERIAL_DATA, "Material", ""},
{ID_MB, "META", ICON_META_DATA, "MetaBall", ""},
@@ -135,9 +133,7 @@ short RNA_type_to_ID_code(StructRNA *type)
if (RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
if (RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
if (RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
#ifdef WITH_FREESTYLE
if (RNA_struct_is_a(type, &RNA_FreestyleLineStyle)) return ID_LS;
#endif
if (RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT;
if (RNA_struct_is_a(type, &RNA_Material)) return ID_MA;
if (RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB;
@@ -174,9 +170,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
case ID_KE: return &RNA_Key;
case ID_LA: return &RNA_Lamp;
case ID_LI: return &RNA_Library;
#ifdef WITH_FREESTYLE
case ID_LS: return &RNA_FreestyleLineStyle;
#endif
case ID_LT: return &RNA_Lattice;
case ID_MA: return &RNA_Material;
case ID_MB: return &RNA_MetaBall;

View File

@@ -396,13 +396,11 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLINESTYLE);
RNA_def_property_ui_text(prop, "Display Line Style", "Include visualization of Line Style related Animation data");
RNA_def_property_ui_icon(prop, ICON_BRUSH_DATA, 0); /* FIXME */
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
#endif
prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);

View File

@@ -57,9 +57,7 @@
#include "BKE_node.h"
#include "BKE_sequencer.h"
#include "BKE_texture.h"
#ifdef WITH_FREESTYLE
# include "BKE_linestyle.h"
#endif
#include "BKE_linestyle.h"
#include "ED_node.h"
@@ -188,20 +186,18 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
break;
}
default:
/* everything else just uses 'color_ramp' */
path = BLI_strdup("color_ramp");
break;
#ifdef WITH_FREESTYLE
case ID_LS:
{
char *path = FRS_path_from_ID_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
char *path = BKE_path_from_ID_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
if (path)
return path;
break;
}
#endif
default:
/* everything else just uses 'color_ramp' */
path = BLI_strdup("color_ramp");
break;
}
}
else {
@@ -273,13 +269,12 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
}
break;
#ifdef WITH_FREESTYLE
case ID_LS:
{
ListBase listbase;
LinkData *link;
FRS_list_modifier_color_ramps((FreestyleLineStyle *)id, &listbase);
BKE_list_modifier_color_ramps((FreestyleLineStyle *)id, &listbase);
for (link = (LinkData *)listbase.first; link; link = link->next) {
RNA_pointer_create(id, &RNA_ColorRamp, link->data, &ramp_ptr);
COLRAMP_GETPATH;
@@ -287,7 +282,6 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
BLI_freelistN(&listbase);
break;
}
#endif
default: /* everything else should have a "color_ramp" property */
{
@@ -340,7 +334,6 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
WM_main_add_notifier(NC_TEXTURE, tex);
}
break;
#ifdef WITH_FREESTYLE
case ID_LS:
{
FreestyleLineStyle *linestyle= ptr->id.data;
@@ -348,7 +341,6 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
WM_main_add_notifier(NC_LINESTYLE, linestyle);
break;
}
#endif
default:
break;
}

View File

@@ -152,9 +152,7 @@ void RNA_def_image(struct BlenderRNA *brna);
void RNA_def_key(struct BlenderRNA *brna);
void RNA_def_lamp(struct BlenderRNA *brna);
void RNA_def_lattice(struct BlenderRNA *brna);
#ifdef WITH_FREESTYLE
void RNA_def_linestyle(struct BlenderRNA *brna);
#endif
void RNA_def_main(struct BlenderRNA *brna);
void RNA_def_material(struct BlenderRNA *brna);
void RNA_def_mesh(struct BlenderRNA *brna);
@@ -316,9 +314,7 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop);
#ifdef WITH_FREESTYLE
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop);
#endif
/* ID Properties */

View File

@@ -259,13 +259,11 @@ static void rna_Main_masks_begin(CollectionPropertyIterator *iter, PointerRNA *p
rna_iterator_listbase_begin(iter, &bmain->mask, NULL);
}
#ifdef WITH_FREESTYLE
static void rna_Main_linestyle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->linestyle, NULL);
}
#endif
#ifdef UNIT_TEST
@@ -331,9 +329,7 @@ void RNA_def_main(BlenderRNA *brna)
{"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil},
{"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", RNA_def_main_movieclips},
{"masks", "Mask", "rna_Main_masks_begin", "Masks", "Masks datablocks", RNA_def_main_masks},
#ifdef WITH_FREESTYLE
{"linestyles", "FreestyleLineStyle", "rna_Main_linestyle_begin", "Line Styles", "Line Style datablocks", RNA_def_main_linestyles},
#endif
{NULL, NULL, NULL, NULL, NULL, NULL}
};

View File

@@ -76,9 +76,7 @@
#include "BKE_movieclip.h"
#include "BKE_mask.h"
#include "BKE_gpencil.h"
#ifdef WITH_FREESTYLE
# include "BKE_linestyle.h"
#endif
#include "BKE_linestyle.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
@@ -848,10 +846,9 @@ static void rna_Main_grease_pencil_remove(Main *bmain, ReportList *reports, Poin
gpd->id.name + 2, ID_REAL_USERS(gpd));
}
#ifdef WITH_FREESTYLE
FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char* name)
{
FreestyleLineStyle *linestyle = FRS_new_linestyle(name, bmain);
FreestyleLineStyle *linestyle = BKE_new_linestyle(name, bmain);
id_us_min(&linestyle->id);
return linestyle;
}
@@ -865,7 +862,6 @@ void rna_Main_linestyles_remove(Main *bmain, ReportList *reports, FreestyleLineS
/* XXX python now has invalid pointer? */
}
#endif
/* tag functions, all the same */
static void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); }
@@ -898,9 +894,7 @@ static void rna_Main_particles_tag(Main *bmain, int value) { tag_main_lb(&bmain-
static void rna_Main_gpencil_tag(Main *bmain, int value) { tag_main_lb(&bmain->gpencil, value); }
static void rna_Main_movieclips_tag(Main *bmain, int value) { tag_main_lb(&bmain->movieclip, value); }
static void rna_Main_masks_tag(Main *bmain, int value) { tag_main_lb(&bmain->mask, value); }
#ifdef WITH_FREESTYLE
void rna_Main_linestyle_tag(Main *bmain, int value) { tag_main_lb(&bmain->linestyle, value); }
#endif
static void rna_Main_linestyle_tag(Main *bmain, int value) { tag_main_lb(&bmain->linestyle, value); }
static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA); }
static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE); }
@@ -1943,7 +1937,6 @@ void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
}
#ifdef WITH_FREESTYLE
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
@@ -1969,6 +1962,5 @@ void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
#endif
#endif

View File

@@ -1736,12 +1736,10 @@ static void rna_def_mpolygon(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Smooth", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "use_freestyle_face_mark", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_FACE);
RNA_def_property_ui_text(prop, "Freestyle Face Mark", "Face mark for Freestyle feature edge detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#endif
prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
@@ -2955,7 +2953,6 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Sharp", "Display sharp edges, used with the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FREESTYLE_EDGE);
RNA_def_property_ui_text(prop, "Draw Freestyle Edge Marks", "Display Freestyle edge marks, used with the Freestyle renderer");
@@ -2965,7 +2962,6 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FREESTYLE_FACE);
RNA_def_property_ui_text(prop, "Draw Freestyle Face Marks", "Display Freestyle face marks, used with the Freestyle renderer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
#endif
prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_EDGELEN);

View File

@@ -32,16 +32,15 @@
#include "DNA_particle_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_userdef_types.h"
#include "DNA_world_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_linestyle_types.h"
#endif
#include "BLI_math.h"
#include "BLF_translation.h"
#include "BKE_freestyle.h"
#include "BKE_tessmesh.h"
#include "RNA_define.h"
@@ -336,10 +335,6 @@ EnumPropertyItem image_color_depth_items[] = {
#include "RE_engine.h"
#ifdef WITH_FREESTYLE
# include "FRS_freestyle.h"
#endif
static void rna_SpaceImageEditor_uv_sculpt_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
{
ED_space_image_uv_sculpt_update(bmain->wm.first, scene->toolsettings);
@@ -1461,7 +1456,6 @@ static char *rna_ToolSettings_path(PointerRNA *ptr)
return BLI_strdup("tool_settings");
}
#ifdef WITH_FREESTYLE
static PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
{
FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
@@ -1481,7 +1475,7 @@ static void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value
static PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
{
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
FreestyleLineSet *lineset = FRS_get_active_lineset(config);
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
}
@@ -1497,15 +1491,14 @@ static void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, in
static int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
{
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
return FRS_get_active_lineset_index(config);
return BKE_freestyle_lineset_get_active_index(config);
}
static void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
{
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
FRS_set_active_lineset_index(config, value);
BKE_freestyle_lineset_set_active_index(config, value);
}
#endif
#else
@@ -1574,9 +1567,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
{EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
{EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
#ifdef WITH_FREESTYLE
{EDGE_MODE_TAG_FREESTYLE, "FREESTYLE", 0, "Tag Freestyle Edge Mark", ""},
#endif
{0, NULL, 0, NULL, NULL}
};
@@ -2143,7 +2134,6 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_FRS);
RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer");
@@ -2151,7 +2141,6 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
else
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
#endif
/* passes */
prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
@@ -2373,7 +2362,6 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
#ifdef WITH_FREESTYLE
static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
@@ -2781,7 +2769,6 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Line Sets", "");
rna_def_freestyle_linesets(brna, prop);
}
#endif
static void rna_def_scene_game_recast_data(BlenderRNA *brna)
{
@@ -3326,9 +3313,7 @@ static void rna_def_scene_render_layer(BlenderRNA *brna)
rna_def_render_layer_common(srna, 1);
#ifdef WITH_FREESTYLE
/* Freestyle */
rna_def_freestyle_settings(brna);
prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
@@ -3336,7 +3321,6 @@ static void rna_def_scene_render_layer(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "freestyleConfig");
RNA_def_property_struct_type(prop, "FreestyleSettings");
RNA_def_property_ui_text(prop, "Freestyle Settings", "");
#endif
}
/* curve.splines */
@@ -3931,14 +3915,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
#ifdef WITH_FREESTYLE
static EnumPropertyItem freestyle_thickness_items[] = {
{R_LINE_THICKNESS_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Specify unit line thickness in pixels"},
{R_LINE_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative",
"Unit line thickness is scaled by the proportion of the present vertical image "
"resolution to 480 pixels"},
{0, NULL, 0, NULL, NULL}};
#endif
rna_def_scene_ffmpeg_settings(brna);
#ifdef WITH_QUICKTIME
@@ -4184,12 +4166,10 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS);
RNA_def_property_ui_text(prop, "Edge", "Draw stylized strokes using Freestyle");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
#endif
/* threads */
prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
@@ -4652,7 +4632,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Persistent Data", "Keep render data around for faster re-renders");
RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
#ifdef WITH_FREESTYLE
/* Freestyle line thickness options */
prop = RNA_def_property(srna, "line_thickness_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "line_thickness_mode");
@@ -4663,7 +4642,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "unit_line_thickness");
RNA_def_property_range(prop, 0.f, 10000.f);
RNA_def_property_ui_text(prop, "Unit Line Thickness", "Unit line thickness in pixels");
#endif
/* Scene API */
RNA_api_scene_render(srna);

View File

@@ -1201,12 +1201,10 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "freestyle_edge_mark", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Freestyle Edge Mark", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
#endif
}
static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
@@ -1233,12 +1231,10 @@ static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
RNA_def_property_ui_text(prop, "Face Dot Size", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
#ifdef WITH_FREESTYLE
prop = RNA_def_property(srna, "freestyle_face_mark", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Freestyle Face Mark", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
#endif
}
static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurbs)

View File

@@ -47,6 +47,7 @@
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_freestyle.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ -57,10 +58,6 @@
#include "render_result.h"
#include "render_types.h"
#ifdef WITH_FREESTYLE
# include "FRS_freestyle_config.h"
#endif
/********************************** Free *************************************/
void render_result_free(RenderResult *res)
@@ -568,9 +565,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
rl->lay = (1 << 20) - 1;
rl->layflag = 0x7FFF; /* solid ztra halo strand */
rl->passflag = SCE_PASS_COMBINED;
#ifdef WITH_FREESTYLE
FRS_init_freestyle_config(&srl->freestyleConfig);
#endif
BKE_freestyle_config_init(&srl->freestyleConfig);
re->r.actlay = 0;
}

View File

@@ -239,9 +239,7 @@ typedef struct wmNotifier {
#define NC_MOVIECLIP (20<<24)
#define NC_MASK (21<<24)
#define NC_GPENCIL (22<<24)
#ifdef WITH_FREESTYLE
# define NC_LINESTYLE (23<<24)
#endif
#define NC_LINESTYLE (23<<24)
/* data type, 256 entries is enough, it can overlap */
#define NOTE_DATA 0x00FF0000