A major code update for making the DNA file specification of Freestyle settings
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 23 Mar 2013 03:00:37 +0000 (03:00 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 23 Mar 2013 03:00:37 +0000 (03:00 +0000)
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_.

71 files changed:
source/blender/CMakeLists.txt
source/blender/SConscript
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/CMakeLists.txt
source/blender/blenfont/SConscript
source/blender/blenkernel/BKE_freestyle.h [new file with mode: 0644]
source/blender/blenkernel/BKE_linestyle.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/bpath.c
source/blender/blenkernel/intern/freestyle.c [new file with mode: 0644]
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/SConscript
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/animation/CMakeLists.txt
source/blender/editors/animation/SConscript
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/CMakeLists.txt
source/blender/editors/interface/SConscript
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_nla/CMakeLists.txt
source/blender/editors/space_nla/SConscript
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/freestyle/FRS_freestyle.h
source/blender/freestyle/FRS_freestyle_config.h [deleted file]
source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/intern/CMakeLists.txt
source/blender/makesdna/intern/SConscript
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/render/intern/source/render_result.c
source/blender/windowmanager/WM_types.h

index 14d5a2cca0c86cf12221a7695fd45f67720c5843..7e327028a01e07b110aab522efe81bc0778db1ff 100644 (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()
 
index a4041212c89d154c4fee5e3b6a7e9062289fb7a0..66d54961131a3b9d4ed61c96e917f1a202e88969 100644 (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'])
index c8d46503e261f7c3b2cd8b82bfceaf9b9853cd2e..19746f7d5b43ba1db69862365f04be9490bcde18 100644 (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"
index 42298133d7d7e9b92aea3d6d4cf92592717ca6cf..7bb80c343232e1d0a39f8501554b9d6c738dcb59 100644 (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}")
index 8273ddf1e4019182d032913886ccf6bd8ef38533..3529330a308e909a84a0ac0554ef8a398f2caaac 100644 (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] )
diff --git a/source/blender/blenkernel/BKE_freestyle.h b/source/blender/blenkernel/BKE_freestyle.h
new file mode 100644 (file)
index 0000000..84a4bc2
--- /dev/null
@@ -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
+
index e077cd998c9ea0f8a622c34e9fec3e2a3d2cdddd..13d111cb93b81c55b613f555a167a9769b93b1da 100644 (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
 
 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);
-
-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);
+FreestyleLineStyle *BKE_new_linestyle(const char *name, struct Main *main);
+void BKE_free_linestyle(FreestyleLineStyle *linestyle);
+FreestyleLineStyle *BKE_copy_linestyle(FreestyleLineStyle *linestyle);
 
-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_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);
 
-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);
+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_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_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_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
-char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *color_ramp);
+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_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob);
+void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
+char *BKE_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, struct ColorBand *color_ramp);
 
-#endif  /* WITH_FREESTYLE */
+void BKE_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob);
 
 #endif  /* __BKE_LINESTYLE_H__ */
index fec163e2d17010798047c8629c5996cca50c4663..264a7421e911e12fac795bf9ba975477c266afc6 100644 (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;
index 599296f54a5b3d2ad8bf4264628f96264990e2a6..57e99481604e3c2448af17a3ac548240b981e6cf 100644 (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()
 
index 623df124d96ad0559fff7f640f077c6408823d28..c21cd168874b7a35ef1847e6d12d8cdd539647fd 100644 (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']
index 738d4c5b0891eabc7a6de177dc919c7cf1957551..d4563c936d031677539c25b4eb5bc31923680644 100644 (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
index 624e86d5787e85a798713f2c5bc1bb0d072670a0..6998ffabe659bb7ee3fcbead656f7737c1d8bc99 100644 (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:
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c
new file mode 100644 (file)
index 0000000..bcbc3dd
--- /dev/null
@@ -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;
+       }
+}
index 61f468373f4daebed448b1bae9537262f37d6bd5..98d1d301f65caf285d480c1d6e8b7a337471c4a5 100644 (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
                }
        }
        
index 11d3e69120d621c37e5d380e35ded79cef885d29..adc0503df292406f8cf9b74d7984766595770894 100644 (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 },
index 67fc5bd5dcade99c900f4774bf34c3d02b5e7a90..594905bf7c5e92e1df96148ca3c1ba25411df1e5 100644 (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"
 #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);
index f017b4a97cd807d9520322b82ca774938b1f59cf..fe27ddcfafe3653d6f497cd57d63608d0f1f51cf 100644 (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;
 
index a863d187a2cedda7683c2bd13ddfee3d753f56e5..a4f147a4fac62e3819e9830741524e2bdc36dd19 100644 (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;
index 0c6e0f7252329340168784c2ba1f2974f87a81d1..20a5daf7116988d4b80f2fa0d90fb9921eb74ba9 100644 (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"
 
 #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;
index a942e694f2e28969cfb1ab57e24045d2cd7fa0f5..d01d7090d96e095500256e42fc0488e2d7172deb 100644 (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"
 //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;
 }
index 199174ae6028b14bafbd699390bb34c36ffae173..e39ae395ffa30b3db2fc74f204c3a26b45dbf425 100644 (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
index 79e2a47aeb836a5d221a8715a206c2a5f6592d1b..41a9fe9e8b47f51c54698577dc5e52463d4ff544 100644 (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'
index b55d6b679d2fb5c9c17ee306090acf61bce64956..5b929195aea48b47932f34f182fa3b1346e17a62 100644 (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}")
index f85ae8c112bbcc537c8660235e28614a4433455c..8950c4f770298668a6640ed707dd32900814ce5f 100644 (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:
index 0fa01b95bb2bf5efc908cc4a02ac70f66316bdf3..2be1b9589823dc6d77fa956b97482ef0e53fc121 100644 (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;
index 83899c3c3a004a53147945bae4329ac6bfef7a82..24075a1fe58515770dddd991fa69ded7c7bfc7b2 100644 (file)
 #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) {
index 58e38e55fa3efdebeb89b0c5c299162ac8c76898..9e1e44e411de25f86844967949c4d3c33ec7e287 100644 (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}")
index a4ccf1f6c3ce0aa7eead9a710ca3b4cca092d2fd..2a6b381ba66fbf9e62170ccdfa84153828f8fd01 100644 (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] )
index d6188720cdf72a80f9b3867866b02278a25fe0ee..c7b28587e47c9647ad3c3e461faa199baee49672 100644 (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 */
                
index dd18d07732d16dff68fcf15abd8b95d5a4a73f42..481430f37e487b7f9dd6d730c4617b96502517fe 100644 (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... */
index 7648d99821637fae372ccf945ede3db4f9b21482..61e03806391f983774cfea6975ee49db8c95922c 100644 (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 */
        }
index 625ef27f4f784a1b97ed50714fcf725bccead77c..1c2ec27a0612a38c1cff421087b954ecad39c37f 100644 (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))
index fb4e9d2aa6e63b62c15f9172afb93c378f54cf86..308ca8c9355420b10ede3381ea601ffeed5ef62f 100644 (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 */
index 267e7c05737a3824f87909662b7cc3c3b9eca03a..8ba86673f87b4ac5c2b9d5dba5690edde2b42178 100644 (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()
index 16e4e6cb9c0ee2da241577769d7f87eb1a060143..8d277d6cd3575a1e6bc1c26d97a53cc0b0e48abb 100644 (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')
     
index f376d42e7a8707adc943d0927fd0fa4b3e879587..30d360363c67e47ba70f6de71689e29c1c709ba9 100644 (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) {
index 658d89abea3f2dd63b94e5fd4aeb0c6966d5b875..288b8b43e82877c5f206f3cc5138dfbced7daf6d 100644 (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) {
index 174343ff0ad6c1249ef381fb65a1ef9372744186..d1254a7cb78b440976bd1f3690db28cd0f79d82a 100644 (file)
 #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)
 {
index 32fb3850ceeacbaf55ab671df98250ff1d3d6ea5..aa3598e8e1f5979c69095caa1853a474152354ae 100644 (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}")
index 2316f37e661ee691eb892e12dbf3f5105bd12e11..18c6392eee9fb7920c82f44d715cf263ea6cb662 100644 (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] )
index b2cae8e549649ff7e848c6413df63e06f831a50c..b26d1662f6c1b108c91a71cb6a3862fd394ced09 100644 (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 */
index 6d091e3c7c48bfbe993d757fd55e80bde46e315a..97a1c583e36461a3cfdab9da98f82f13917509ec 100644 (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... */
index 5b2b62818c111c843c872f7dd13e140a9a379957..1759d3946646a74d85cb7ed208735a0d519b4442 100644 (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
diff --git a/source/blender/freestyle/FRS_freestyle_config.h b/source/blender/freestyle/FRS_freestyle_config.h
deleted file mode 100644 (file)
index 3a1d148..0000000
+++ /dev/null
@@ -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__
index a500330265342af6e40be9d06d969dfe5ef73527..16f6633f54cd744f0f7511808c00d6733f63c243 100644 (file)
 #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
index 289af75517058263b045de92798af096d024ae0b..9103914c3e722ab41210156da6c3dfe007e43373 100644 (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')
index 392c92148b466511a4f2ed27cf168e59d329ca00..eded0b4b76e0cf6ba794fd73bf5f9be2c7c18baa 100644 (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 */
index 544535303bd099bad59d0bf0e04d2ada50e2a6e4..e23b85b5a4e9fbe981b881db9be68675f9a47c04 100644 (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;
index c125518ba73477998b6db953ded4bc137ce1731b..df8b423fcad83adb50137f00171066acbc0cde1d 100644 (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
index b849ca28d491da19ca593788ede098b1d63c7e4b..0eba83dae552b1164f02f69d6abcf28bf1939ec5 100644 (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)])
index 702df31f832c272592d5f35c37ff1d0c806b1e15..a106afd38b20aeff43b7d7d5b2eaf20bfb8a982b 100644 (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)
index 950483ba3ffd218ab2dc069ced26d4362a682227..c70433eeea3c5d7b3ba001a000fe408ba64ff8b2 100644 (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];
index 0632564b998e838b3f240c30b2ead9f3e07483fa..0ad52d9b3a3465186ab7f39d5782776f3bf042f9 100644 (file)
@@ -34,10 +34,6 @@ blender_include_dirs(
        ..
 )
 
-if(WITH_FREESTYLE)
-       add_definitions(-DWITH_FREESTYLE)
-endif()
-
 # -----------------------------------------------------------------------------
 # Build makesdna executable
 set(SRC
index 8fd5b67c44b8c94937a64d18fc6ea754b943c2bf..add9611866d1998d6b8eb0498a7e36e97b897507 100644 (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/\\"" ')
index acc6597d2c7e1489b9b1692686f761bc6998f379..da1811656a6376ba8e20744ba9b89f03c027f004 100644 (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 */
index f8c49d683c386e30d68f34dc1a1133f4e56a598d..22259d71a2fa581a1b1e376de5c02d69b6a800c3 100644 (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;
index 09d08db59d7425984ab463de3866824397ac5aeb..e6ee1b7c38234ff25c816163942ad07de116be5e 100644 (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;
index 0375868915bdd42914f4600c5737ca87c29c55ec..609592cc1cd1d800af8890bbe1c2b8fe42b1826c 100644 (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()
 
index fc520bdea2fa5f70d5585494b4259d1e45bf49cc..910cf8385f56d17867fc4565e09c800eb9c897eb 100644 (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')
index 0d5c1eb2352bec68c289ab364f2835d71a36f319..6fc4ab33ad1e638cf8de54779f20b99718e75eda 100644 (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},
index 1716864f23f9af49de328594191da66554a8a0b5..0489f85a37fc4d3cce525bf360464cc580b7ef0d 100644 (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;
index e9bf40a58b148d5735024dbdbc5cec72ee863fdc..6ab6b8528f9bcfe5a83848a63b755374d8fbdf77 100644 (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);
index 98672f2fca25da01090151016d9cd8d8d0494227..640e91adabfc0e766627d115f3d5548a6536cc03 100644 (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;
                }
index 550a3d8f353984b4c379da00e3a9c98e29218370..09ea82e5ec706d1589421b10b80f258b0acd3e13 100644 (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 */
 
index 06a7b4aa11be957d30b2d596bc6530ec82dc994a..389ec426428f95d99bff2a5d898784cc3cee6497 100644 (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}
        };
 
index f5c23923f81fab0461b1adce8908777ade8708e6..fb0aeffcffbe7de7b2e4b1e4b40aafb78ac946e6 100644 (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
index ac67a80e862334bd47be61d3e3f08225a20ca591..e488bedca8a889533d99228b228f3dfb0f3c4959 100644 (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);
index 0553402d1113d92ca0acbb8e918a624de4e4cbe0..7469aac56adf3f16111a938d5a51cef6c14464c5 100644 (file)
 #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);
index 2a4a73b91c14ad1fb4e9a5fc60dbc7dbc180b4f2..9e4583b84eef0d4631fc705de03d209fe3adb686 100644 (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)
index 21e7b6986100826b7679b7c8a38ecfb725ee8124..10c83d19c4b53ee5e59645ca23f03a9c71918684 100644 (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"
 #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;
        }
index a42e4438311ebd81edd2ee711bbe398ba6556d97..c823810fc757a4708dbca8577dd44650388f3f5e 100644 (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