Another big patch set by Bastien Montagne, thanks a lot!
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Thu, 20 Dec 2012 07:57:26 +0000 (07:57 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Thu, 20 Dec 2012 07:57:26 +0000 (07:57 +0000)
* Made Freestyle optional (turned on by default).

* Fix for missing bpath.c updates in the previous merge of trunk changes.

134 files changed:
CMakeLists.txt
SConstruct
build_files/scons/config/darwin-config.py
build_files/scons/config/freebsd7-config.py
build_files/scons/config/freebsd8-config.py
build_files/scons/config/freebsd9-config.py
build_files/scons/config/linux-config.py
build_files/scons/config/linuxcross-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-mingw-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
release/scripts/startup/bl_operators/__init__.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_render_layer.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/CMakeLists.txt
source/blender/SConscript
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/CMakeLists.txt
source/blender/blenfont/SConscript
source/blender/blenkernel/BKE_linestyle.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/bpath.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/SConscript
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/CMakeLists.txt
source/blender/bmesh/SConscript
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_operators.h
source/blender/bmesh/operators/bmo_similar.c
source/blender/editors/animation/CMakeLists.txt
source/blender/editors/animation/SConscript
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/CMakeLists.txt
source/blender/editors/interface/SConscript
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/CMakeLists.txt
source/blender/editors/mesh/SConscript
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/render/CMakeLists.txt
source/blender/editors/render/SConscript
source/blender/editors/render/render_intern.h
source/blender/editors/render/render_ops.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_buttons/CMakeLists.txt
source/blender/editors/space_buttons/SConscript
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/CMakeLists.txt
source/blender/editors/space_file/SConscript
source/blender/editors/space_file/filelist.c
source/blender/editors/space_nla/CMakeLists.txt
source/blender/editors/space_nla/SConscript
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_view3d/CMakeLists.txt
source/blender/editors/space_view3d/SConscript
source/blender/editors/space_view3d/drawobject.c
source/blender/freestyle/CMakeLists.txt
source/blender/freestyle/SConscript
source/blender/makesdna/CMakeLists.txt
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/SConscript
source/blender/makesdna/intern/CMakeLists.txt
source/blender/makesdna/intern/SConscript
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/SConscript
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/intern/CMakeLists.txt
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_app_build_options.c
source/blender/render/CMakeLists.txt
source/blender/render/SConscript
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/render/intern/source/shadeoutput.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_files.c
source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/SConscript
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c

index 674e532ff2c8248cb8dd04d16d9a251c45b74b27..7589d4dcfc38ce789b957fc02dd61c8fde4a0a66 100644 (file)
@@ -229,6 +229,9 @@ option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 # Camera/motion tracking
 option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
 
+# Freestyle
+option(WITH_FREESTYLE     "Enable Freestyle (advanced edges rendering)" ON)
+
 # Misc
 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
 option(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
index 4630b7b8c87b1402abde8adbd4df52da0fae736a..0a91de4e41023c1a5b751a9b7d750e395b6531ca 100644 (file)
@@ -269,6 +269,7 @@ if 'blenderlite' in B.targets:
     target_env_defs['WITH_BF_PYTHON'] = False
     target_env_defs['WITH_BF_3DMOUSE'] = False
     target_env_defs['WITH_BF_LIBMV'] = False
+    target_env_defs['WITH_BF_FREESTYLE'] = False
 
     # Merge blenderlite, let command line to override
     for k,v in target_env_defs.iteritems():
@@ -675,6 +676,10 @@ if env['OURPLATFORM']!='darwin':
                 if VERSION_RELEASE_CYCLE == "release" and "addons_contrib" in dn:
                     dn.remove('addons_contrib')
 
+                # do not install freestyle if disabled
+                if not env['WITH_BF_FREESTYLE'] and "freestyle" in dn:
+                    dn.remove("freestyle")
+
                 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
                 dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
 
index 207ddd3579b84aec985628459c4a3d07469c996b..ee1b7bfa38cb66f1177399b465ec071a39853309 100644 (file)
@@ -317,6 +317,9 @@ WITH_BF_CYCLES_CUDA_BINARIES = False
 BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 #Ray trace optimization
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386':
     WITH_BF_RAYOPTIMIZATION = True
index 02c9093567a964c3275dbfd659692a48c3fc2a5e..6c39039c4fb74a3d660602e9975233b3c9690ff1 100644 (file)
@@ -162,6 +162,9 @@ WITH_GHOST_XDND = False
 
 WITH_BF_OPENMP = True
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
index 5d3308c50d4c1a399498899115b1b1c13e1f77ad..3318e21bf1db08aea0106ed9ee7f04c607a39c86 100644 (file)
@@ -162,6 +162,9 @@ WITH_BF_OPENMP = True
 
 WITH_GHOST_XDND = False
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
index 98c2c8fa50018b4620696404235b10f3c1f66436..b6c5c0d45eb5cad9f62732e0a5f0c6cb68b58286 100644 (file)
@@ -162,6 +162,9 @@ WITH_BF_OPENMP = True
 
 WITH_GHOST_XDND = False
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
index db3b369c5c4734436075aa2cbe6d40413e81980c..05d846d74336ac73c9762a9b24cc0b9672787fde 100644 (file)
@@ -225,6 +225,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
 BF_3DMOUSE_LIB = 'spnav'
 BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 ##
 CC = 'gcc'
 CXX = 'g++'
index 54faf59b2a47092792971ddc169670365b2209a5..925ca5bb8890d34ae92d5b110e53f50d7ecd3c69 100644 (file)
@@ -160,6 +160,9 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}'
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
index 391421609d2bf64088b562528619fe92bc01e63a..5362e35878ea7da33b48c63f5b47291c4f7d188d 100644 (file)
@@ -176,6 +176,9 @@ WITH_BF_CYCLES_CUDA_BINARIES = False
 #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 ##
 CC = 'gcc'
 CXX = 'g++'
index 21488e75f7ef1bc8b209f255e48b8f402fda8ef6..cf0afec0ee1129a475468d2ea43a1b2790870a6f 100644 (file)
@@ -195,6 +195,9 @@ BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30']
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
index d00e7a3ffa7043215cda2a604e2193e91ab481ee..5e6e16b1771ab6d192f06c53dcea0fbe6f663286 100644 (file)
@@ -174,6 +174,9 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
 #May produce errors with unsupported MinGW-w64 builds
 WITH_BF_OPENMP = False
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 ##
 CC = 'gcc'
 CXX = 'g++'
index c0ea7972aeb9189679abd18dfafa10f7593a10f9..33f01616579268b77e405a1bf7d3b6c4ce5436eb 100644 (file)
@@ -192,6 +192,9 @@ WITH_BF_RAYOPTIMIZATION = True
 # No need to manually specify SSE/SSE2 on x64 systems.
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['']
 
+#Freestyle
+WITH_BF_FREESTYLE = True
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
index 19c27d0c6bcc6b381c606d0484bf9157a086a13b..eac26c1a50b335bc4150aa404885ab60b2238282 100644 (file)
@@ -364,7 +364,7 @@ def propose_priorities():
 def creator(env):
     sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
 
-    incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', '#/source/blender/freestyle', env['BF_OPENGL_INC']]
+    incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
 
     defs = []
 
@@ -388,6 +388,10 @@ def creator(env):
         if env['BF_DEBUG']:
             defs.append('_DEBUG')
 
+    if env['WITH_BF_FREESTYLE']:
+        incs.append('#/source/blender/freestyle')
+        defs.append('WITH_FREESTYLE')
+
     if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
         incs.append(env['BF_PTHREADS_INC'])
         incs.append('#/intern/utfconv')
index 19f4ac9a1de4a2562fc13297b117cd46907dcac3..056ebb9b7fe7166a9e1f6489e110416d6a86e808 100644 (file)
@@ -116,6 +116,7 @@ def validate_arguments(args, bc):
             'WITH_BF_TIFF', 'BF_TIFF', 'BF_TIFF_INC', 'BF_TIFF_LIB', 'BF_TIFF_LIBPATH', 'WITH_BF_STATICTIFF', 'BF_TIFF_LIB_STATIC',
             'WITH_BF_ZLIB', 'BF_ZLIB', 'BF_ZLIB_INC', 'BF_ZLIB_LIB', 'BF_ZLIB_LIBPATH', 'WITH_BF_STATICZLIB', 'BF_ZLIB_LIB_STATIC',
             'WITH_BF_INTERNATIONAL',
+            'WITH_BF_FREESTYLE',
             'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
             'WITH_BF_GAMEENGINE',
             'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
@@ -385,6 +386,8 @@ def read_opts(env, cfg, args):
 
         (BoolVariable('WITH_BF_INTERNATIONAL', 'Use Boost::locale if true', True)),
 
+        (BoolVariable('WITH_BF_FREESTYLE', 'Build advanced edge renderer', True)),
+
         (BoolVariable('WITH_BF_ICONV', 'Use iconv if true', True)),
         ('BF_ICONV', 'iconv base path', ''),
         ('BF_ICONV_INC', 'iconv include path', ''),
index 0ecb0d46c5f9dd9c138d7b8c75190d592daef652..897dd24e174dfda501e642e3e884a83862133322 100644 (file)
@@ -22,12 +22,11 @@ if "bpy" in locals():
     from imp import reload as _reload
     for val in _modules_loaded.values():
         _reload(val)
-_modules = (
+_modules = [
     "add_mesh_torus",
     "anim",
     "clip",
     "console",
-    "freestyle",
     "image",
     "mesh",
     "node",
@@ -44,16 +43,18 @@ _modules = (
     "vertexpaint_dirt",
     "view3d",
     "wm",
-)
+]
+
+import bpy
+
+if 'FREESTYLE' in bpy.app.build_options:
+    _modules.append("freestyle")
 __import__(name=__name__, fromlist=_modules)
 _namespace = globals()
-_modules_loaded = {name: _namespace[name] for name in _modules}
+_modules_loaded = {name: _namespace[name] for name in _modules if name != 'bpy'}
 del _namespace
 
 
-import bpy
-
-
 def register():
     bpy.utils.register_module(__name__)
 
index 8031bd26bee42d95e120b4faf3b964e08b0f8586..519aae96e919a4d2e93cd426d5ddafb1e5260555 100644 (file)
@@ -50,8 +50,19 @@ class RenderButtonsPanel():
 
     @classmethod
     def poll(cls, context):
+        scene = context.scene
+        return scene and (scene.render.engine in cls.COMPAT_ENGINES)
+
+
+class RenderFreestyleButtonsPanel(RenderButtonsPanel):
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+    @classmethod
+    def poll(cls, context):
+        if not super().poll(context):
+            return False
         rd = context.scene.render
-        return context.scene and (rd.engine in cls.COMPAT_ENGINES)
+        return 'FREESTYLE' in bpy.app.build_options
 
 
 class RENDER_PT_render(RenderButtonsPanel, Panel):
@@ -297,7 +308,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
         sub.prop(rd, "edge_color", text="")
 
 
-class RENDER_PT_freestyle(RenderButtonsPanel, Panel):
+class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
     bl_label = "Freestyle"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER'}
index 93c6d289bff00ed9851b60f5b0bb65f52baeee6d..20fc080875933f0e183acbc1370298f63a1585fa 100644 (file)
@@ -33,6 +33,28 @@ class RenderLayerButtonsPanel():
         return scene and (scene.render.engine in cls.COMPAT_ENGINES)
 
 
+class RenderLayerFreestyleButtonsPanel(RenderLayerButtonsPanel):
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+    @classmethod
+    def poll(cls, context):
+        if not super().poll(context):
+            return False
+        rd = context.scene.render
+        return 'FREESTYLE' in bpy.app.build_options and rd.use_freestyle and rd.layers.active
+
+
+class RenderLayerFreestyleEditorButtonsPanel(RenderLayerFreestyleButtonsPanel):
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+    @classmethod
+    def poll(cls, context):
+        if not super().poll(context):
+            return False
+        rl = context.scene.render.layers.active
+        return rl and rl.freestyle_settings.mode == 'EDITOR'
+
+
 class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel):
     bl_label = "Layers"
     bl_options = {'HIDE_HEADER'}
@@ -89,24 +111,26 @@ class RENDERLAYER_PT_layer_options(RenderLayerButtonsPanel, Panel):
         split = layout.split()
 
         col = split.column()
-        col.prop(rl, "use_zmask")
-        row = col.row()
-        row.prop(rl, "invert_zmask", text="Negate")
-        row.active = rl.use_zmask
+        row = col.row(align=True)
+        row.prop(rl, "use_zmask")
+        sub = row.row(align=True)
+        sub.prop(rl, "invert_zmask", text="", icon='ZOOMOUT')
+        sub.active = rl.use_zmask
         col.prop(rl, "use_all_z")
+        col.prop(rl, "use_ztransp")
 
         col = split.column()
         col.prop(rl, "use_solid")
         col.prop(rl, "use_halo")
-        col.prop(rl, "use_ztransp")
-        col.prop(rl, "use_sky")
+        col.prop(rl, "use_strand")
 
         col = split.column()
+        col.prop(rl, "use_sky")
         col.prop(rl, "use_edge_enhance")
-        col.prop(rl, "use_strand")
-        row = col.row()
-        row.prop(rl, "use_freestyle")
-        row.active = rd.use_freestyle
+        if 'FREESTYLE' in bpy.app.build_options:
+            row = col.row()
+            row.prop(rl, "use_freestyle")
+            row.active = rd.use_freestyle
 
 
 class RENDERLAYER_PT_layer_passes(RenderLayerButtonsPanel, Panel):
@@ -164,19 +188,10 @@ class RENDER_MT_lineset_specials(Menu):
         layout.operator("scene.freestyle_lineset_paste", icon='PASTEDOWN')
 
 
-class RENDERLAYER_PT_freestyle(RenderLayerButtonsPanel, Panel):
+class RENDERLAYER_PT_freestyle(RenderLayerFreestyleButtonsPanel, Panel):
     bl_label = "Freestyle"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
-    @classmethod
-    def poll(cls, context):
-        scene = context.scene
-        if not (scene and (scene.render.engine in cls.COMPAT_ENGINES)):
-            return False
-        rd = scene.render
-        rl = rd.layers.active
-        return rd.use_freestyle and rl
-
     def draw(self, context):
         rd = context.scene.render
         rl = rd.layers.active
@@ -225,19 +240,10 @@ class RENDERLAYER_PT_freestyle(RenderLayerButtonsPanel, Panel):
                 row.operator("scene.freestyle_module_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
 
 
-class RENDERLAYER_PT_freestyle_lineset(RenderLayerButtonsPanel, Panel):
+class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, Panel):
     bl_label = "Freestyle Line Set"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
-    @classmethod
-    def poll(cls, context):
-        scene = context.scene
-        if not (scene and (scene.render.engine in cls.COMPAT_ENGINES)):
-            return False
-        rd = scene.render
-        rl = rd.layers.active
-        return rd.use_freestyle and rl and rl.freestyle_settings.mode == 'EDITOR'
-
     def draw_edge_type_buttons(self, box, lineset, edge_type):
         # property names
         select_edge_type = "select_" + edge_type
@@ -326,20 +332,11 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerButtonsPanel, Panel):
                 row.prop(lineset, "group_negation", expand=True)
 
 
-class RENDERLAYER_PT_freestyle_linestyle(RenderLayerButtonsPanel, Panel):
+class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, Panel):
     bl_label = "Freestyle Line Style"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
-    @classmethod
-    def poll(cls, context):
-        scene = context.scene
-        if not (scene and (scene.render.engine in cls.COMPAT_ENGINES)):
-            return False
-        rd = scene.render
-        rl = rd.layers.active
-        return rd.use_freestyle and rl and rl.freestyle_settings.mode == 'EDITOR'
-
     def draw_modifier_box_header(self, box, modifier):
         row = box.row()
         row.context_pointer_set("modifier", modifier)
index 689cd635606432daeb271f1e293da2638d643562..7807bb11c8aad87d38eb38c946e948ff914c2ba0 100644 (file)
@@ -1838,8 +1838,9 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
 
         layout.separator()
 
-        layout.operator("mesh.mark_freestyle_edge").clear = False
-        layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True
+        if context.scene and 'FREESTYLE' in bpy.app.build_options:
+            layout.operator("mesh.mark_freestyle_edge").clear = False
+            layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True
 
         layout.separator()
 
@@ -1883,8 +1884,9 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
 
         layout.separator()
 
-        layout.operator("mesh.mark_freestyle_face").clear = False
-        layout.operator("mesh.mark_freestyle_face", text="Clear Freestyle Face").clear = True
+        if context.scene and 'FREESTYLE' in bpy.app.build_options:
+            layout.operator("mesh.mark_freestyle_face").clear = False
+            layout.operator("mesh.mark_freestyle_face", text="Clear Freestyle Face").clear = True
 
         layout.separator()
 
@@ -2491,8 +2493,9 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
         col.prop(mesh, "show_edge_bevel_weight", text="Bevel Weights")
         col.prop(mesh, "show_edge_seams", text="Seams")
         col.prop(mesh, "show_edge_sharp", text="Sharp")
-        col.prop(mesh, "show_freestyle_edge_marks", text="Freestyle Edge Marks")
-        col.prop(mesh, "show_freestyle_face_marks", text="Freestyle Face Marks")
+        if context.scene and 'FREESTYLE' in bpy.app.build_options:
+            col.prop(mesh, "show_freestyle_edge_marks", text="Freestyle Edge Marks")
+            col.prop(mesh, "show_freestyle_face_marks", text="Freestyle Face Marks")
 
         col.separator()
         col.label(text="Normals:")
index bd359a47b40bb4cf85d7e3cf5067e8b53832a9f6..e89ec2b255af1f74973ac4817675a9ecb49ebd79 100644 (file)
@@ -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()
+
index ff1d6b5de0a140c7e551a904606a3190db9ea75d..5675575e24595dae0af100f197fed72105d03ff6 100644 (file)
@@ -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'])
index eb3518ac997949592f4327c9a4bedbccbe05b44d..9a2789d36ccbe5159e2bbdd797fbb68cfa5ee8d5 100644 (file)
@@ -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"
index 90baef14a748530aacc1a044decce916d721af87..a3afd853cbae259a5582bf5af900ec7b3583e745 100644 (file)
@@ -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}")
index a6ea724a51f25a169f95f6c8f92eb352f6791e67..354a030775e1e978620d5388870693349d0a966b 100644 (file)
@@ -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] )
index 3cbf3454f0b95319b40e1d021304338d87a4febf..e077cd998c9ea0f8a622c34e9fec3e2a3d2cdddd 100644 (file)
 
 #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__ */
index cb8f1a7d68211ed03164d3c600f4cec1016540ee..ec465502ca0fa41013638ae299a312f87308b7fc 100644 (file)
@@ -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;
index 70a3f927b2328198ee697216c8baa83ef11c8f74..7a11bdb1f39d9d7378dc023be5e06dc41b54ee91 100644 (file)
@@ -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")
index ccb21b209eacdf6cebf7313a731de0341b193655..2998da824efe295942c429a759d5b50bdb3b360a 100644 (file)
@@ -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']
 
index 838cf3b8542035b4052c49b6050a4a81a8334e20..aecf6e5e437db8d3765dbce5f007d998328413b7 100644 (file)
@@ -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
index 24b13b062f37e7827cf0a8c017e5abc50a2e2ac8..e10a078c2f7cdca81bf7348c93c35bdf7e67ad9c 100644 (file)
@@ -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:
index d3545cd2720a60fa3556356831d93052bff47294..fda7dfb046e6535e663a391921b5acf28a72c3ca 100644 (file)
@@ -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
                }
        }
        
index 75c22d060428f688f588c4e2f22d42380f4195a1..8fab0f2d4df10f496808eef17b36ea7808d0a905 100644 (file)
@@ -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 },
index d21a12b9e6aa1ae45960e24e1af74a804082b365..2192d2862c8bd002095df6677fe70cd1caec6eb4 100644 (file)
 #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);
index 3bfd4f4f760d41f0d82ae00b1c3abc39246bba93..54bd03ece70b1a8602bde4582f1b885dd209d87e 100644 (file)
@@ -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;
index bf4e32ef12245cd5a87fb2fc9bf8d3507542cfa6..f0819d426fb1edbc86c22b30c3ef1f68da56558e 100644 (file)
 
 #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;
index 5e6d7647d1d00a2ee30eabb0d224a0a2fcb0df3c..1c98f6c32a2943755bb2fb7be2669bc5b18cb658 100644 (file)
@@ -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;
 }
index 7c58c7b21ed8242a34a0ba56c98f330d2cc801f7..37c9c1dd84ecfaa4b6c0e4920c8a49cca6e28044 100644 (file)
@@ -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 {
index 6644c58611fa426afb6e067ceb5cf6a28e944ccd..fe954fb10ac787a59e45b0a7cd761e1ad6132e2f 100644 (file)
@@ -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
index 2be06f7311da684e3d0ae4ddbe0be7b396864525..19216442aa0f3117b0430baeaaf88479dbe1c2c3 100644 (file)
@@ -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'
index 3c5812fa513b6e4f9ae48600ac22e0912c649a78..894cd24fc4ae4bed4d1e65165b15d283c4b1a726 100644 (file)
@@ -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}")
index 8950c4f770298668a6640ed707dd32900814ce5f..f85ae8c112bbcc537c8660235e28614a4433455c 100644 (file)
@@ -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:
index 5c044a0a3bd6e027afba5ee9af3214df63fd1ab6..453f35d8057a12de95935e51bd681bfbba880b94 100644 (file)
@@ -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;
index 8208cca981ebc468ae4cac6cb62864360b531558..3f80674bf600f9b1cb5321d04961422ff593afaa 100644 (file)
 #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) {
index c41b070324079e239bfd917ce968c2052816e2c7..f80dbc459267f652d0ae7f811b8d2aac262a0688 100644 (file)
@@ -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}")
index 722b75186309e02a48bf173aba08adf892faa29f..ee2380084caf322e122e2815d4332b13a787b6c6 100644 (file)
@@ -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 )
index a2613f46bf8f9211d68e01aceff67e30a3478b99..5af9690b47ed98f92f97c2d9f37702ea91fc2fe4 100644 (file)
@@ -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
index 229a7caebfdb6fe36b8a7e0b30603239f7c9510a..d23443daa7fc439207e9d0c4b740cd06070516be 100644 (file)
@@ -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
                 );
 }
index c98c3eae50bd3d3d84a7228084f08e62a7d9e579..16b38c340fff46fdb4651c96799f1aa844087814 100644 (file)
@@ -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 */
index 78b6ebb4bd7143e2e789e3202307f8e5ff9e8987..a8cc152bd4efe9e205b34f981523e552f4feda49 100644 (file)
@@ -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);
                                }
index 9e1e44e411de25f86844967949c4d3c33ec7e287..58e38e55fa3efdebeb89b0c5c299162ac8c76898 100644 (file)
@@ -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}")
index 2a6b381ba66fbf9e62170ccdfa84153828f8fd01..a4ccf1f6c3ce0aa7eead9a710ca3b4cca092d2fd 100644 (file)
@@ -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] )
index 038fbf291d39001204011235374d9fefeee3c323..7362935b4cc9c7e6fdb9b9e1b410d0b504a995b5 100644 (file)
@@ -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 */
                
index 466bb178136a530035f1c9a7a1abadbe98e2013e..275cf723dcd686cdf27d49aab1ae6f3a9764f355 100644 (file)
@@ -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... */
index 86cb805c68a080046ddaedc741dd98b1490d7ba9..23d35c804099d435ea5fe1093e802f2d87c6ece0 100644 (file)
@@ -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 */
        }
index e288963553e8fabc94f0e6e35e6d6b21b825de53..7ce25b11f930eb35d33d4cddfd6e895bcae196e5 100644 (file)
@@ -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))
index a43e1705101c4b252f8bcec469829f825c95ef00..bbc9ca3502d207c3e2a2119d7cba8572cae4bcd5 100644 (file)
@@ -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 */
index 8ba86673f87b4ac5c2b9d5dba5690edde2b42178..267e7c05737a3824f87909662b7cc3c3b9eca03a 100644 (file)
@@ -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()
index 8d277d6cd3575a1e6bc1c26d97a53cc0b0e48abb..16e4e6cb9c0ee2da241577769d7f87eb1a060143 100644 (file)
@@ -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')
     
index 456a8a95a58c9e37177a74c2f48233b616ecc277..33f647d1db635fdef4ec34f74f0cfef86cbb0107 100644 (file)
@@ -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);
index b45d14bfa907f60305d6729fd859bc9d8825c5a6..20d7277a94d3433eb7df94d8e2d841df4d2a7e3e 100644 (file)
@@ -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) {
index c51d2cfb2e5d4569dd030327a56065fd9811a154..3180886b2b687787f936a5efd85436714f4471fe 100644 (file)
@@ -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()
index 11c90a4a92297bd484ab3d42661855adb834a887..55ad14a50fc033c4e33157acdb2c38b880f09dde 100644 (file)
@@ -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')
 
index 2538ddfc8865b27f2b2cac41836c244e019fbc50..a46edb1966299482fb5dd3dfbdfd887fa0075eed 100644 (file)
@@ -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);
index df2722f1fbc07e23d3a9b342a78c717420009b31..c15c1d4a4de66c5e1979f8b5704d6f95dfe63d33 100644 (file)
@@ -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
index 043679b9d8a89de2d2aee10608c82101155a7842..790a7eae487fad650d307fccdd633664c58d3b96 100644 (file)
@@ -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 */
 
index a2ac08268e0f1515ac9fbd7948d52d48cc0f18ed..12b68f0e4195e5d9a5a2b690c709684208860478 100644 (file)
@@ -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);
index c9be7d0e5e056b7546218d1cb13915b013233341..b858d715cfe86a180d1687da0380a22fe6c94eab 100644 (file)
@@ -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}")
index 15bcb9a907fc988379fd222c11130c5e6ec06822..9d1de2fc700271a9a5120aec3c6d9891d7c93a1a 100644 (file)
@@ -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'
index 40d0c9536f43f8bd853f2ee9b7c49b2b2b2889cb..88c0060193394e6aa73040b90977e7c433650eb0 100644 (file)
@@ -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);
index eb9a4cb30e4bddbfdc5b0aef2b636baf623dc874..ebd2cc941d09855e2178b03d89d8645e1e97599f 100644 (file)
@@ -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);
index 928930c61f94c3ac3dc363dcc13f695d4c7cdf8c..bc33936b2e3150a1ac43a7fa5f2cf167cf4bbc0b 100644 (file)
@@ -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"
 
 #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)
 {
index 7233d4623d1d3b21569599710388c6f9281b6975..10080c6259449a45ac939a72ebf643cf8d701a0a 100644 (file)
@@ -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}")
index 5250a1264a48ff4c8ac5e1b233322782c3e1d6a1..1f7939598c8385fd04067b0c6af13fa1902f240d 100644 (file)
@@ -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] )
index 698139e90bf4812012f1d64da06670fa7d374bf8..6367ca893d17450acf949ebf2cdcb112437e762f 100644 (file)
@@ -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)
index 98e147413ffaa21c58d9f632f3d670cb30a4864b..b30f008e1bfed39b66aa104c3bdd1a384c54cc29 100644 (file)
@@ -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}")
index c3f8c6667f789c2f4dc518b0a45ade21f47f8f8b..6459f880bc44ba4598db51cf88b65db4ced5adca 100644 (file)
@@ -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'
index 5b21ebf1742b3e2e188bdeb6b4859625b4e252a4..142eb2214a1277fc2ec2b7d5177d78a2af71aed9 100644 (file)
@@ -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 {
index aa3598e8e1f5979c69095caa1853a474152354ae..32fb3850ceeacbaf55ab671df98250ff1d3d6ea5 100644 (file)
@@ -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}")
index 18c6392eee9fb7920c82f44d715cf263ea6cb662..2316f37e661ee691eb892e12dbf3f5105bd12e11 100644 (file)
@@ -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] )
index ad6e66f7a7d42e8398fc80a61f2a0ef032ee8cb6..e2eb1f030b32fc3fa634c831ec3446e8f0814def 100644 (file)
@@ -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 */
index cf56f254c3673725fea32e253d701e692c1beb9c..97581cefc2b2689f87a8521cb0ec5df52bf05f6d 100644 (file)
@@ -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... */
index 35dd88c3209fc2d06496dae39863da0535669051..462619a7e8b1ba9e307afef255402bafe6875bfc 100644 (file)
@@ -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}")
index 578f06ada166e04a08522a1e36b84e69e115df80..b775c5bba59f9c04c122451c680aef824261a00a 100644 (file)
@@ -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] )
index fd1eb7852c13319ff64c287dd4331659e3ed7367..1f071e5f20e3f86344bdd446a595ced9b10e3f2f 100644 (file)
@@ -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);
index 27fd9f5d98e71adbf9f2363ce631141c5650da3b..71bdb6aaf9ead10c9be4c71565f00c353f96c785 100644 (file)
@@ -36,6 +36,8 @@ set(INC_SYS
   ${PNG_INC}
 )
 
+add_definitions(-DWITH_FREESTYLE)
+
 if(WIN32)
   set(INC_SYS ${INC_SYS} ${PTHREADS_INC})
 endif(WIN32)
index 11b45acafaf241bf8b5649c12474d336c329f2d2..d5ccf12d2dbb9f78a1d6d105f36c819faffa8a66 100644 (file)
@@ -3,7 +3,7 @@ import sys
 Import ('env')
 
 sources = []
-defs = []
+defs = ['WITH_FREESTYLE']
 incs = ''
 
 incs += '../blenkernel ../blenloader ../blenlib ../imbuf ../makesdna ../makesrna'
index 638d618d78537b89936ed81dfb626d6289cac38d..c60907060f77bbf0c7946b39df9b9068f66ee873 100644 (file)
@@ -23,4 +23,8 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+if(WITH_FREESTYLE)
+       add_definitions(-DWITH_FREESTYLE)
+endif()
+
 add_subdirectory(intern)
index 476ee4fa36956010bcb4e89dbd3bbf15969a2f11..7b2773a82051bd86e4397f49dad235bfe26a1f77 100644 (file)
@@ -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')
index 94d8ed00cf76ea10cd77619f076984417167c7ea..3f6e6c5913742e1da8d76866b02a91b7cbcc6b30 100644 (file)
@@ -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 */
index 11b93b5fefe80914458d63e836c3e6fa36966ed1..919aa0926163332cbc737457d080bf29ffd112f4 100644 (file)
@@ -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;
index 058be2e2046a37e0504ec3ed1dcd90107b32f6f9..4f47ed76d507d44668c543aafcbe9c60702bd86e 100644 (file)
@@ -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
index bdb1568c73f2e5a63024654614e789e1ad3a7b5e..af1981ae07d9df53f3d6f3856b32a586e4697fc3 100644 (file)
@@ -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)])
index a2eb54bde999d98cbfe7ccb188cb54ef0c11e1d1..26a4105428163eec7885a7f6b21e3c7615f6e753 100644 (file)
@@ -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)
index 2f082afb18962fd5214cffc3d23f6f8ce39de3ab..83d9ed6bf7cf300b11a73f2070ad15c8fab92ace 100644 (file)
@@ -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];
index a6520a6c03e70d7fe82a9de93320cb8a3e9d16ed..d4eabb03b133f00d9898ea17f6e365f052b015ea 100644 (file)
 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] )
index 1dd1d7e8f87f7dbf1048b48a744b870b68bbb4e9..0632564b998e838b3f240c30b2ead9f3e07483fa 100644 (file)
@@ -34,6 +34,9 @@ blender_include_dirs(
        ..
 )
 
+if(WITH_FREESTYLE)
+       add_definitions(-DWITH_FREESTYLE)
+endif()
 
 # -----------------------------------------------------------------------------
 # Build makesdna executable
index add9611866d1998d6b8eb0498a7e36e97b897507..8fd5b67c44b8c94937a64d18fc6ea754b943c2bf 100644 (file)
@@ -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/\\"" ')
index 12df9def3688b7b9be95d0a976830107aca8e0b4..b04052a98efbc574845d95e48a00434a1199bfb9 100644 (file)
@@ -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 */
index ad4ea0161f0edccf8d26311ac1363869f8288570..ce7cb32c6e6e35fc62304ae1dc105aa5b30692b9 100644 (file)
@@ -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;
index 071c1fae4efa25248627362a52a1fc58e7787105..75bb3475feda381a4394912ae2b31b2bd8e5b938 100644 (file)
@@ -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;
index b012f6c96a21259d74cb20ceaf83fc1a1d8a7a8d..464939dc8797ab118abfea742a8813177d456147 100644 (file)
@@ -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')
index 24bf6ff4aa1ed73ad30acc7de7f726cafa3ef143..a8b9b779ff84852618bf0ad7e6d016c6ae23d45b 100644 (file)
@@ -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}
 )
index 5d60d416cc45eb7201bd303fd33d0fb457031dca..11562d729df5224aef98c82c45e960d83666a94b 100644 (file)
@@ -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')
 
index 333cdeabfa4aaa4c948bb37bdabd328221226123..1b5ab2ea600a4640c8582f997e679f51a868eb2e 100644 (file)
@@ -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},
index 5efd162fe026b797c4010f44c0d8bf53fde1df93..092c9eb2b1762161e3d4addb760234f74f459742 100644 (file)
@@ -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;
index 85af307394532fb3fa4e27f060ab456598f7eaee..06c01012e198a467b255726bc5f40861f9abff65 100644 (file)
@@ -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);
index 361f4a0166164f7af27196d05c3b847a9997d786..851ae69ed3f54d3b42f9dfffce45af0df1165530 100644 (file)
@@ -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;
                }
index fbb5dd569cc991fd5034d81edc15e5a5501d2c57..636be933cedc20c66eb4e0f7a9973e772b0bd7c6 100644 (file)
@@ -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 */
 
index ca4609f88c826333c8d9bcf79bd294db47a584a8..32db099c0c0b1e131a6317453a1e4719751e4023 100644 (file)
@@ -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}
        };
 
index 48db12ce14e6f3be71eb5cb5105dda5dc17f3adf..90cc81007182a563bd9110560f3bcda57df11dfb 100644 (file)
@@ -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
index bc67bf2da35d5251bcd672e6b8480b431fda9c13..abc0b65a8f8e45ec7f5e66b700e3eb47bd0ad7f0 100644 (file)
@@ -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);
index a0a55c663e97781d00008420a7ea526bed154f18..ce387952947c0f22a07eccf45fdc9ddc8272664b 100644 (file)
@@ -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);
index 46d0744cad702f70acf6ce2358c82063bd134af4..e3eacb40e839102732193925907a013dff8e9255 100644 (file)
@@ -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)
index 21af50dbf10739297ca254b6f5da4bd866fbc597..ddb8594de79048de369e6d30bd51d78a5cd77f23 100644 (file)
@@ -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')
 
index d0af637105963ad0098b68cf4e20b448dc81e43d..f39e170c4815a694311942c4aaf81b0f3a3bb47d 100644 (file)
@@ -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},
 
index b2ce33b08c7c997779cda59da042be1e4b642da3..8f90a823668db34aa1f2928af1d2c31964c61a10 100644 (file)
@@ -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()
index b0dd8a29fbed0874eb9fd7b5e46d9abf749bf85f..4f932ac68ff3b59326d208b6b3840bd995630dda 100644 (file)
@@ -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");
 
index 607613b592cd7941c21406c5b6cd2d727637c725..74df3ef7307eb61a3875cfe167eda727c8c40fda 100644 (file)
@@ -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
index 291ee8e44bd345d4f7ce0509603a33be54a6b31c..16cba944e015ca8f71583bf579b8945e7b74e12c 100644 (file)
@@ -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
index 0fd180fed658c67ee34552302537722fc75c95f8..c4309577ae91f6aafac2518353d300ca843c5c59 100644 (file)
@@ -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')
 
index 56cc0ad9a1c7e60c714a76605bd511696d041397..020fa57cf94c14280e220af29551c0f1554814d0 100644 (file)
@@ -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);
index 45080de3148675f48ab46b2f89807490bbc3fad9..c45c6dfc1bce9c654cae8dec382860a781f90b31 100644 (file)
@@ -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
index bc84661698fcc315031036344e9b014194c521ec..08da5dff3e05a80b9705f3329f59d40958c57b1a 100644 (file)
@@ -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;
index 39df6a01f61f8441a44d4a5509404157f5f62a4c..c7c5fcf354f21f4f8751c90db91f696482f1747b 100644 (file)
@@ -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"
 #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)
 {
index eb330177bacd4f43074912dc2c851651b05bcbb6..1d84f0e5a9423d444fd693c16bebd8d9291902f5 100644 (file)
@@ -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;
        }
index a425d9a330bc35bcaa92d8a5b5662edcf2e2a67b..c9c8501a3a47d3bd4007342c1cdd1f382d52043d 100644 (file)
@@ -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];
index ffeb7aff6fa825417b7f1121e5e71463980047f4..8ec61a62d4926c537fd9c92cdb787934bda48227 100644 (file)
@@ -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()
index 3702a2d909c838e8569c309f1a637f098f986591..5904a417190ae14c1b1075d2b8c9cf9249bb7d68 100644 (file)
@@ -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")
 
index c88011aab13f1542efe9bbe48f605915b62db1ea..2cb19ccdf097d1b132315ecb2c10d579527c22e1 100644 (file)
@@ -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
index 20b205a642ab6c0505bbbdba1cf2d6e2565fb919..918068cc7d1ec54a39732c1ad5a205da7da2a876 100644 (file)
 #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);
index afd5f5b0177a0d5d213b4170e114c67ff0ae37a1..702210d1c5ff48f2db161f16b1af5b984fad82f2 100644 (file)
@@ -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}")
index f26f4dfea6b6501d152de88091ec97e88f4e1705..41c84051fdfd3e336997ae589f4c41a13041bc6f 100644 (file)
@@ -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] )
index 014fefb8219c0ca939293f434a41d2c7a9a04b74..f394290d952abeada506689f81bc76e8fbb72299 100644 (file)
@@ -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,
index 67bf9599baf9886c51949c0d74672af208eca46d..e0a380969040da4f04d818dc71bcda0ed349e457 100644 (file)
@@ -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
index 3bf02298ddf9f3a041fe479c4aa4ec4136cddeb3..bc8ed91dc054f5aa21223d8440a790a70f48a2e2 100644 (file)
 
 #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