From a462d69bbf771e49d2fa49589608c375376b42ed Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Thu, 20 Dec 2012 07:57:26 +0000 Subject: Another big patch set by Bastien Montagne, thanks a lot! * Made Freestyle optional (turned on by default). * Fix for missing bpath.c updates in the previous merge of trunk changes. --- source/blender/CMakeLists.txt | 10 +++- source/blender/SConscript | 4 +- source/blender/blenfont/BLF_translation.h | 4 +- source/blender/blenfont/CMakeLists.txt | 4 ++ source/blender/blenfont/SConscript | 3 + source/blender/blenkernel/BKE_linestyle.h | 7 ++- source/blender/blenkernel/BKE_main.h | 2 + source/blender/blenkernel/CMakeLists.txt | 14 ++++- source/blender/blenkernel/SConscript | 8 ++- source/blender/blenkernel/intern/anim_sys.c | 10 +++- source/blender/blenkernel/intern/bpath.c | 15 +++++ source/blender/blenkernel/intern/group.c | 12 ++-- source/blender/blenkernel/intern/idcode.c | 2 + source/blender/blenkernel/intern/library.c | 16 +++++- source/blender/blenkernel/intern/material.c | 2 + source/blender/blenkernel/intern/object.c | 6 +- source/blender/blenkernel/intern/scene.c | 19 +++++-- source/blender/blenkernel/intern/subsurf_ccg.c | 8 +++ source/blender/blenlib/CMakeLists.txt | 4 ++ source/blender/blenlib/SConscript | 3 + source/blender/blenloader/CMakeLists.txt | 4 ++ source/blender/blenloader/SConscript | 3 + source/blender/blenloader/intern/readfile.c | 63 +++++++++++++++------ source/blender/blenloader/intern/writefile.c | 29 +++++++--- source/blender/bmesh/CMakeLists.txt | 4 ++ source/blender/bmesh/SConscript | 3 + source/blender/bmesh/bmesh_class.h | 2 + source/blender/bmesh/intern/bmesh_construct.c | 14 +++++ source/blender/bmesh/intern/bmesh_operators.h | 4 ++ source/blender/bmesh/operators/bmo_similar.c | 4 ++ source/blender/editors/animation/CMakeLists.txt | 4 ++ source/blender/editors/animation/SConscript | 3 + .../editors/animation/anim_channels_defines.c | 8 ++- .../blender/editors/animation/anim_channels_edit.c | 10 ++++ source/blender/editors/animation/anim_filter.c | 10 +++- source/blender/editors/include/ED_anim_api.h | 6 +- source/blender/editors/include/UI_resources.h | 2 + source/blender/editors/interface/CMakeLists.txt | 4 ++ source/blender/editors/interface/SConscript | 3 + .../editors/interface/interface_templates.c | 13 ++++- source/blender/editors/interface/resources.c | 6 ++ source/blender/editors/mesh/CMakeLists.txt | 4 ++ source/blender/editors/mesh/SConscript | 3 + source/blender/editors/mesh/editmesh_select.c | 14 +++++ source/blender/editors/mesh/editmesh_tools.c | 2 + source/blender/editors/mesh/mesh_intern.h | 4 ++ source/blender/editors/mesh/mesh_ops.c | 4 ++ source/blender/editors/render/CMakeLists.txt | 8 ++- source/blender/editors/render/SConscript | 5 +- source/blender/editors/render/render_intern.h | 3 + source/blender/editors/render/render_ops.c | 2 + source/blender/editors/render/render_shading.c | 8 ++- .../blender/editors/space_buttons/CMakeLists.txt | 4 ++ source/blender/editors/space_buttons/SConscript | 3 + .../blender/editors/space_buttons/space_buttons.c | 2 + source/blender/editors/space_file/CMakeLists.txt | 4 ++ source/blender/editors/space_file/SConscript | 3 + source/blender/editors/space_file/filelist.c | 6 ++ source/blender/editors/space_nla/CMakeLists.txt | 4 ++ source/blender/editors/space_nla/SConscript | 3 + source/blender/editors/space_nla/nla_buttons.c | 2 + source/blender/editors/space_nla/nla_channels.c | 2 + source/blender/editors/space_view3d/CMakeLists.txt | 4 ++ source/blender/editors/space_view3d/SConscript | 3 + source/blender/editors/space_view3d/drawobject.c | 64 +++++++++++++++++----- source/blender/freestyle/CMakeLists.txt | 2 + source/blender/freestyle/SConscript | 2 +- source/blender/makesdna/CMakeLists.txt | 4 ++ source/blender/makesdna/DNA_ID.h | 4 +- source/blender/makesdna/DNA_action_types.h | 2 + source/blender/makesdna/DNA_material_types.h | 2 + source/blender/makesdna/DNA_mesh_types.h | 2 + source/blender/makesdna/DNA_meshdata_types.h | 4 ++ source/blender/makesdna/DNA_scene_types.h | 12 ++++ source/blender/makesdna/DNA_userdef_types.h | 2 + source/blender/makesdna/SConscript | 6 +- source/blender/makesdna/intern/CMakeLists.txt | 3 + source/blender/makesdna/intern/SConscript | 3 + source/blender/makesdna/intern/makesdna.c | 4 ++ source/blender/makesrna/RNA_access.h | 4 ++ source/blender/makesrna/RNA_enum_types.h | 2 + source/blender/makesrna/SConscript | 6 +- source/blender/makesrna/intern/CMakeLists.txt | 15 ++++- source/blender/makesrna/intern/SConscript | 6 ++ source/blender/makesrna/intern/makesrna.c | 2 + source/blender/makesrna/intern/rna_ID.c | 6 ++ source/blender/makesrna/intern/rna_action.c | 2 + source/blender/makesrna/intern/rna_color.c | 10 +++- source/blender/makesrna/intern/rna_internal.h | 4 ++ source/blender/makesrna/intern/rna_main.c | 4 ++ source/blender/makesrna/intern/rna_main_api.c | 10 +++- source/blender/makesrna/intern/rna_mesh.c | 8 +++ source/blender/makesrna/intern/rna_scene.c | 24 +++++++- source/blender/makesrna/intern/rna_userdef.c | 4 ++ source/blender/python/SConscript | 5 +- source/blender/python/bmesh/bmesh_py_types.c | 8 +++ source/blender/python/intern/CMakeLists.txt | 8 ++- source/blender/python/intern/bpy.c | 6 +- .../blender/python/intern/bpy_app_build_options.c | 4 ++ source/blender/render/CMakeLists.txt | 8 ++- source/blender/render/SConscript | 5 +- source/blender/render/extern/include/RE_pipeline.h | 2 + .../blender/render/intern/include/render_types.h | 16 ++++-- .../blender/render/intern/source/convertblender.c | 56 +++++++++++++------ source/blender/render/intern/source/pipeline.c | 23 ++++++-- .../blender/render/intern/source/render_result.c | 6 +- source/blender/render/intern/source/shadeoutput.c | 2 + source/blender/windowmanager/CMakeLists.txt | 8 ++- source/blender/windowmanager/SConscript | 5 +- source/blender/windowmanager/WM_types.h | 4 +- source/blender/windowmanager/intern/wm_files.c | 6 +- .../bad_level_call_stubs/CMakeLists.txt | 4 ++ .../blenderplayer/bad_level_call_stubs/SConscript | 3 + source/blenderplayer/bad_level_call_stubs/stubs.c | 6 ++ source/creator/CMakeLists.txt | 15 ++++- source/creator/creator.c | 6 +- 116 files changed, 762 insertions(+), 116 deletions(-) (limited to 'source') diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index bd359a47b40..e89ec2b255a 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -51,7 +51,6 @@ 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 @@ -106,7 +105,6 @@ add_subdirectory(nodes) add_subdirectory(modifiers) add_subdirectory(makesdna) add_subdirectory(makesrna) -add_subdirectory(freestyle) if(WITH_COMPOSITOR) add_subdirectory(opencl) # later on this may be used more generally @@ -140,3 +138,11 @@ endif() if(WITH_OPENCOLLADA) add_subdirectory(collada) endif() + +if(WITH_FREESTYLE) + list(APPEND SRC_DNA_INC + ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_linestyle_types.h + ) + add_subdirectory(freestyle) +endif() + diff --git a/source/blender/SConscript b/source/blender/SConscript index ff1d6b5de0a..5675575e245 100644 --- a/source/blender/SConscript +++ b/source/blender/SConscript @@ -35,7 +35,6 @@ SConscript(['avi/SConscript', 'blenloader/SConscript', 'gpu/SConscript', 'editors/SConscript', - 'freestyle/SConscript', 'imbuf/SConscript', 'makesdna/SConscript', 'render/SConscript', @@ -68,3 +67,6 @@ if env['WITH_BF_COLLADA']: if env['WITH_BF_COMPOSITOR']: SConscript (['compositor/SConscript', 'opencl/SConscript']) + +if env['WITH_BF_FREESTYLE']: + SConscript (['freestyle/SConscript']) diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h index eb3518ac997..9a2789d36cc 100644 --- a/source/blender/blenfont/BLF_translation.h +++ b/source/blender/blenfont/BLF_translation.h @@ -115,7 +115,9 @@ 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" -#define BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE "FreestyleLineStyle" +#ifdef WITH_FREESTYLE +# define BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE "FreestyleLineStyle" +#endif #define BLF_I18NCONTEXT_ID_GPENCIL "GPencil" #define BLF_I18NCONTEXT_ID_GROUP "Group" #define BLF_I18NCONTEXT_ID_ID "ID" diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index 90baef14a74..a3afd853cba 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -58,6 +58,10 @@ 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}") diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript index a6ea724a51f..354a030775e 100644 --- a/source/blender/blenfont/SConscript +++ b/source/blender/blenfont/SConscript @@ -43,4 +43,7 @@ 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), Split(defs), libtype=['core','player'], priority=[210,210] ) diff --git a/source/blender/blenkernel/BKE_linestyle.h b/source/blender/blenkernel/BKE_linestyle.h index 3cbf3454f0b..e077cd998c9 100644 --- a/source/blender/blenkernel/BKE_linestyle.h +++ b/source/blender/blenkernel/BKE_linestyle.h @@ -27,11 +27,14 @@ #ifndef __BKE_LINESTYLE_H__ #define __BKE_LINESTYLE_H__ + /** \file BKE_linestyle.h * \ingroup bke * \brief Blender kernel freestyle line style functionality. */ +#ifdef WITH_FREESTYLE + #include "DNA_linestyle_types.h" #define LS_MODIFIER_TYPE_COLOR 1 @@ -71,4 +74,6 @@ char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *c void FRS_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob); -#endif +#endif /* WITH_FREESTYLE */ + +#endif /* __BKE_LINESTYLE_H__ */ diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index cb8f1a7d682..ec465502ca0 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -88,7 +88,9 @@ typedef struct Main { ListBase gpencil; ListBase movieclip; ListBase mask; +#ifdef WITH_FREESTYLE ListBase linestyle; +#endif char id_tag_update[256]; } Main; diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 70a3f927b23..7a11bdb1f39 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -28,7 +28,6 @@ set(INC ../blenfont ../blenlib ../blenloader - ../freestyle ../gpu ../ikplugin ../imbuf @@ -103,7 +102,6 @@ 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 @@ -198,7 +196,6 @@ set(SRC BKE_lamp.h BKE_lattice.h BKE_library.h - BKE_linestyle.h BKE_main.h BKE_mask.h BKE_material.h @@ -418,6 +415,17 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + list(APPEND SRC + intern/linestyle.c + BKE_linestyle.h + ) + list(APPEND INC + ../freestyle + ) + add_definitions(-DWITH_FREESTYLE) +endif() + ## Warnings as errors, this is too strict! #if(MSVC) # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index ccb21b209ea..2998da824ef 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -39,7 +39,7 @@ incs = '. #/intern/guardedalloc #/intern/memutil' incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager' incs += ' ../render/extern/include ../makesrna' incs += ' ../imbuf ../ikplugin ../avi #/intern/elbeem/extern ../nodes ../modifiers' -incs += ' #/intern/iksolver/extern ../blenloader ../freestyle' +incs += ' #/intern/iksolver/extern ../blenloader' incs += ' #/extern/bullet2/src' incs += ' #/intern/opennl/extern #/intern/bsp/extern' incs += ' ../gpu #/extern/glew/include' @@ -147,6 +147,12 @@ if env['WITH_BF_FFTW3']: if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_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'] diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 838cf3b8542..aecf6e5e437 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -86,7 +86,9 @@ 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: @@ -828,9 +830,11 @@ 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) @@ -916,8 +920,10 @@ 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); @@ -2404,8 +2410,10 @@ 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 diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index 24b13b062f3..e10a078c2f7 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -70,6 +70,9 @@ #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 "BLI_blenlib.h" #include "BLI_utildefines.h" @@ -575,6 +578,18 @@ 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; + + for(; srl; srl = srl->next) { + FreestyleModuleConfig* module = srl->freestyleConfig.modules.first; + for (; module; module = module->next) { + rewrite_path_fixed(module->module_path, visit_cb, absbase, bpath_user_data); + } + } + } +#endif break; } case ID_ME: diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index d3545cd2720..fda7dfb046e 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -79,7 +79,6 @@ 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) { @@ -105,10 +104,15 @@ void BKE_group_unlink(Group *group) if (srl->light_override == group) srl->light_override = NULL; - for(lineset= srl->freestyleConfig.linesets.first; lineset; lineset= lineset->next) { - if (lineset->group == group) - lineset->group= NULL; +#ifdef WITH_FREESTYLE + { + FreestyleLineSet *lineset; + for(lineset = srl->freestyleConfig.linesets.first; lineset; lineset= lineset->next) { + if (lineset->group == group) + lineset->group = NULL; + } } +#endif } } diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index 75c22d06042..8fab0f2d4df 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -62,7 +62,9 @@ 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 }, diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index d21a12b9e6a..2192d2862c8 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -109,7 +109,9 @@ #include "BKE_speaker.h" #include "BKE_movieclip.h" #include "BKE_mask.h" -#include "BKE_linestyle.h" +#ifdef WITH_FREESTYLE +# include "BKE_linestyle.h" +#endif #include "RNA_access.h" @@ -277,8 +279,10 @@ int id_make_local(ID *id, int test) return 0; /* can't be linked */ case ID_GD: return 0; /* not implemented */ +#ifdef WITH_FREESTYLE case ID_LS: return 0; /* not implemented */ +#endif } return 0; @@ -373,9 +377,11 @@ int id_copy(ID *id, ID **newid, int test) case ID_MSK: if (!test) *newid = (ID *)BKE_mask_copy((Mask *)id); return 1; +#ifdef WITH_FREESTYLE case ID_LS: if(!test) *newid= (ID*)FRS_copy_linestyle((FreestyleLineStyle*)id); return 1; +#endif } return 0; @@ -506,8 +512,10 @@ 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; } @@ -592,7 +600,9 @@ 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; @@ -707,9 +717,11 @@ 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; } @@ -934,9 +946,11 @@ 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); break; +#endif } BLI_remlink(lb, id); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 3bfd4f4f760..54bd03ece70 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -153,7 +153,9 @@ 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; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index bf4e32ef122..f0819d426fb 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -115,7 +115,9 @@ #include "GPU_material.h" -#include "FRS_freestyle.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!) */ @@ -635,6 +637,7 @@ void BKE_object_unlink(Object *ob) SEQ_END } +#ifdef WITH_FREESTYLE { SceneRenderLayer *srl; @@ -642,6 +645,7 @@ void BKE_object_unlink(Object *ob) FRS_unlink_target_object(&srl->freestyleConfig, ob); } } +#endif } sce = sce->id.next; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 5e6d7647d1d..1c98f6c32a2 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -85,7 +85,9 @@ //XXX #include "BIF_previewrender.h" //XXX #include "BIF_editseq.h" -#include "FRS_freestyle_config.h" +#ifdef WITH_FREESTYLE +# include "FRS_freestyle_config.h" +#endif #ifdef WIN32 #else @@ -288,7 +290,6 @@ Scene *BKE_scene_copy(Scene *sce, int type) void BKE_scene_free(Scene *sce) { Base *base; - SceneRenderLayer *srl; base = sce->base.first; while (base) { @@ -329,9 +330,15 @@ void BKE_scene_free(Scene *sce) sce->r.ffcodecdata.properties = NULL; } - for(srl= sce->r.layers.first; srl; srl= srl->next) { - FRS_free_freestyle_config(srl); +#ifdef WITH_FREESTYLE + { + SceneRenderLayer *srl; + + for (srl = sce->r.layers.first; srl; srl = srl->next) { + FRS_free_freestyle_config(srl); + } } +#endif BLI_freelistN(&sce->markers); BLI_freelistN(&sce->transform_spaces); @@ -1190,7 +1197,9 @@ 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; - FRS_add_freestyle_config( srl ); +#ifdef WITH_FREESTYLE + FRS_add_freestyle_config(srl); +#endif return srl; } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 7c58c7b21ed..37c9c1dd84e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -964,7 +964,11 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med) edgeFlag = (ccgdm->edgeFlags) ? &ccgdm->edgeFlags[i] : NULL; if (edgeFlag) +#ifdef WITH_FREESTYLE flags |= (*edgeFlag & (ME_SEAM | ME_SHARP | ME_FREESTYLE_EDGE)) | ME_EDGEDRAW | ME_EDGERENDER; +#else + flags |= (*edgeFlag & (ME_SEAM | ME_SHARP)) | ME_EDGEDRAW | ME_EDGERENDER; +#endif else flags |= ME_EDGEDRAW | ME_EDGERENDER; @@ -1228,7 +1232,11 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) if (edgeFlags) { if (edgeIdx != -1) { +#ifdef WITH_FREESTYLE flags |= ((edgeFlags[index] & (ME_SEAM | ME_SHARP | ME_FREESTYLE_EDGE)) | ME_EDGEDRAW | ME_EDGERENDER); +#else + flags |= ((edgeFlags[index] & (ME_SEAM | ME_SHARP)) | ME_EDGEDRAW | ME_EDGERENDER); +#endif } } else { diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index 6644c58611f..fe954fb10ac 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -162,6 +162,10 @@ if(WITH_OPENMP) add_definitions(-DPARALLEL=1) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WIN32) list(APPEND INC ../../../intern/utfconv diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index 2be06f7311d..19216442aa0 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -37,6 +37,9 @@ 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' diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt index 3c5812fa513..894cd24fc4a 100644 --- a/source/blender/blenloader/CMakeLists.txt +++ b/source/blender/blenloader/CMakeLists.txt @@ -67,4 +67,8 @@ 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}") diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript index 8950c4f7702..f85ae8c112b 100644 --- a/source/blender/blenloader/SConscript +++ b/source/blender/blenloader/SConscript @@ -40,6 +40,9 @@ 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: diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5c044a0a3bd..453f35d8057 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -70,7 +70,9 @@ #include "DNA_key_types.h" #include "DNA_lattice_types.h" #include "DNA_lamp_types.h" -#include "DNA_linestyle_types.h" +#ifdef WITH_FREESTYLE +# include "DNA_linestyle_types.h" +#endif #include "DNA_meta_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" @@ -4788,7 +4790,6 @@ static void lib_link_scene(FileData *fd, Main *main) Base *base, *next; Sequence *seq; SceneRenderLayer *srl; - FreestyleLineSet *fls; TimeMarker *marker; for (sce = main->scene.first; sce; sce = sce->id.next) { @@ -4892,10 +4893,16 @@ 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); - 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); +#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); + } } +#endif } /*Game Settings: Dome Warp Text*/ sce->gm.dome.warptext = newlibadr(fd, sce->id.lib, sce->gm.dome.warptext); @@ -4964,7 +4971,6 @@ static void direct_link_scene(FileData *fd, Scene *sce) Editing *ed; Sequence *seq; MetaStack *ms; - SceneRenderLayer *srl; sce->theDag = NULL; sce->dagisvalid = 0; @@ -5134,12 +5140,18 @@ static void direct_link_scene(FileData *fd, Scene *sce) link_list(fd, &(sce->transform_spaces)); link_list(fd, &(sce->r.layers)); - 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)); +#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)); + } } +#endif sce->nodetree = newdataadr(fd, sce->nodetree); if (sce->nodetree) { @@ -6393,6 +6405,7 @@ static void lib_link_mask(FileData *fd, Main *main) } } +#ifdef WITH_FREESTYLE /* ************ READ LINE STYLE ***************** */ static void lib_link_linestyle(FileData *fd, Main *main) @@ -6565,6 +6578,7 @@ 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 ******************** */ @@ -6600,7 +6614,9 @@ 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"; @@ -6777,9 +6793,11 @@ 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); @@ -8620,6 +8638,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } +#ifdef WITH_FREESTYLE /* default values in Freestyle settings */ { Scene *sce; @@ -8652,6 +8671,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) linestyle->rounds = 3; } } +#endif /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ @@ -8702,7 +8722,9 @@ 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 */ @@ -9618,7 +9640,6 @@ 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); @@ -9640,11 +9661,17 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) expand_doit(fd, mainvar, srl->mat_override); expand_doit(fd, mainvar, srl->light_override); - 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); +#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); + } } +#endif } if (sce->r.dometext) @@ -9738,6 +9765,7 @@ 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; @@ -9757,6 +9785,7 @@ 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 *)) { @@ -9848,9 +9877,11 @@ 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; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 8208cca981e..3f80674bf60 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -108,7 +108,9 @@ #include "DNA_key_types.h" #include "DNA_lattice_types.h" #include "DNA_lamp_types.h" -#include "DNA_linestyle_types.h" +#ifdef WITH_FREESTYLE +# include "DNA_linestyle_types.h" +#endif #include "DNA_meta_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -2160,8 +2162,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase) TimeMarker *marker; TransformOrientation *ts; SceneRenderLayer *srl; - FreestyleModuleConfig *fmc; - FreestyleLineSet *fls; ToolSettings *tos; sce= scebase->first; @@ -2289,14 +2289,21 @@ static void write_scenes(WriteData *wd, ListBase *scebase) for (srl = sce->r.layers.first; srl; srl = srl->next) { writestruct(wd, DATA, "SceneRenderLayer", 1, srl); - for(fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { - writestruct(wd, DATA, "FreestyleModuleConfig", 1, fmc); - } +#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(fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) { + writestruct(wd, DATA, "FreestyleLineSet", 1, fls); + } + } +#endif } if (sce->nodetree) { @@ -2876,6 +2883,7 @@ 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; @@ -3076,6 +3084,7 @@ 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 @@ -3183,7 +3192,9 @@ 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) { diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt index c41b0703240..f80dbc45926 100644 --- a/source/blender/bmesh/CMakeLists.txt +++ b/source/blender/bmesh/CMakeLists.txt @@ -130,4 +130,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_add_lib(bf_bmesh "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/bmesh/SConscript b/source/blender/bmesh/SConscript index 722b7518630..ee2380084ca 100644 --- a/source/blender/bmesh/SConscript +++ b/source/blender/bmesh/SConscript @@ -51,4 +51,7 @@ if env['WITH_BF_BULLET']: if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + env.BlenderLib ( libname = 'bf_bmesh', sources = sources, includes = Split(incs), libtype = ['core','player'], defines=defs, priority=[100, 100], compileflags=cflags ) diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index a2613f46bf8..5af9690b47e 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -246,7 +246,9 @@ enum { /* spare tag, assumed dirty, use define in each function to name based on use */ // _BM_ELEM_TAG_ALT = (1 << 6), // UNUSED +#ifdef WITH_FREESTYLE BM_ELEM_FREESTYLE = (1 << 6), /* used for Freestyle faces and edges */ +#endif BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging, * since tools may want to tag verts and diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 229a7caebfd..d23443daa7f 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -981,7 +981,11 @@ char BM_edge_flag_from_mflag(const short meflag) ((meflag & ME_EDGEDRAW) ? BM_ELEM_DRAW : 0) | ((meflag & ME_SHARP) == 0 ? BM_ELEM_SMOOTH : 0) | /* invert */ ((meflag & ME_HIDE) ? BM_ELEM_HIDDEN : 0) | +#ifdef WITH_FREESTYLE ((meflag & ME_FREESTYLE_EDGE) ? BM_ELEM_FREESTYLE : 0) +#else + 0 +#endif ); } char BM_face_flag_from_mflag(const char meflag) @@ -989,7 +993,11 @@ char BM_face_flag_from_mflag(const char meflag) return ( ((meflag & ME_FACE_SEL) ? BM_ELEM_SELECT : 0) | ((meflag & ME_SMOOTH) ? BM_ELEM_SMOOTH : 0) | ((meflag & ME_HIDE) ? BM_ELEM_HIDDEN : 0) | +#ifdef WITH_FREESTYLE ((meflag & ME_FREESTYLE_FACE) ? BM_ELEM_FREESTYLE : 0) +#else + 0 +#endif ); } @@ -1012,7 +1020,9 @@ short BM_edge_flag_to_mflag(BMEdge *eed) ((hflag & BM_ELEM_DRAW) ? ME_EDGEDRAW : 0) | ((hflag & BM_ELEM_SMOOTH) == 0 ? ME_SHARP : 0) | ((hflag & BM_ELEM_HIDDEN) ? ME_HIDE : 0) | +#ifdef WITH_FREESTYLE ((hflag & BM_ELEM_FREESTYLE) ? ME_FREESTYLE_EDGE : 0) | +#endif ((BM_edge_is_wire(eed)) ? ME_LOOSEEDGE : 0) | /* not typical */ ME_EDGERENDER ); @@ -1024,6 +1034,10 @@ char BM_face_flag_to_mflag(BMFace *efa) return ( ((hflag & BM_ELEM_SELECT) ? ME_FACE_SEL : 0) | ((hflag & BM_ELEM_SMOOTH) ? ME_SMOOTH : 0) | ((hflag & BM_ELEM_HIDDEN) ? ME_HIDE : 0) | +#ifdef WITH_FREESTYLE ((hflag & BM_ELEM_FREESTYLE) ? ME_FREESTYLE_FACE : 0) +#else + 0 +#endif ); } diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index c98c3eae50b..16b38c340ff 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -61,7 +61,9 @@ enum { SIMFACE_PERIMETER, SIMFACE_NORMAL, SIMFACE_COPLANAR, +#ifdef WITH_FREESTYLE SIMFACE_FREESTYLE +#endif }; /* similar edge selection slot values */ @@ -74,7 +76,9 @@ enum { SIMEDGE_BEVEL, SIMEDGE_SEAM, SIMEDGE_SHARP, +#ifdef WITH_FREESTYLE SIMEDGE_FREESTYLE +#endif }; /* similar vertex selection slot values */ diff --git a/source/blender/bmesh/operators/bmo_similar.c b/source/blender/bmesh/operators/bmo_similar.c index 78b6ebb4bd7..a8cc152bd4e 100644 --- a/source/blender/bmesh/operators/bmo_similar.c +++ b/source/blender/bmesh/operators/bmo_similar.c @@ -245,12 +245,14 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) cont = FALSE; } break; +#ifdef WITH_FREESTYLE case SIMFACE_FREESTYLE: if (BM_elem_flag_test(fm, BM_ELEM_FREESTYLE) == BM_elem_flag_test(fs, BM_ELEM_FREESTYLE)) { BMO_elem_flag_enable(bm, fm, FACE_MARK); cont = FALSE; } break; +#endif default: BLI_assert(0); } @@ -469,12 +471,14 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) cont = FALSE; } break; +#ifdef WITH_FREESTYLE case SIMEDGE_FREESTYLE: if (BM_elem_flag_test(e, BM_ELEM_FREESTYLE) == BM_elem_flag_test(es, BM_ELEM_FREESTYLE)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); cont = FALSE; } break; +#endif default: BLI_assert(0); } diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt index 9e1e44e411d..58e38e55fa3 100644 --- a/source/blender/editors/animation/CMakeLists.txt +++ b/source/blender/editors/animation/CMakeLists.txt @@ -58,4 +58,8 @@ 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}") diff --git a/source/blender/editors/animation/SConscript b/source/blender/editors/animation/SConscript index 2a6b381ba66..a4ccf1f6c3c 100644 --- a/source/blender/editors/animation/SConscript +++ b/source/blender/editors/animation/SConscript @@ -37,4 +37,7 @@ 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] ) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 038fbf291d3..7362935b4cc 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -47,7 +47,9 @@ #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" -#include "DNA_linestyle_types.h" +#ifdef WITH_FREESTYLE +# include "DNA_linestyle_types.h" +#endif #include "DNA_mesh_types.h" #include "DNA_material_types.h" #include "DNA_meta_types.h" @@ -2011,6 +2013,7 @@ static bAnimChannelType ACF_DSNTREE = acf_dsntree_setting_ptr /* pointer for setting */ }; +#ifdef WITH_FREESTYLE /* LineStyle Expander ------------------------------------------- */ /* TODO: just get this from RNA? */ @@ -2087,6 +2090,7 @@ static bAnimChannelType ACF_DSLINESTYLE= acf_dslinestyle_setting_flag, /* flag for setting */ acf_dslinestyle_setting_ptr /* pointer for setting */ }; +#endif /* Mesh Expander ------------------------------------------- */ @@ -2800,7 +2804,9 @@ 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 */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 466bb178136..275cf723dcd 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -124,7 +124,9 @@ 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 */ @@ -170,7 +172,9 @@ 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 */ @@ -251,7 +255,9 @@ 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)) @@ -346,7 +352,9 @@ 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 */ @@ -2211,7 +2219,9 @@ 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... */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 86cb805c68a..23d35c80409 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -55,7 +55,9 @@ #include "DNA_camera_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" -#include "DNA_linestyle_types.h" +#ifdef WITH_FREESTYLE +# include "DNA_linestyle_types.h" +#endif #include "DNA_key_types.h" #include "DNA_mask_types.h" #include "DNA_material_types.h" @@ -737,6 +739,7 @@ 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,6 +753,7 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne ale->adt = BKE_animdata_from_id(data); } break; +#endif case ANIMTYPE_DSPART: { ParticleSettings *part = (ParticleSettings *)ale->data; @@ -1527,6 +1531,7 @@ 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; @@ -1574,6 +1579,7 @@ 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) @@ -2209,10 +2215,12 @@ 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 */ } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index e288963553e..7ce25b11f93 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -155,7 +155,9 @@ typedef enum eAnim_ChannelType { ANIMTYPE_DSMESH, ANIMTYPE_DSTEX, ANIMTYPE_DSLAT, +#ifdef WITH_FREESTYLE ANIMTYPE_DSLINESTYLE, +#endif ANIMTYPE_DSSPK, ANIMTYPE_SHAPEKEY, @@ -237,7 +239,9 @@ 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)) -#define FILTER_LS_SCED(linestyle) ((linestyle->flag & LS_DS_EXPAND)) +#ifdef WITH_FREESTYLE +# define FILTER_LS_SCED(linestyle) ((linestyle->flag & LS_DS_EXPAND)) +#endif /* '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)) diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index a43e1705101..bbc9ca3502d 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -200,8 +200,10 @@ 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 */ diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 8ba86673f87..267e7c05737 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -62,6 +62,10 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WITH_HEADLESS) add_definitions(-DWITH_HEADLESS) endif() diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript index 8d277d6cd35..16e4e6cb9c0 100644 --- a/source/blender/editors/interface/SConscript +++ b/source/blender/editors/interface/SConscript @@ -42,6 +42,9 @@ 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') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 456a8a95a58..33f647d1db6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -325,7 +325,9 @@ 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"); @@ -361,7 +363,9 @@ 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; @@ -518,7 +522,10 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str BLF_I18NCONTEXT_ID_BRUSH, BLF_I18NCONTEXT_ID_PARTICLESETTINGS, BLF_I18NCONTEXT_ID_GPENCIL, - BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE); +#ifdef WITH_FREESTYLE + BLF_I18NCONTEXT_ID_FREESTYLELINESTYLE +#endif + ); if (newop) { but = uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, @@ -2414,8 +2421,12 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe uiBlockSetEmboss(block, UI_EMBOSS); uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, ptr, "use_textures", i, 0, 0, 0, 0, NULL); } +#ifdef WITH_FREESTYLE else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) || RNA_struct_is_a(itemptr->type, &RNA_FreestyleLineSet)) { +#else + else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) { +#endif uiItemL(sub, name, icon); uiBlockSetEmboss(block, UI_EMBOSS); uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0, NULL); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index b45d14bfa90..20d7277a94d 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -349,10 +349,12 @@ 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; @@ -732,8 +734,10 @@ 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; @@ -1979,6 +1983,7 @@ void init_userdef_do_versions(void) } } +#ifdef WITH_FREESTYLE /* Freestyle color settings */ { bTheme *btheme; @@ -1991,6 +1996,7 @@ void init_userdef_do_versions(void) } } } +#endif /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index c51d2cfb2e5..3180886b2b6 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -73,6 +73,10 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WITH_BULLET) add_definitions(-DWITH_BULLET) endif() diff --git a/source/blender/editors/mesh/SConscript b/source/blender/editors/mesh/SConscript index 11c90a4a922..55ad14a50fc 100644 --- a/source/blender/editors/mesh/SConscript +++ b/source/blender/editors/mesh/SConscript @@ -53,6 +53,9 @@ else: if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + if env['WITH_BF_BULLET']: defs.append('WITH_BULLET') diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 2538ddfc886..a46edb19662 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -683,7 +683,9 @@ static EnumPropertyItem prop_similar_types[] = { {SIMEDGE_BEVEL, "BEVEL", 0, "Bevel", ""}, {SIMEDGE_SEAM, "SEAM", 0, "Seam", ""}, {SIMEDGE_SHARP, "SHARP", 0, "Sharpness", ""}, +#ifdef WITH_FREESTYLE {SIMEDGE_FREESTYLE, "FREESTYLE_EDGE", 0, "Freestyle Edge Marks", ""}, +#endif {SIMFACE_MATERIAL, "MATERIAL", 0, "Material", ""}, {SIMFACE_IMAGE, "IMAGE", 0, "Image", ""}, @@ -692,7 +694,9 @@ static EnumPropertyItem prop_similar_types[] = { {SIMFACE_PERIMETER, "PERIMETER", 0, "Perimeter", ""}, {SIMFACE_NORMAL, "NORMAL", 0, "Normal", ""}, {SIMFACE_COPLANAR, "COPLANAR", 0, "Co-planar", ""}, +#ifdef WITH_FREESTYLE {SIMFACE_FREESTYLE, "FREESTYLE_FACE", 0, "Freestyle Face Marks", ""}, +#endif {0, NULL, 0, NULL, NULL} }; @@ -867,7 +871,11 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUS } } else if (em->selectmode & SCE_SELECT_FACE) { +#ifdef WITH_FREESTYLE for (a = SIMFACE_MATERIAL; a <= SIMFACE_FREESTYLE; a++) { +#else + for (a = SIMFACE_MATERIAL; a <= SIMFACE_COPLANAR; a++) { +#endif RNA_enum_items_add_value(&item, &totitem, prop_similar_types, a); } } @@ -1317,9 +1325,11 @@ static void edgetag_context_set(BMesh *bm, Scene *scene, BMEdge *e, int val) case EDGE_MODE_TAG_SHARP: BM_elem_flag_set(e, BM_ELEM_SMOOTH, !val); break; +#ifdef WITH_FREESTYLE case EDGE_MODE_TAG_FREESTYLE: BM_elem_flag_set(e, BM_ELEM_FREESTYLE, val); break; +#endif case EDGE_MODE_TAG_CREASE: BM_elem_float_data_set(&bm->edata, e, CD_CREASE, (val) ? 1.0f : 0.0f); break; @@ -1338,8 +1348,10 @@ static int edgetag_context_check(Scene *scene, BMesh *bm, BMEdge *e) return BM_elem_flag_test(e, BM_ELEM_SEAM); case EDGE_MODE_TAG_SHARP: return !BM_elem_flag_test(e, BM_ELEM_SMOOTH); +#ifdef WITH_FREESTYLE case EDGE_MODE_TAG_FREESTYLE: return !BM_elem_flag_test(e, BM_ELEM_FREESTYLE); +#endif case EDGE_MODE_TAG_CREASE: return BM_elem_float_data_get(&bm->edata, e, CD_CREASE) ? TRUE : FALSE; case EDGE_MODE_TAG_BEVEL: @@ -1494,9 +1506,11 @@ static int mouse_mesh_shortest_path_edge(ViewContext *vc) case EDGE_MODE_TAG_BEVEL: me->drawflag |= ME_DRAWBWEIGHTS; break; +#ifdef WITH_FREESTYLE case EDGE_MODE_TAG_FREESTYLE: me->drawflag |= ME_DRAW_FREESTYLE_EDGE; break; +#endif } EDBM_update_generic(em, FALSE, FALSE); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index df2722f1fbc..c15c1d4a4de 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5764,6 +5764,7 @@ void MESH_OT_symmetrize(struct wmOperatorType *ot) "Direction", "Which sides to copy from and to"); } +#ifdef WITH_FREESTYLE static int edbm_mark_freestyle_edge(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); @@ -5867,3 +5868,4 @@ void MESH_OT_mark_freestyle_face(wmOperatorType *ot) RNA_def_boolean(ot->srna, "clear", 0, "Clear", ""); } +#endif \ No newline at end of file diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 043679b9d8a..790a7eae487 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -131,7 +131,9 @@ void MESH_OT_select_random(struct wmOperatorType *ot); void MESH_OT_loop_multi_select(struct wmOperatorType *ot); void MESH_OT_mark_seam(struct wmOperatorType *ot); void MESH_OT_mark_sharp(struct wmOperatorType *ot); +#ifdef WITH_FREESTYLE void MESH_OT_mark_freestyle_edge(struct wmOperatorType *ot); +#endif void MESH_OT_vertices_smooth(struct wmOperatorType *ot); void MESH_OT_vertices_smooth_laplacian(struct wmOperatorType *ot); void MESH_OT_noise(struct wmOperatorType *ot); @@ -181,7 +183,9 @@ void MESH_OT_rip(struct wmOperatorType *ot); void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot); void MESH_OT_blend_from_shape(struct wmOperatorType *ot); void MESH_OT_sort_elements(struct wmOperatorType *ot); +#ifdef WITH_FREESTYLE void MESH_OT_mark_freestyle_face(struct wmOperatorType *ot); +#endif /* ******************* mesh_data.c */ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index a2ac08268e0..12b68f0e419 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -118,7 +118,9 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_faces_shade_smooth); WM_operatortype_append(MESH_OT_faces_shade_flat); WM_operatortype_append(MESH_OT_sort_elements); +#ifdef WITH_FREESTYLE WM_operatortype_append(MESH_OT_mark_freestyle_face); +#endif WM_operatortype_append(MESH_OT_delete); WM_operatortype_append(MESH_OT_edge_collapse); @@ -134,7 +136,9 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_loop_multi_select); WM_operatortype_append(MESH_OT_mark_seam); WM_operatortype_append(MESH_OT_mark_sharp); +#ifdef WITH_FREESTYLE WM_operatortype_append(MESH_OT_mark_freestyle_edge); +#endif WM_operatortype_append(MESH_OT_vertices_smooth); WM_operatortype_append(MESH_OT_vertices_smooth_laplacian); WM_operatortype_append(MESH_OT_noise); diff --git a/source/blender/editors/render/CMakeLists.txt b/source/blender/editors/render/CMakeLists.txt index c9be7d0e5e0..b858d715cfe 100644 --- a/source/blender/editors/render/CMakeLists.txt +++ b/source/blender/editors/render/CMakeLists.txt @@ -36,7 +36,6 @@ set(INC set(INC_SYS ${GLEW_INCLUDE_PATH} - ../../freestyle ) set(SRC @@ -69,4 +68,11 @@ if(WITH_HEADLESS) add_definitions(-DWITH_HEADLESS) endif() +if(WITH_FREESTYLE) + list(APPEND INC + ../../freestyle + ) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_add_lib(bf_editor_render "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/render/SConscript b/source/blender/editors/render/SConscript index 15bcb9a907f..9d1de2fc700 100644 --- a/source/blender/editors/render/SConscript +++ b/source/blender/editors/render/SConscript @@ -31,7 +31,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../gpu ../../freestyle' +incs += ' ../../gpu' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' incs += ' ../../blenloader ../../bmesh' @@ -42,6 +42,9 @@ if env['OURPLATFORM'] == 'linux': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] +if env['WITH_BF_FREESTYLE']: + incs += ' ../../freestyle' + env.Append(CFLAGS=['-DWITH_FREESTYLE']) if env['WITH_BF_QUICKTIME']: incs += ' ../../quicktime' diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h index 40d0c9536f4..88c00601933 100644 --- a/source/blender/editors/render/render_intern.h +++ b/source/blender/editors/render/render_intern.h @@ -53,6 +53,8 @@ void MATERIAL_OT_paste(struct wmOperatorType *ot); void SCENE_OT_render_layer_add(struct wmOperatorType *ot); void SCENE_OT_render_layer_remove(struct wmOperatorType *ot); + +#ifdef WITH_FREESTYLE void SCENE_OT_freestyle_module_add(struct wmOperatorType *ot); void SCENE_OT_freestyle_module_remove(struct wmOperatorType *ot); void SCENE_OT_freestyle_module_move(struct wmOperatorType *ot); @@ -69,6 +71,7 @@ void SCENE_OT_freestyle_geometry_modifier_add(struct wmOperatorType *ot); void SCENE_OT_freestyle_modifier_remove(struct wmOperatorType *ot); void SCENE_OT_freestyle_modifier_move(struct wmOperatorType *ot); void SCENE_OT_freestyle_modifier_copy(struct wmOperatorType *ot); +#endif void TEXTURE_OT_slot_copy(struct wmOperatorType *ot); diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c index eb9a4cb30e4..ebd2cc941d0 100644 --- a/source/blender/editors/render/render_ops.c +++ b/source/blender/editors/render/render_ops.c @@ -62,6 +62,7 @@ void ED_operatortypes_render(void) WM_operatortype_append(SCENE_OT_render_layer_add); WM_operatortype_append(SCENE_OT_render_layer_remove); +#ifdef WITH_FREESTYLE WM_operatortype_append(SCENE_OT_freestyle_module_add); WM_operatortype_append(SCENE_OT_freestyle_module_remove); WM_operatortype_append(SCENE_OT_freestyle_module_move); @@ -78,6 +79,7 @@ void ED_operatortypes_render(void) WM_operatortype_append(SCENE_OT_freestyle_modifier_remove); WM_operatortype_append(SCENE_OT_freestyle_modifier_move); WM_operatortype_append(SCENE_OT_freestyle_modifier_copy); +#endif #if (defined(WITH_QUICKTIME) && !defined(USE_QTKIT)) WM_operatortype_append(SCENE_OT_render_data_set_quicktime_codec); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 928930c61f9..bc33936b2e3 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -55,7 +55,6 @@ #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 +69,10 @@ #include "GPU_material.h" -#include "FRS_freestyle.h" +#ifdef WITH_FREESTYLE +# include "BKE_linestyle.h" +# include "FRS_freestyle.h" +#endif #include "RNA_access.h" #include "RNA_enum_types.h" @@ -574,6 +576,7 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } +#ifdef WITH_FREESTYLE static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); @@ -1187,6 +1190,7 @@ 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 static int texture_slot_move(bContext *C, wmOperator *op) { diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt index 7233d4623d1..10080c62594 100644 --- a/source/blender/editors/space_buttons/CMakeLists.txt +++ b/source/blender/editors/space_buttons/CMakeLists.txt @@ -48,4 +48,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_add_lib(bf_editor_space_buttons "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript index 5250a1264a4..1f7939598c8 100644 --- a/source/blender/editors/space_buttons/SConscript +++ b/source/blender/editors/space_buttons/SConscript @@ -38,4 +38,7 @@ defs = [] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + env.BlenderLib ( 'bf_editors_space_buttons', sources, Split(incs), defs, libtype=['core'], priority=[120] ) diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 698139e90bf..6367ca893d1 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -378,10 +378,12 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_redraw(sa); sbuts->preview = 1; break; +#ifdef WITH_FREESTYLE case NC_LINESTYLE: ED_area_tag_redraw(sa); sbuts->preview = 1; break; +#endif } if (wmn->data == ND_KEYS) diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt index 98e147413ff..b30f008e1bf 100644 --- a/source/blender/editors/space_file/CMakeLists.txt +++ b/source/blender/editors/space_file/CMakeLists.txt @@ -82,4 +82,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_add_lib(bf_editor_space_file "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_file/SConscript b/source/blender/editors/space_file/SConscript index c3f8c6667f7..6459f880bc4 100644 --- a/source/blender/editors/space_file/SConscript +++ b/source/blender/editors/space_file/SConscript @@ -48,6 +48,9 @@ if env['WITH_BF_TIFF']: if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 5b21ebf1742..142eb2214a1 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1162,7 +1162,11 @@ void filelist_from_main(struct FileList *filelist) if (filelist->dir[0] == 0) { /* make directories */ +#ifdef WITH_FREESTYLE filelist->numfiles = 25; +#else + filelist->numfiles = 24; +#endif filelist->filelist = (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry)); for (a = 0; a < filelist->numfiles; a++) { @@ -1193,7 +1197,9 @@ void filelist_from_main(struct FileList *filelist) filelist->filelist[21].relname = BLI_strdup("Action"); filelist->filelist[22].relname = BLI_strdup("NodeTree"); filelist->filelist[23].relname = BLI_strdup("Speaker"); +#ifdef WITH_FREESTYLE filelist->filelist[24].relname = BLI_strdup("FreestyleLineStyle"); +#endif filelist_sort(filelist, FILE_SORT_ALPHA); } else { diff --git a/source/blender/editors/space_nla/CMakeLists.txt b/source/blender/editors/space_nla/CMakeLists.txt index aa3598e8e1f..32fb3850cee 100644 --- a/source/blender/editors/space_nla/CMakeLists.txt +++ b/source/blender/editors/space_nla/CMakeLists.txt @@ -50,4 +50,8 @@ 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}") diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript index 18c6392eee9..2316f37e661 100644 --- a/source/blender/editors/space_nla/SConscript +++ b/source/blender/editors/space_nla/SConscript @@ -37,4 +37,7 @@ 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] ) diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index ad6e66f7a7d..e2eb1f030b3 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -142,7 +142,9 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: +#ifdef WITH_FREESTYLE case ANIMTYPE_DSLINESTYLE: +#endif case ANIMTYPE_DSSPK: { /* for these channels, we only do AnimData */ diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index cf56f254c36..97581cefc2b 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -178,7 +178,9 @@ 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... */ diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt index 35dd88c3209..462619a7e8b 100644 --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@ -75,4 +75,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_add_lib(bf_editor_space_view3d "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript index 578f06ada16..b775c5bba59 100644 --- a/source/blender/editors/space_view3d/SConscript +++ b/source/blender/editors/space_view3d/SConscript @@ -45,4 +45,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', ' if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), defines = defs, libtype=['core'], priority=[40] ) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index fd1eb7852c1..1f071e5f20e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -126,7 +126,11 @@ typedef struct drawDMEdgesSel_userData { } drawDMEdgesSel_userData; typedef struct drawDMFacesSel_userData { +#ifdef WITH_FREESTYLE unsigned char *cols[4]; +#else + unsigned char *cols[3]; +#endif DerivedMesh *dm; /* BMESH BRANCH ONLY */ BMEditMesh *em; /* BMESH BRANCH ONLY */ @@ -2280,6 +2284,7 @@ static void draw_dm_edges_sharp(BMEditMesh *em, DerivedMesh *dm) dm->drawMappedEdges(dm, draw_dm_edges_sharp__setDrawOptions, em); } +#ifdef WITH_FREESTYLE /* Draw only Freestyle feature edges */ static DMDrawOption draw_dm_edges_freestyle__setDrawOptions(void *userData, int index) { @@ -2295,6 +2300,7 @@ static void draw_dm_edges_freestyle(BMEditMesh *em, DerivedMesh *dm) { dm->drawMappedEdges(dm, draw_dm_edges_freestyle__setDrawOptions, em); } +#endif /* Draw faces with color set based on selection * return 2 for the active face so it renders with stipple enabled */ @@ -2309,11 +2315,15 @@ static DMDrawOption draw_dm_faces_sel__setDrawOptions(void *userData, int index) if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) { if (efa == data->efa_act) { - glColor4ubv(data->cols[3]); + glColor4ubv(data->cols[2]); return DM_DRAW_OPTION_STIPPLE; } else { - col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : BM_elem_flag_test(efa, BM_ELEM_FREESTYLE) ? 2 : 0]; +#ifdef WITH_FREESTYLE + col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : BM_elem_flag_test(efa, BM_ELEM_FREESTYLE) ? 3 : 0]; +#else + col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : 0]; +#endif if (col[3] == 0) return DM_DRAW_OPTION_SKIP; glColor4ubv(col); @@ -2344,8 +2354,13 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int if (efa == data->efa_act || next_efa == data->efa_act) return 0; - col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : BM_elem_flag_test(efa, BM_ELEM_FREESTYLE) ? 2 : 0]; - next_col = data->cols[BM_elem_flag_test(next_efa, BM_ELEM_SELECT) ? 1 : BM_elem_flag_test(next_efa, BM_ELEM_FREESTYLE) ? 2 : 0]; +#ifdef WITH_FREESTYLE + col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : BM_elem_flag_test(efa, BM_ELEM_FREESTYLE) ? 3 : 0]; + next_col = data->cols[BM_elem_flag_test(next_efa, BM_ELEM_SELECT) ? 1 : BM_elem_flag_test(next_efa, BM_ELEM_FREESTYLE) ? 3 : 0]; +#else + col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : 0]; + next_col = data->cols[BM_elem_flag_test(next_efa, BM_ELEM_SELECT) ? 1 : 0]; +#endif if (col[3] == 0 || next_col[3] == 0) return 0; @@ -2354,16 +2369,23 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int } /* also draws the active face */ +#ifdef WITH_FREESTYLE static void draw_dm_faces_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *baseCol, - unsigned char *selCol, unsigned char *markCol, unsigned char *actCol, BMFace *efa_act) + unsigned char *selCol, unsigned char *actCol, unsigned char *markCol, BMFace *efa_act) +#else +static void draw_dm_faces_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *baseCol, + unsigned char *selCol, unsigned char *actCol, BMFace *efa_act) +#endif { drawDMFacesSel_userData data; data.dm = dm; data.cols[0] = baseCol; data.em = em; data.cols[1] = selCol; - data.cols[2] = markCol; - data.cols[3] = actCol; + data.cols[2] = actCol; +#ifdef WITH_FREESTYLE + data.cols[3] = markCol; +#endif data.efa_act = efa_act; /* double lookup */ data.orig_index_mf_to_mpoly = DM_get_tessface_data_layer(dm, CD_ORIGINDEX); @@ -2900,12 +2922,17 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, } if (me->drawflag & ME_DRAWFACES) { /* transp faces */ - unsigned char col1[4], col2[4], col3[4], col4[4]; + unsigned char col1[4], col2[4], col3[4]; +#ifdef WITH_FREESTYLE + unsigned char col4[4]; +#endif UI_GetThemeColor4ubv(TH_FACE, col1); UI_GetThemeColor4ubv(TH_FACE_SELECT, col2); - UI_GetThemeColor4ubv(TH_FREESTYLE_FACE_MARK, col3); - UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col4); + UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col3); +#ifdef WITH_FREESTYLE + UI_GetThemeColor4ubv(TH_FREESTYLE_FACE_MARK, col4); +#endif glEnable(GL_BLEND); glDepthMask(0); /* disable write in zbuffer, needed for nice transp */ @@ -2914,10 +2941,14 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, if (check_object_draw_texture(scene, v3d, dt)) col1[3] = 0; +#ifdef WITH_FREESTYLE if (!(me->drawflag & ME_DRAW_FREESTYLE_FACE)) - col3[3] = 0; + col4[3] = 0; draw_dm_faces_sel(em, cageDM, col1, col2, col3, col4, efa_act); +#else + draw_dm_faces_sel(em, cageDM, col1, col2, col3, efa_act); +#endif glDisable(GL_BLEND); glDepthMask(1); /* restore write in zbuffer */ @@ -2926,14 +2957,19 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, /* even if draw faces is off it would be nice to draw the stipple face * Make all other faces zero alpha except for the active * */ + /* col4 is only used by WITH_FREESTYLE, but keeping it here spares some #ifdef's... */ unsigned char col1[4], col2[4], col3[4], col4[4]; - col1[3] = col2[3] = col3[3] = 0; /* don't draw */ - UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col4); + col1[3] = col2[3] = col4[3] = 0; /* don't draw */ + UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col3); glEnable(GL_BLEND); glDepthMask(0); /* disable write in zbuffer, needed for nice transp */ +#ifdef WITH_FREESTYLE draw_dm_faces_sel(em, cageDM, col1, col2, col3, col4, efa_act); +#else + draw_dm_faces_sel(em, cageDM, col1, col2, col3, efa_act); +#endif glDisable(GL_BLEND); glDepthMask(1); /* restore write in zbuffer */ @@ -2969,6 +3005,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, glLineWidth(1); } +#ifdef WITH_FREESTYLE if(me->drawflag & ME_DRAW_FREESTYLE_EDGE) { UI_ThemeColor(TH_FREESTYLE_EDGE_MARK); glLineWidth(2); @@ -2978,6 +3015,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, glColor3ub(0,0,0); glLineWidth(1); } +#endif if (me->drawflag & ME_DRAWCREASES && CustomData_has_layer(&em->bm->edata, CD_CREASE)) { draw_dm_creases(em, cageDM); diff --git a/source/blender/freestyle/CMakeLists.txt b/source/blender/freestyle/CMakeLists.txt index 27fd9f5d98e..71bdb6aaf9e 100644 --- a/source/blender/freestyle/CMakeLists.txt +++ b/source/blender/freestyle/CMakeLists.txt @@ -36,6 +36,8 @@ set(INC_SYS ${PNG_INC} ) +add_definitions(-DWITH_FREESTYLE) + if(WIN32) set(INC_SYS ${INC_SYS} ${PTHREADS_INC}) endif(WIN32) diff --git a/source/blender/freestyle/SConscript b/source/blender/freestyle/SConscript index 11b45acafaf..d5ccf12d2db 100644 --- a/source/blender/freestyle/SConscript +++ b/source/blender/freestyle/SConscript @@ -3,7 +3,7 @@ import sys Import ('env') sources = [] -defs = [] +defs = ['WITH_FREESTYLE'] incs = '' incs += '../blenkernel ../blenloader ../blenlib ../imbuf ../makesdna ../makesrna' diff --git a/source/blender/makesdna/CMakeLists.txt b/source/blender/makesdna/CMakeLists.txt index 638d618d785..c60907060f7 100644 --- a/source/blender/makesdna/CMakeLists.txt +++ b/source/blender/makesdna/CMakeLists.txt @@ -23,4 +23,8 @@ # # ***** END GPL LICENSE BLOCK ***** +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + add_subdirectory(intern) diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 476ee4fa369..7b2773a8205 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -207,7 +207,9 @@ 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 */ -#define ID_LS MAKE_ID2('L', 'S') /* FreestyleLineStyle */ +/* #ifdef WITH_FREESTYLE */ +# define ID_LS MAKE_ID2('L', 'S') /* FreestyleLineStyle */ +/* #endif */ /* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */ #define ID_SEQ MAKE_ID2('S', 'Q') diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 94d8ed00cf7..3f6e6c59137 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -556,7 +556,9 @@ 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 */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 11b93b5fefe..919aa092616 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -177,8 +177,10 @@ 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; diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 058be2e2046..4f47ed76d50 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -192,8 +192,10 @@ 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 diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index bdb1568c73f..af1981ae07d 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -290,7 +290,9 @@ typedef struct MVertSkin { #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) +/* #endif */ /* puno = vertexnormal (mface) */ #define ME_PROJXY 16 @@ -307,7 +309,9 @@ typedef struct MVertSkin { /* flag (mface) */ #define ME_SMOOTH 1 #define ME_FACE_SEL 2 +/* #ifdef WITH_FREESTYLE */ #define ME_FREESTYLE_FACE 4 +/* #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)]) diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index a2eb54bde99..26a41054281 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -45,7 +45,9 @@ 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; @@ -189,7 +191,9 @@ typedef struct SceneRenderLayer { int samples; int pad; +/* #ifdef WITH_FREESTYLE */ struct FreestyleConfig freestyleConfig; +/* #endif */ } SceneRenderLayer; /* srl->layflag */ @@ -199,7 +203,9 @@ 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 */ #define SCE_LAY_ALL_Z 0x8000 @@ -540,9 +546,11 @@ 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]; @@ -1325,9 +1333,11 @@ 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 */ @@ -1523,7 +1533,9 @@ 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) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 2f082afb189..83d9ed6bf7c 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -225,7 +225,9 @@ 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]; diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript index a6520a6c03e..d4eabb03b13 100644 --- a/source/blender/makesdna/SConscript +++ b/source/blender/makesdna/SConscript @@ -28,10 +28,14 @@ Import ('env') objs = [] +defs = [] o = SConscript('intern/SConscript') objs += o incs = '#/intern/guardedalloc .' -env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215,200] ) +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + +env.BlenderLib ( 'bf_dna', objs, Split(incs), defs, libtype=['core','player'], priority = [215,200] ) diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 1dd1d7e8f87..0632564b998 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -34,6 +34,9 @@ blender_include_dirs( .. ) +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() # ----------------------------------------------------------------------------- # Build makesdna executable diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index add9611866d..8fd5b67c44b 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -39,6 +39,9 @@ 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/\\"" ') diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 12df9def368..b04052a98ef 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -133,8 +133,10 @@ static const char *includefiles[] = { "DNA_tracking_types.h", "DNA_dynamicpaint_types.h", "DNA_mask_types.h", +/* #ifdef WITH_FREESTYLE */ "DNA_freestyle_types.h", "DNA_linestyle_types.h", +/* #endif */ /* empty string to indicate end of includefiles */ "" @@ -1264,6 +1266,8 @@ int main(int argc, char **argv) #include "DNA_tracking_types.h" #include "DNA_dynamicpaint_types.h" #include "DNA_mask_types.h" +/* #ifdef WITH_FREESTYLE */ #include "DNA_freestyle_types.h" #include "DNA_linestyle_types.h" +/* #endif */ /* end of list */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index ad4ea0161f0..ce7cb32c6e6 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -240,10 +240,12 @@ 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; @@ -300,6 +302,7 @@ 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; @@ -331,6 +334,7 @@ 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; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 071c1fae4ef..75bb3475fed 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -132,10 +132,12 @@ extern EnumPropertyItem prop_dynamicpaint_type_items[]; extern EnumPropertyItem clip_editor_mode_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; diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index b012f6c96a2..464939dc879 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -38,8 +38,6 @@ incs += ' ../render/extern/include #/intern/cycles/blender' incs += ' ../nodes' incs += ' #/extern/glew/include' incs += ' #/intern/smoke/extern' -incs += ' ../freestyle' - incs += ' ../bmesh' defs = [] @@ -104,6 +102,10 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', ' if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + incs += ' ../freestyle' + defs.append('WITH_FREESTYLE') + rnalib = env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) Return ('rnalib') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 24bf6ff4aa1..a8b9b779ff8 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -54,7 +54,6 @@ set(DEFSRC rna_key.c rna_lamp.c rna_lattice.c - rna_linestyle.c rna_main.c rna_mask.c rna_material.c @@ -93,6 +92,12 @@ 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 @@ -254,7 +259,6 @@ blender_include_dirs( ../../windowmanager ../../editors/include ../../render/extern/include - ../../freestyle ../../../../intern/audaspace/intern ../../../../intern/cycles/blender ../../../../intern/guardedalloc @@ -262,6 +266,13 @@ blender_include_dirs( ../../../../intern/smoke/extern ) +if(WITH_FREESTYLE) + blender_include_dirs( + ../../freestyle + ) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_include_dirs_sys( ${GLEW_INCLUDE_PATH} ) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 5d60d416cc4..11562d729df 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -38,6 +38,8 @@ root_build_dir=normpath(env['BF_BUILDDIR']) source_files = env.Glob('*.c') source_files.remove('rna_access.c') +if not env['WITH_BF_FREESTYLE']: + source_files.remove('rna_linestyle.c') generated_files = source_files[:] generated_files.remove('rna_define.c') @@ -132,6 +134,10 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', ' if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + defs.append('WITH_FREESTYLE') + incs += ' ../../freestyle' + if not env['BF_DEBUG']: defs.append('NDEBUG') diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 333cdeabfa4..1b5ab2ea600 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3202,7 +3202,9 @@ 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}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 5efd162fe02..092c9eb2b17 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -56,7 +56,9 @@ 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", ""}, @@ -132,7 +134,9 @@ 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; @@ -169,7 +173,9 @@ 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; diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 85af3073945..06c01012e19 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -395,11 +395,13 @@ 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); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 361f4a01661..851ae69ed3f 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -56,7 +56,9 @@ #include "BKE_node.h" #include "BKE_sequencer.h" #include "BKE_texture.h" -#include "BKE_linestyle.h" +#ifdef WITH_FREESTYLE +# include "BKE_linestyle.h" +#endif #include "ED_node.h" @@ -190,6 +192,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) 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); @@ -197,6 +200,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) return path; break; } +#endif } } else { @@ -268,6 +272,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) } break; +#ifdef WITH_FREESTYLE case ID_LS: { ListBase listbase; @@ -281,6 +286,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) BLI_freelistN(&listbase); break; } +#endif default: /* everything else should have a "color_ramp" property */ { @@ -333,6 +339,7 @@ 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; @@ -340,6 +347,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * WM_main_add_notifier(NC_LINESTYLE, linestyle); break; } +#endif default: break; } diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index fbb5dd569cc..636be933ced 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -151,7 +151,9 @@ 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); @@ -311,7 +313,9 @@ 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 */ diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index ca4609f88c8..32db099c0c0 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -258,11 +258,13 @@ 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 @@ -328,7 +330,9 @@ 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} }; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 48db12ce14e..90cc8100718 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -72,7 +72,9 @@ #include "BKE_movieclip.h" #include "BKE_mask.h" #include "BKE_gpencil.h" -#include "BKE_linestyle.h" +#ifdef WITH_FREESTYLE +# include "BKE_linestyle.h" +#endif #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -634,6 +636,7 @@ 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); @@ -650,6 +653,7 @@ 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); } @@ -682,7 +686,9 @@ 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 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); } @@ -1704,6 +1710,7 @@ 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; @@ -1729,5 +1736,6 @@ 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 diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index bc67bf2da35..abc0b65a8f8 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1550,10 +1550,12 @@ static void rna_def_medge(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); +#ifdef WITH_FREESTYLE prop = RNA_def_property(srna, "use_freestyle_edge_mark", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_EDGE); RNA_def_property_ui_text(prop, "Freestyle Edge Mark", "Edge mark for Freestyle feature edge detection"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); +#endif prop = RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE); @@ -1611,10 +1613,12 @@ static void rna_def_mface(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); @@ -1713,10 +1717,12 @@ 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); @@ -2934,6 +2940,7 @@ 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"); @@ -2943,6 +2950,7 @@ 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); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a0a55c663e9..ce387952947 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -38,7 +38,9 @@ #include "DNA_scene_types.h" #include "DNA_userdef_types.h" #include "DNA_world_types.h" -#include "DNA_linestyle_types.h" +#ifdef WITH_FREESTYLE +# include "DNA_linestyle_types.h" +#endif #include "BLI_math.h" @@ -330,7 +332,9 @@ EnumPropertyItem image_color_depth_items[] = { #include "RE_engine.h" -#include "FRS_freestyle.h" +#ifdef WITH_FREESTYLE +# include "FRS_freestyle.h" +#endif static void rna_SpaceImageEditor_uv_sculpt_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) { @@ -1448,6 +1452,7 @@ static void rna_SceneSequencer_update(Main *UNUSED(bmain), Scene *UNUSED(scene), BKE_sequencer_preprocessed_cache_cleanup(); } +#ifdef WITH_FREESTYLE static PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr) { FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data; @@ -1491,6 +1496,7 @@ static void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int FreestyleConfig *config = (FreestyleConfig *)ptr->data; FRS_set_active_lineset_index(config, value); } +#endif #else @@ -1559,7 +1565,9 @@ 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} }; @@ -2108,6 +2116,7 @@ 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"); @@ -2115,6 +2124,7 @@ 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); @@ -2336,6 +2346,7 @@ 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; @@ -2743,6 +2754,7 @@ 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) { @@ -3281,6 +3293,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); @@ -3290,6 +3303,7 @@ 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 */ @@ -3870,12 +3884,14 @@ 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 @@ -4121,10 +4137,12 @@ 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); @@ -4583,6 +4601,7 @@ 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"); @@ -4593,6 +4612,7 @@ 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); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 46d0744cad7..e3eacb40e83 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -967,10 +967,12 @@ 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) @@ -997,10 +999,12 @@ 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) diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 21af50dbf10..ddb8594de79 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -31,7 +31,6 @@ Import ('env') incs = '. ../editors/include ../makesdna ../makesrna ../blenfont ../blenlib ../blenkernel ../nodes' incs += ' ../imbuf ../blenloader ../bmesh ../gpu ../render/extern/include ../windowmanager' -incs += ' ../freestyle/intern/python' incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include #intern/cycles/blender' incs += ' #intern/audaspace/intern ' + env['BF_PYTHON_INC'] @@ -102,6 +101,10 @@ if env['WITH_BF_CYCLES']: if env['WITH_BF_CYCLES_OSL']: defs.append('WITH_CYCLES_OSL') +if env['WITH_BF_FREESTYLE']: + incs += ' ../freestyle/intern/python' + defs.append('WITH_FREESTYLE') + if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index d0af6371059..f39e170c481 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -82,7 +82,9 @@ PyC_FlagSet bpy_bm_hflag_all_flags[] = { {BM_ELEM_SEAM, "SEAM"}, {BM_ELEM_SMOOTH, "SMOOTH"}, {BM_ELEM_TAG, "TAG"}, +#ifdef WITH_FREESTYLE {BM_ELEM_FREESTYLE, "FREESTYLE"}, +#endif {0, NULL} }; @@ -102,8 +104,10 @@ PyDoc_STRVAR(bpy_bm_elem_tag_doc, "Generic attribute scripts can use for own PyDoc_STRVAR(bpy_bm_elem_smooth_doc, "Smooth state of this element.\n\n:type: boolean"); PyDoc_STRVAR(bpy_bm_elem_seam_doc, "Seam for UV unwrapping.\n\n:type: boolean"); +#ifdef WITH_FREESTYLE PyDoc_STRVAR(bpy_bm_freestyle_edge_mark_doc, "Freestyle edge mark.\n\n:type: boolean"); PyDoc_STRVAR(bpy_bm_freestyle_face_mark_doc, "Freestyle face mark.\n\n:type: boolean"); +#endif static PyObject *bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag) { @@ -665,7 +669,9 @@ static PyGetSetDef bpy_bmedge_getseters[] = { {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH}, {(char *)"seam", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_seam_doc, (void *)BM_ELEM_SEAM}, +#ifdef WITH_FREESTYLE {(char *)"freestyle_edge_mark", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_freestyle_edge_mark_doc, (void *)BM_ELEM_FREESTYLE}, +#endif /* connectivity data */ {(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_verts_doc, (void *)BM_VERTS_OF_EDGE}, @@ -691,7 +697,9 @@ static PyGetSetDef bpy_bmface_getseters[] = { {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH}, +#ifdef WITH_FREESTYLE {(char *)"freestyle_face_mark", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_freestyle_face_mark_doc, (void *)BM_ELEM_FREESTYLE}, +#endif {(char *)"normal", (getter)bpy_bmface_normal_get, (setter)bpy_bmface_normal_set, (char *)bpy_bmface_normal_doc, NULL}, diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index b2ce33b08c7..8f90a823668 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -35,7 +35,6 @@ set(INC ../../makesrna ../../windowmanager ../../../../intern/cycles/blender - ../../freestyle/intern/python ../../../../intern/guardedalloc ) @@ -140,6 +139,13 @@ if(WITH_CYCLES_OSL) add_definitions(-DWITH_CYCLES_OSL) endif() +if(WITH_FREESTYLE) + list(APPEND INC + ../../freestyle/intern/python + ) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index b0dd8a29fbe..4f932ac68ff 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -60,7 +60,9 @@ #include "../generic/blf_py_api.h" #include "../mathutils/mathutils.h" -#include "BPy_Freestyle.h" +#ifdef WITH_FREESTYLE +# include "BPy_Freestyle.h" +#endif PyObject *bpy_package_py = NULL; @@ -259,7 +261,9 @@ void BPy_init_modules(void) } /* stand alone utility modules not related to blender directly */ IDProp_Init_Types(); /* not actually a submodule, just types */ +#ifdef WITH_FREESTYLE Freestyle_Init(); +#endif mod = PyModule_New("_bpy"); diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c index 607613b592c..74df3ef7307 100644 --- a/source/blender/python/intern/bpy_app_build_options.c +++ b/source/blender/python/intern/bpy_app_build_options.c @@ -72,6 +72,10 @@ static PyObject *make_build_options(void) SetStrItem("CYCLES_OSL"); #endif +#ifdef WITH_FREESTYLE + SetStrItem("FREESTYLE"); +#endif + #ifdef WITH_GAMEENGINE SetStrItem("GAMEENGINE"); #endif diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index 291ee8e44bd..16cba944e01 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -37,7 +37,6 @@ set(INC ../../../intern/guardedalloc ../../../intern/mikktspace ../../../intern/smoke/extern - ../freestyle ) set(INC_SYS @@ -144,6 +143,13 @@ if(WITH_MOD_SMOKE) add_definitions(-DWITH_SMOKE) endif() +if(WITH_FREESTYLE) + list(APPEND INC + ../freestyle + ) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WITH_CODEC_QUICKTIME) list(APPEND INC ../quicktime diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index 0fd180fed65..c4309577ae9 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -33,7 +33,6 @@ raysources = env.Glob('intern/raytrace/*.cpp') incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna' incs += ' extern/include ../blenkernel ../imbuf ../blenfont' incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace ../bmesh' -incs += ' ../freestyle' cflags_raytrace = env['CCFLAGS'] cxxflags_raytrace = env['CXXFLAGS'] @@ -84,6 +83,10 @@ if env['WITH_BF_QUICKTIME']: if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') +if env['WITH_BF_FREESTYLE']: + incs += ' ../freestyle' + defs.append('WITH_FREESTYLE') + if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 56cc0ad9a1c..020fa57cf94 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -219,7 +219,9 @@ void RE_TileProcessor(struct Render *re); /* only RE_NewRender() needed, main Blender render calls */ void RE_BlenderFrame(struct Render *re, struct Main *bmain, struct Scene *scene, struct SceneRenderLayer *srl, struct Object *camera_override, unsigned int lay, int frame, const short write_still); void RE_BlenderAnim(struct Render *re, struct Main *bmain, struct Scene *scene, struct Object *camera_override, unsigned int lay, int sfra, int efra, int tfra); +#ifdef WITH_FREESTYLE void RE_RenderFreestyleStrokes(struct Render *re, struct Main *bmain, struct Scene *scene); +#endif /* error reporting */ void RE_SetReports(struct Render *re, struct ReportList *reports); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 45080de3148..c45c6dfc1bc 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -228,7 +228,9 @@ struct Render ListBase volumes; ListBase volume_precache_parts; +#ifdef WITH_FREESTYLE ListBase freestyle_renders; +#endif /* arena for allocating data for use during render, for * example dynamic TFaces to go in the VlakRen structure. @@ -382,7 +384,9 @@ typedef struct VlakRen { struct Material *mat; char puno; char flag, ec; +#ifdef WITH_FREESTYLE char freestyle_edge_mark; +#endif int index; } VlakRen; @@ -615,11 +619,13 @@ typedef struct LampRen { #define R_TRACEBLE 128 /* vlakren->freestyle_edge_mark */ -#define R_EDGE_V1V2 1 -#define R_EDGE_V2V3 2 -#define R_EDGE_V3V4 4 -#define R_EDGE_V3V1 4 -#define R_EDGE_V4V1 8 +#ifdef WITH_FREESTYLE +# define R_EDGE_V1V2 1 +# define R_EDGE_V2V3 2 +# define R_EDGE_V3V4 4 +# define R_EDGE_V3V1 4 +# define R_EDGE_V4V1 8 +#endif /* strandbuffer->flag */ #define R_STRAND_BSPLINE 1 diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index bc84661698f..08da5dff3e0 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -42,7 +42,9 @@ #include "BLI_memarena.h" #include "BLI_ghash.h" #include "BLI_linklist.h" -#include "BLI_edgehash.h" +#ifdef WITH_FREESTYLE +# include "BLI_edgehash.h" +#endif #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -2694,7 +2696,11 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr, v2= mface->v2; v3= mface->v3; v4= mface->v4; - flag= mface->flag & (ME_SMOOTH | ME_FREESTYLE_FACE); +#ifdef WITH_FREESTYLE + flag = mface->flag & (ME_SMOOTH | ME_FREESTYLE_FACE); +#else + flag = mface->flag & ME_SMOOTH; +#endif vlr= RE_findOrAddVlak(obr, obr->totvlak++); vlr->v1= RE_findOrAddVert(obr, vertofs+v1); @@ -3219,6 +3225,7 @@ static void add_volume(Render *re, ObjectRen *obr, Material *ma) BLI_addtail(&re->volumes, vo); } +#ifdef WITH_FREESTYLE static EdgeHash *make_freestyle_edge_mark_hash(MEdge *medge, int totedge) { EdgeHash *edge_hash= BLI_edgehash_new(); @@ -3236,6 +3243,7 @@ static int has_freestyle_edge_mark(EdgeHash *edge_hash, int v1, int v2) MEdge *medge= BLI_edgehash_lookup(edge_hash, v1, v2); return (!medge) ? 0 : 1; } +#endif static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) { @@ -3356,14 +3364,16 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) } if (!timeoffset) { +#ifdef WITH_FREESTYLE EdgeHash *edge_hash; MEdge *medge; int totedge; /* create a hash table of Freestyle edge marks */ - medge= dm->getEdgeArray(dm); - totedge= dm->getNumEdges(dm); - edge_hash= make_freestyle_edge_mark_hash(medge, totedge); + medge = dm->getEdgeArray(dm); + totedge = dm->getNumEdges(dm); + edge_hash = make_freestyle_edge_mark_hash(medge, totedge); +#endif /* store customdata names, because DerivedMesh is freed */ RE_set_customdata_names(obr, &dm->faceData); @@ -3407,14 +3417,17 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if ( mface->mat_nr==a1 ) { float len; - int edge_mark= 0; int reverse_verts = (negative_scale != 0 && do_autosmooth == FALSE); int rev_tab[] = {reverse_verts==0 ? 0 : 2, 1, reverse_verts==0 ? 2 : 0, 3}; v1= reverse_verts==0 ? mface->v1 : mface->v3; v2= mface->v2; v3= reverse_verts==0 ? mface->v3 : mface->v1; v4= mface->v4; - flag= mface->flag & (ME_SMOOTH | ME_FREESTYLE_FACE); +#ifdef WITH_FREESTYLE + flag = mface->flag & (ME_SMOOTH | ME_FREESTYLE_FACE); +#else + flag = mface->flag & ME_SMOOTH; +#endif vlr= RE_findOrAddVlak(obr, obr->totvlak++); vlr->v1= RE_findOrAddVert(obr, vertofs+v1); @@ -3423,16 +3436,22 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if (v4) vlr->v4= RE_findOrAddVert(obr, vertofs+v4); else vlr->v4= 0; +#ifdef WITH_FREESTYLE /* Freestyle edge marks */ - if(has_freestyle_edge_mark(edge_hash, v1, v2)) edge_mark |= R_EDGE_V1V2; - if(has_freestyle_edge_mark(edge_hash, v2, v3)) edge_mark |= R_EDGE_V2V3; - if (!v4) { - if(has_freestyle_edge_mark(edge_hash, v3, v1)) edge_mark |= R_EDGE_V3V1; - } else { - if(has_freestyle_edge_mark(edge_hash, v3, v4)) edge_mark |= R_EDGE_V3V4; - if(has_freestyle_edge_mark(edge_hash, v4, v1)) edge_mark |= R_EDGE_V4V1; + { + int edge_mark = 0; + + if(has_freestyle_edge_mark(edge_hash, v1, v2)) edge_mark |= R_EDGE_V1V2; + if(has_freestyle_edge_mark(edge_hash, v2, v3)) edge_mark |= R_EDGE_V2V3; + if (!v4) { + if(has_freestyle_edge_mark(edge_hash, v3, v1)) edge_mark |= R_EDGE_V3V1; + } else { + if(has_freestyle_edge_mark(edge_hash, v3, v4)) edge_mark |= R_EDGE_V3V4; + if(has_freestyle_edge_mark(edge_hash, v4, v1)) edge_mark |= R_EDGE_V4V1; + } + vlr->freestyle_edge_mark= edge_mark; } - vlr->freestyle_edge_mark= edge_mark; +#endif /* render normals are inverted in render */ if (use_original_normals) { @@ -3501,8 +3520,10 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) } } +#ifdef WITH_FREESTYLE /* release the hash table of Freestyle edge marks */ BLI_edgehash_free(edge_hash, NULL); +#endif /* exception... we do edges for wire mode. potential conflict when faces exist... */ end= dm->getNumEdges(dm); @@ -4303,6 +4324,7 @@ static void check_non_flat_quads(ObjectRen *obr) normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co); normal_tri_v3(vlr1->n, vlr1->v3->co, vlr1->v2->co, vlr1->v1->co); +#ifdef WITH_FREESTYLE /* Freestyle edge marks */ if (vlr->flag & R_DIVIDE_24) { vlr1->freestyle_edge_mark= @@ -4311,7 +4333,8 @@ static void check_non_flat_quads(ObjectRen *obr) vlr->freestyle_edge_mark= ((vlr->freestyle_edge_mark & R_EDGE_V1V2) ? R_EDGE_V1V2 : 0) | ((vlr->freestyle_edge_mark & R_EDGE_V4V1) ? R_EDGE_V3V1 : 0); - } else { + } + else { vlr1->freestyle_edge_mark= ((vlr->freestyle_edge_mark & R_EDGE_V3V4) ? R_EDGE_V2V3 : 0) | ((vlr->freestyle_edge_mark & R_EDGE_V4V1) ? R_EDGE_V3V1 : 0); @@ -4319,6 +4342,7 @@ static void check_non_flat_quads(ObjectRen *obr) ((vlr->freestyle_edge_mark & R_EDGE_V1V2) ? R_EDGE_V1V2 : 0) | ((vlr->freestyle_edge_mark & R_EDGE_V2V3) ? R_EDGE_V2V3 : 0); } +#endif } /* clear the flag when not divided */ else vlr->flag &= ~R_DIVIDE_24; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 39df6a01f61..c7c5fcf354f 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -49,7 +49,6 @@ #include "BKE_camera.h" #include "BKE_global.h" #include "BKE_image.h" -#include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_pointcache.h" @@ -76,7 +75,10 @@ #include "RE_engine.h" #include "RE_pipeline.h" -#include "FRS_freestyle.h" +#ifdef WITH_FREESTYLE +# include "BKE_library.h" +# include "FRS_freestyle.h" +#endif /* internal */ #include "render_result.h" @@ -743,7 +745,7 @@ static RenderPart *find_next_pano_slice(Render *re, int *minx, rctf *viewplane) R.panodxp = (re->winx - (best->disprect.xmin + best->disprect.xmax) ) / 2; R.panodxv = (BLI_rctf_size_x(viewplane) * R.panodxp) / (float)(re->winx); - + /* shift viewplane */ R.viewplane.xmin = viewplane->xmin + R.panodxv; R.viewplane.xmax = viewplane->xmax + R.panodxv; @@ -943,7 +945,9 @@ void RE_TileProcessor(Render *re) /* ************ This part uses API, for rendering Blender scenes ********** */ +#ifdef WITH_FREESTYLE static void add_freestyle(Render *re); +#endif static void do_render_3d(Render *re) { @@ -985,10 +989,12 @@ static void do_render_3d(Render *re) if (!re->test_break(re->tbh)) add_halo_flare(re); +#ifdef WITH_FREESTYLE /* Freestyle */ if( re->r.mode & R_EDGE_FRS) if(!re->test_break(re->tbh)) add_freestyle(re); +#endif /* free all render verts etc */ RE_Database_Free(re); @@ -1429,6 +1435,7 @@ static void render_composit_stats(void *UNUSED(arg), char *str) R.i.infostr = NULL; } +#ifdef WITH_FREESTYLE /* invokes Freestyle stroke rendering */ static void add_freestyle(Render *re) { @@ -1495,7 +1502,7 @@ static void free_all_freestyle_renders(Scene *scene) BLI_freelistN( &re1->freestyle_renders ); } } - +#endif /* reads all buffers, calls optional composite, merges in first result->rectf */ static void do_merge_fullsample(Render *re, bNodeTree *ntree) @@ -1537,8 +1544,10 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree) if (sample) { BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); render_result_exr_file_read(re1, sample); +#ifdef WITH_FREESTYLE if( re1->r.mode & R_EDGE_FRS) composite_freestyle_renders(re1, sample); +#endif BLI_rw_mutex_unlock(&re->resultmutex); } ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */ @@ -1741,7 +1750,9 @@ static void do_render_composite_fields_blur_3d(Render *re) do_merge_fullsample(re, NULL); } +#ifdef WITH_FREESTYLE free_all_freestyle_renders(re->scene); +#endif /* weak... the display callback wants an active renderlayer pointer... */ re->result->renlay = render_get_active_layer(re, re->result); @@ -2190,7 +2201,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); do_render_all_options(re); - + if (write_still && !G.is_break) { if (BKE_imtype_is_movie(scene->r.im_format.imtype)) { /* operator checks this but in case its called from elsewhere */ @@ -2214,6 +2225,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr G.is_rendering = FALSE; } +#ifdef WITH_FREESTYLE void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene) { re->result_ok= 0; @@ -2222,6 +2234,7 @@ void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene) } re->result_ok= 1; } +#endif static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override) { diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index eb330177bac..1d84f0e5a94 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -57,7 +57,9 @@ #include "render_result.h" #include "render_types.h" -#include "FRS_freestyle_config.h" +#ifdef WITH_FREESTYLE +# include "FRS_freestyle_config.h" +#endif /********************************** Free *************************************/ @@ -566,7 +568,9 @@ 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_add_freestyle_config( srl ); +#endif re->r.actlay = 0; } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index a425d9a330b..c9c8501a3a4 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1713,12 +1713,14 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) if (ma->mode & (MA_FACETEXTURE_ALPHA)) shi->alpha= shi->vcol[3]; } +#ifdef WITH_FREESTYLE else if (ma->vcol_alpha) { shi->r= shi->vcol[0]; shi->g= shi->vcol[1]; shi->b= shi->vcol[2]; shi->alpha= shi->vcol[3]; } +#endif else if (ma->mode & (MA_VERTEXCOLP)) { float neg_alpha = 1.0f - shi->vcol[3]; shi->r= shi->r*neg_alpha + shi->vcol[0]*shi->vcol[3]; diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index ffeb7aff6fa..8ec61a62d49 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -33,7 +33,6 @@ set(INC ../editors/include ../editors/io ../gpu - ../freestyle ../imbuf ../makesdna ../makesrna @@ -88,6 +87,13 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_FREESTYLE) + list(APPEND INC + ../freestyle + ) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WITH_OPENCOLLADA) add_definitions(-DWITH_COLLADA) endif() diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript index 3702a2d909c..5904a417190 100644 --- a/source/blender/windowmanager/SConscript +++ b/source/blender/windowmanager/SConscript @@ -37,7 +37,6 @@ incs = '. ../editors/include ../python ../makesdna ../blenlib ../blenkernel' incs += ' ../nodes ../imbuf ../blenloader ../render/extern/include' incs += ' ../radiosity/extern/include' incs += ' ../makesrna ../gpu ../blenfont ../bmesh ../compositor' -incs += ' ../freestyle' incs += ' #/intern/guardedalloc #/intern/memutil #/intern/ghost' incs += ' #/intern/elbeem #/extern/glew/include' @@ -70,6 +69,10 @@ if env['BF_BUILDINFO']: if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_FREESTYLE']: + incs += ' ../freestyle' + defs.append('WITH_FREESTYLE') + if env['WITH_BF_COMPOSITOR']: defs.append("WITH_COMPOSITOR") diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index c88011aab13..2cb19ccdf09 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -239,7 +239,9 @@ typedef struct wmNotifier { #define NC_MOVIECLIP (20<<24) #define NC_MASK (21<<24) #define NC_GPENCIL (22<<24) -#define NC_LINESTYLE (23<<24) +#ifdef WITH_FREESTYLE +# define NC_LINESTYLE (23<<24) +#endif /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 20b205a642a..918068cc7d1 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -115,7 +115,9 @@ #include "BPY_extern.h" #endif -#include "FRS_freestyle.h" +#ifdef WITH_FREESTYLE +# include "FRS_freestyle.h" +#endif #include "WM_api.h" #include "WM_types.h" @@ -441,7 +443,9 @@ void WM_file_read(bContext *C, const char *filepath, ReportList *reports) BPY_app_handlers_reset(FALSE); BPY_modules_load_user(C); #endif +#ifdef WITH_FREESTYLE FRS_read_file(C); +#endif /* important to do before NULL'ing the context */ BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); diff --git a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt index afd5f5b0177..702210d1c5f 100644 --- a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt +++ b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt @@ -60,4 +60,8 @@ if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) +endif() + blender_add_lib_nolist(blenkernel_blc "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blenderplayer/bad_level_call_stubs/SConscript b/source/blenderplayer/bad_level_call_stubs/SConscript index f26f4dfea6b..41c84051fdf 100644 --- a/source/blenderplayer/bad_level_call_stubs/SConscript +++ b/source/blenderplayer/bad_level_call_stubs/SConscript @@ -41,4 +41,7 @@ if env['WITH_BF_INTERNATIONAL']: if env['WITH_BF_GAMEENGINE']: defs += ' WITH_GAMEENGINE' +if env['WITH_BF_FREESTYLE']: + defs += ' WITH_FREESTYLE' + env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype=['player'],priority=[220] ) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 014fefb8219..f394290d952 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -55,8 +55,10 @@ struct FCurve; struct Heap; struct HeapNode; struct ID; +#ifdef WITH_FREESTYLE struct FreestyleConfig; struct FreestyleLineSet; +#endif struct ImBuf; struct Image; struct ImageUser; @@ -85,7 +87,9 @@ struct RenderLayer; struct RenderResult; struct Scene; struct Scene; +#ifdef WITH_FREESTYLE struct SceneRenderLayer; +#endif struct ScrArea; struct SculptSession; struct ShadeInput; @@ -520,6 +524,7 @@ int pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id) { return 0; } struct PyObject *pyrna_id_CreatePyObject(struct ID *id) {return NULL; } void BPY_context_update(struct bContext *C) {}; +#ifdef WITH_FREESTYLE /* Freestyle */ void FRS_add_freestyle_config(struct SceneRenderLayer* srl) {} void FRS_free_freestyle_config(struct SceneRenderLayer* srl) {} @@ -527,6 +532,7 @@ struct FreestyleLineSet *FRS_get_active_lineset(struct FreestyleConfig *config) short FRS_get_active_lineset_index(struct FreestyleConfig *config) { return 0; } void FRS_set_active_lineset_index(struct FreestyleConfig *config, short index) {} void FRS_unlink_target_object(struct FreestyleConfig *config, struct Object *ob) {} +#endif /* intern/dualcon */ struct DualConMesh; struct DualConMesh *dualcon(const struct DualConMesh *input_mesh, diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 67bf9599baf..e0a38096904 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -36,7 +36,6 @@ blender_include_dirs( ../blender/render/extern/include ../blender/makesdna ../blender/gpu - ../blender/freestyle ../blender/windowmanager ) @@ -81,6 +80,11 @@ if(WITH_BINRELOC) blender_include_dirs(${BINRELOC_INCLUDE_DIRS}) endif() +if(WITH_FREESTYLE) + add_definitions(-DWITH_FREESTYLE) + blender_include_dirs(../blender/freestyle) +endif() + # Setup the exe sources and buildinfo set(SRC creator.c @@ -280,15 +284,24 @@ if(WITH_PYTHON) set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, wont do anything endif() + # do not install freestyle dir if disabled + if(NOT WITH_FREESTYLE) + set(FREESTYLE_EXCLUDE_CONDITIONAL "freestyle/*") + else() + set(FREESTYLE_EXCLUDE_CONDITIONAL "_freestyle/*") # dummy, wont do anything + endif() + install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts DESTINATION ${TARGETDIR_VER} PATTERN ".svn" EXCLUDE PATTERN "__pycache__" EXCLUDE PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE + PATTERN "${FREESTYLE_EXCLUDE_CONDITIONAL}" EXCLUDE ) unset(ADDON_EXCLUDE_CONDITIONAL) + unset(FREESTYLE_EXCLUDE_CONDITIONAL) endif() # localization diff --git a/source/creator/creator.c b/source/creator/creator.c index 3bf02298ddf..bc8ed91dc05 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -102,7 +102,9 @@ #include "BLI_scanfill.h" /* for BLI_setErrorCallBack, TODO, move elsewhere */ -#include "FRS_freestyle.h" +#ifdef WITH_FREESTYLE +# include "FRS_freestyle.h" +#endif #ifdef WITH_BUILDINFO_HEADER # define BUILD_DATE @@ -1369,9 +1371,11 @@ int main(int argc, const char **argv) CTX_py_init_set(C, 1); WM_keymap_init(C); +#ifdef WITH_FREESTYLE /* initialize Freestyle */ FRS_initialize(); FRS_set_context(C); +#endif /* OK we are ready for it */ #ifndef WITH_PYTHON_MODULE -- cgit v1.2.3