Another big patch set by Bastien Montagne, thanks a lot!

* Made Freestyle optional (turned on by default).

* Fix for missing bpath.c updates in the previous merge of trunk changes.
This commit is contained in:
2012-12-20 07:57:26 +00:00
parent d433cd65f7
commit a462d69bbf
134 changed files with 877 additions and 174 deletions

View 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)

View 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):]

View 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

View 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']

View 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']

View 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']

View 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++'

View 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']

View 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++'

View 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'

View 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++'

View 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'

View 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')

View 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', ''),

View 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,15 +43,17 @@ _modules = (
"vertexpaint_dirt",
"view3d",
"wm",
)
__import__(name=__name__, fromlist=_modules)
_namespace = globals()
_modules_loaded = {name: _namespace[name] for name in _modules}
del _namespace
]
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 if name != 'bpy'}
del _namespace
def register():
bpy.utils.register_module(__name__)

View 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'}

View 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)

View 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:")

View 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()

View 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'])

View 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"

View 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}")

View 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] )

View File

@@ -27,11 +27,14 @@
#ifndef __BKE_LINESTYLE_H__
#define __BKE_LINESTYLE_H__
/** \file BKE_linestyle.h
* \ingroup bke
* \brief Blender kernel freestyle line style functionality.
*/
#ifdef WITH_FREESTYLE
#include "DNA_linestyle_types.h"
#define LS_MODIFIER_TYPE_COLOR 1
@@ -71,4 +74,6 @@ char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *c
void FRS_unlink_linestyle_target_object(FreestyleLineStyle *linestyle, struct Object *ob);
#endif
#endif /* WITH_FREESTYLE */
#endif /* __BKE_LINESTYLE_H__ */

View 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;

View 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")

View 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']

View 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

View 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:

View 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
}
}

View 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 },

View File

@@ -109,7 +109,9 @@
#include "BKE_speaker.h"
#include "BKE_movieclip.h"
#include "BKE_mask.h"
#include "BKE_linestyle.h"
#ifdef WITH_FREESTYLE
# include "BKE_linestyle.h"
#endif
#include "RNA_access.h"
@@ -277,8 +279,10 @@ int id_make_local(ID *id, int test)
return 0; /* can't be linked */
case ID_GD:
return 0; /* not implemented */
#ifdef WITH_FREESTYLE
case ID_LS:
return 0; /* not implemented */
#endif
}
return 0;
@@ -373,9 +377,11 @@ int id_copy(ID *id, ID **newid, int test)
case ID_MSK:
if (!test) *newid = (ID *)BKE_mask_copy((Mask *)id);
return 1;
#ifdef WITH_FREESTYLE
case ID_LS:
if(!test) *newid= (ID*)FRS_copy_linestyle((FreestyleLineStyle*)id);
return 1;
#endif
}
return 0;
@@ -506,8 +512,10 @@ ListBase *which_libbase(Main *mainlib, short type)
return &(mainlib->movieclip);
case ID_MSK:
return &(mainlib->mask);
#ifdef WITH_FREESTYLE
case ID_LS:
return &(mainlib->linestyle);
#endif
}
return NULL;
}
@@ -592,7 +600,9 @@ int set_listbasepointers(Main *main, ListBase **lb)
lb[a++] = &(main->wm);
lb[a++] = &(main->movieclip);
lb[a++] = &(main->mask);
#ifdef WITH_FREESTYLE
lb[a++] = &(main->linestyle);
#endif
lb[a] = NULL;
@@ -707,9 +717,11 @@ static ID *alloc_libblock_notest(short type)
case ID_MSK:
id = MEM_callocN(sizeof(Mask), "Mask");
break;
#ifdef WITH_FREESTYLE
case ID_LS:
id = MEM_callocN(sizeof(FreestyleLineStyle), "Freestyle Line Style");
break;
#endif
}
return id;
}
@@ -934,9 +946,11 @@ void BKE_libblock_free(ListBase *lb, void *idv)
case ID_MSK:
BKE_mask_free(bmain, (Mask *)id);
break;
#ifdef WITH_FREESTYLE
case ID_LS:
FRS_free_linestyle((FreestyleLineStyle *)id);
break;
#endif
}
BLI_remlink(lb, id);

View 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;

View File

@@ -115,7 +115,9 @@
#include "GPU_material.h"
#include "FRS_freestyle.h"
#ifdef WITH_FREESTYLE
# include "FRS_freestyle.h"
#endif
/* Local function protos */
float originmat[3][3]; /* after BKE_object_where_is_calc(), can be used in other functions (bad!) */
@@ -635,6 +637,7 @@ void BKE_object_unlink(Object *ob)
SEQ_END
}
#ifdef WITH_FREESTYLE
{
SceneRenderLayer *srl;
@@ -642,6 +645,7 @@ void BKE_object_unlink(Object *ob)
FRS_unlink_target_object(&srl->freestyleConfig, ob);
}
}
#endif
}
sce = sce->id.next;

View 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;
}

View 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 {

View 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

View 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'

View 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}")

View 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:

View 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;

View File

@@ -108,7 +108,9 @@
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_lamp_types.h"
#include "DNA_linestyle_types.h"
#ifdef WITH_FREESTYLE
# include "DNA_linestyle_types.h"
#endif
#include "DNA_meta_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -2160,8 +2162,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
TimeMarker *marker;
TransformOrientation *ts;
SceneRenderLayer *srl;
FreestyleModuleConfig *fmc;
FreestyleLineSet *fls;
ToolSettings *tos;
sce= scebase->first;
@@ -2289,14 +2289,21 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
for (srl = sce->r.layers.first; srl; srl = srl->next) {
writestruct(wd, DATA, "SceneRenderLayer", 1, srl);
for(fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
writestruct(wd, DATA, "FreestyleModuleConfig", 1, fmc);
}
for(fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
writestruct(wd, DATA, "FreestyleLineSet", 1, fls);
}
#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);
}
}
#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) {

View 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}")

View 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 )

View 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

View 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
);
}

View 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 */

View 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);
}

View 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}")

View 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] )

View 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 */

View 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... */

View 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 */
}

View 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))

View 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 */

View 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()

View 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')

View 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);

View 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) {

View 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()

View 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')

View 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);

View 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

View 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 */

View 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);

View 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}")

View 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'

View 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);

View 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);

View 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"
@@ -70,7 +69,10 @@
#include "GPU_material.h"
#include "FRS_freestyle.h"
#ifdef WITH_FREESTYLE
# include "BKE_linestyle.h"
# include "FRS_freestyle.h"
#endif
#include "RNA_access.h"
#include "RNA_enum_types.h"
@@ -574,6 +576,7 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
#ifdef WITH_FREESTYLE
static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
@@ -1187,6 +1190,7 @@ void SCENE_OT_freestyle_modifier_move(wmOperatorType *ot)
/* props */
RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to move, UP or DOWN");
}
#endif
static int texture_slot_move(bContext *C, wmOperator *op)
{

View 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}")

View 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] )

View 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)

View 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}")

View 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'

View 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 {

View 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}")

View 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] )

View 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 */

View 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... */

View 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}")

View 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] )

View 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);

View 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)

View File

@@ -3,7 +3,7 @@ import sys
Import ('env')
sources = []
defs = []
defs = ['WITH_FREESTYLE']
incs = ''
incs += '../blenkernel ../blenloader ../blenlib ../imbuf ../makesdna ../makesrna'

View File

@@ -23,4 +23,8 @@
#
# ***** END GPL LICENSE BLOCK *****
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
add_subdirectory(intern)

View 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')

View 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 */

View 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;

View 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

View 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)])

View 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)

View 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];

View File

@@ -28,10 +28,14 @@
Import ('env')
objs = []
defs = []
o = SConscript('intern/SConscript')
objs += o
incs = '#/intern/guardedalloc .'
env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215,200] )
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
env.BlenderLib ( 'bf_dna', objs, Split(incs), defs, libtype=['core','player'], priority = [215,200] )

View File

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

View 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/\\"" ')

View 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 */

View 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;

View 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;

View 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')

Some files were not shown because too many files have changed in this diff Show More