Merged changes in the trunk up to revision 44797.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 10 Mar 2012 21:56:23 +0000 (21:56 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 10 Mar 2012 21:56:23 +0000 (21:56 +0000)
Conflicts resolved:
doc/python_api/sphinx_doc_gen.py
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_mesh.c

63 files changed:
1  2 
doc/python_api/sphinx_doc_gen.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/group.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/BLI_editVert.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/operators/bmo_utils.c
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/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_orientations.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/CMakeLists.txt
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/intern/bpy.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/WM_types.h
source/blender/windowmanager/intern/wm_files.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c

index 2b07b0c3611a77e43add13c6b02ae7119b707bf4,d8407121ae1f3b5c9cbe313656c92b533b5dc38b..b9444f35e1216565bb983de7d433d764671575c0
@@@ -115,22 -212,24 +212,25 @@@ else
          "mathutils",
          "mathutils.geometry",
          "mathutils.noise",
-         #"bmesh",
-         #"bmesh.types",
-         #"bmesh.utils",
 +        "Freestyle",
      )
  
-     FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID")  # allow
-     FILTER_BPY_OPS = ("import.scene", )  # allow
+ try:
+     __import__("aud")
+ except ImportError:
+     print("Warning: Built without 'aud' module, docs incomplete...")
+     EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", )
  
-     # for quick rebuilds
-     """
- rm -rf /b/doc/python_api/sphinx-* && \
- ./blender.bin --background -noaudio --factory-startup --python  doc/python_api/sphinx_doc_gen.py && \
- sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
+ # examples
+ EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples"))
+ EXAMPLE_SET = set()
+ for f in os.listdir(EXAMPLES_DIR):
+     if f.endswith(".py"):
+         EXAMPLE_SET.add(os.path.splitext(f)[0])
+ EXAMPLE_SET_USED = set()
  
-     """
+ #rst files dir
+ RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
  
  # extra info, not api reference docs
  # stored in ./rst/info_*
@@@ -1220,33 -1346,17 +1354,17 @@@ def write_rst_contents(basepath)
      fw(".. toctree::\n")
      fw("   :maxdepth: 1\n\n")
  
-     # mathutils
-     if "mathutils" not in EXCLUDE_MODULES:
-         fw("   mathutils.rst\n\n")
-     if "mathutils.geometry" not in EXCLUDE_MODULES:
-         fw("   mathutils.geometry.rst\n\n")
-     if "mathutils.noise" not in EXCLUDE_MODULES:
-         fw("   mathutils.noise.rst\n\n")
-     # misc
-     if "Freestyle" not in EXCLUDE_MODULES:
-         fw("   Freestyle.rst\n\n")
-     if "bgl" not in EXCLUDE_MODULES:
-         fw("   bgl.rst\n\n")
-     if "blf" not in EXCLUDE_MODULES:
-         fw("   blf.rst\n\n")
-     if "gpu" not in EXCLUDE_MODULES:
-         fw("   gpu.rst\n\n")
-     if "aud" not in EXCLUDE_MODULES:
-         fw("   aud.rst\n\n")
-     if "bpy_extras" not in EXCLUDE_MODULES:
-         fw("   bpy_extras.rst\n\n")
-     # bmesh
-     if "bmesh" not in EXCLUDE_MODULES:
-         fw("   bmesh.rst\n\n")
-     if "bmesh.types" not in EXCLUDE_MODULES:
-         fw("   bmesh.types.rst\n\n")
-     if "bmesh.utils" not in EXCLUDE_MODULES:
-         fw("   bmesh.utils.rst\n\n")
+     standalone_modules = [
+         # mathutils
+         "mathutils", "mathutils.geometry", "mathutils.noise",
+         # misc
 -        "bgl", "blf", "gpu", "aud", "bpy_extras",
++        "Freestyle", "bgl", "blf", "gpu", "aud", "bpy_extras",
+         # bmesh
+         "bmesh", "bmesh.types", "bmesh.utils"
+     ]
+     for mod in standalone_modules:
+         if mod not in EXCLUDE_MODULES:
+             fw("   %s\n\n" % mod)
  
      # game engine
      if "bge" not in EXCLUDE_MODULES:
@@@ -1334,220 -1477,151 +1485,152 @@@ def write_rst_data(basepath)
          fw(".. literalinclude:: ../examples/bpy.data.py\n")
          file.close()
  
-     EXAMPLE_SET_USED.add("bpy.data")
+         EXAMPLE_SET_USED.add("bpy.data")
  
-     module = None
  
-     if "bpy.context" not in EXCLUDE_MODULES:
-         # one of a kind, context doc (uses ctypes to extract info!)
-         # doesn't work on mac
-         if PLATFORM != "darwin":
-             pycontext2sphinx(BASEPATH)
-     # python modules
-     if "bpy.utils" not in EXCLUDE_MODULES:
-         from bpy import utils as module
-         pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities")
-     if "bpy.path" not in EXCLUDE_MODULES:
-         from bpy import path as module
-         pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities")
-     if "bpy_extras" not in EXCLUDE_MODULES:
-         import bpy_extras as module
-         pymodule2sphinx(BASEPATH, "bpy_extras", module, "Extra Utilities")
-     # C modules
-     if "bpy.app" not in EXCLUDE_MODULES:
-         from bpy import app as module
-         pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
-     if "bpy.app.handlers" not in EXCLUDE_MODULES:
-         from bpy.app import handlers as module
-         pymodule2sphinx(BASEPATH, "bpy.app.handlers", module, "Application Handlers")
-     if "bpy.props" not in EXCLUDE_MODULES:
-         from bpy import props as module
-         pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions")
-     if "mathutils" not in EXCLUDE_MODULES:
-         import mathutils as module
-         pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities")
-     if "mathutils.geometry" not in EXCLUDE_MODULES:
-         import mathutils.geometry as module
-         pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities")
-     if "mathutils.noise" not in EXCLUDE_MODULES:
-         import mathutils.noise as module
-         pymodule2sphinx(BASEPATH, "mathutils.noise", module, "Noise Utilities")
-     if "bmesh" not in EXCLUDE_MODULES:
-         import bmesh as module
-         pymodule2sphinx(BASEPATH, "bmesh", module, "BMesh Module")
-     if "bmesh.types" not in EXCLUDE_MODULES:
-         import bmesh.types as module
-         pymodule2sphinx(BASEPATH, "bmesh.types", module, "BMesh Types")
-     if "bmesh.utils" not in EXCLUDE_MODULES:
-         import bmesh.utils as module
-         pymodule2sphinx(BASEPATH, "bmesh.utils", module, "BMesh Utilities")
-     if "Freestyle" not in EXCLUDE_MODULES:
-         import Freestyle as module
-         pymodule2sphinx(BASEPATH, "Freestyle", module, "Freestyle Data Types & Operators")
-     if "blf" not in EXCLUDE_MODULES:
-         import blf as module
-         pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing")
-     if "bgl" not in EXCLUDE_MODULES:
-         #import bgl as module
-         #pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
-         #del module
-         shutil.copy2(os.path.join(RST_DIR, "bgl.rst"), BASEPATH)
-     if "gpu" not in EXCLUDE_MODULES:
-         #import gpu as module
-         #pymodule2sphinx(BASEPATH, "gpu", module, "GPU Shader Module")
-         #del module
-         shutil.copy2(os.path.join(RST_DIR, "gpu.rst"), BASEPATH)
-     if "aud" not in EXCLUDE_MODULES:
-         import aud as module
-         pymodule2sphinx(BASEPATH, "aud", module, "Audio System")
-     del module
-     ## game engine
-     # copy2 keeps time/date stamps
-     if "bge" not in EXCLUDE_MODULES:
-         shutil.copy2(os.path.join(RST_DIR, "bge.types.rst"), BASEPATH)
-         shutil.copy2(os.path.join(RST_DIR, "bge.logic.rst"), BASEPATH)
-         shutil.copy2(os.path.join(RST_DIR, "bge.render.rst"), BASEPATH)
-         shutil.copy2(os.path.join(RST_DIR, "bge.texture.rst"), BASEPATH)
-         shutil.copy2(os.path.join(RST_DIR, "bge.events.rst"), BASEPATH)
-         shutil.copy2(os.path.join(RST_DIR, "bge.constraints.rst"), BASEPATH)
+ def write_rst_importable_modules(basepath):
+     '''
+     Write the rst files of importable modules
+     '''
+     importable_modules = {
+         # python_modules
+         "bpy.path"          : "Path Utilities",
+         "bpy.utils"         : "Utilities",
+         "bpy_extras"        : "Extra Utilities",
+         # C_modules
+         "aud"               : "Audio System",
+         "blf"               : "Font Drawing",
+         "bmesh"             : "BMesh Module",
+         "bmesh.types"       : "BMesh Types",
+         "bmesh.utils"       : "BMesh Utilities",
+         "bpy.app"           : "Application Data",
+         "bpy.app.handlers"  : "Application Handlers",
+         "bpy.props"         : "Property Definitions",
+         "mathutils"         : "Math Types & Utilities",
+         "mathutils.geometry": "Geometry Utilities",
+         "mathutils.noise"   : "Noise Utilities",
++        "Freestyle"         : "Freestyle Data Types & Operators",
+     }
+     for mod_name, mod_descr in importable_modules.items():
+         if mod_name not in EXCLUDE_MODULES:
+             module = __import__(mod_name,
+                                 fromlist=[mod_name.rsplit(".", 1)[-1]])
+             pymodule2sphinx(basepath, mod_name, module, mod_descr)
  
-     shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), BASEPATH)
  
+ def copy_handwritten_rsts(basepath):
+     # info docs
      if not EXCLUDE_INFO_DOCS:
          for info, info_desc in INFO_DOCS:
-             shutil.copy2(os.path.join(RST_DIR, info), BASEPATH)
+             shutil.copy2(os.path.join(RST_DIR, info), basepath)
+     # TODO put this docs in blender's code and use import as per modules above
+     handwritten_modules = [
+         "bge.types",
+         "bge.logic",
+         "bge.render",
+         "bge.texture",
+         "bge.events",
+         "bge.constraints",
+         "bgl",  # "Blender OpenGl wrapper"
+         "gpu",  # "GPU Shader Module"
+     ]
+     for mod_name in handwritten_modules:
+         if mod_name not in EXCLUDE_MODULES:
+             # copy2 keeps time/date stamps
+             shutil.copy2(os.path.join(RST_DIR, "%s.rst" % mod_name), basepath)
+     # changelog
+     shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), basepath)
+ def rna2sphinx(basepath):
  
-     if 0:
-         filepath = os.path.join(BASEPATH, "bpy.rst")
-         file = open(filepath, "w", encoding="utf-8")
-         fw = file.write
-         fw("\n")
+     try:
+         os.mkdir(basepath)
+     except:
+         pass
  
-         title = ":mod:`bpy` --- Blender Python Module"
+     # sphinx setup
+     write_sphinx_conf_py(basepath)
  
-         write_title(fw, title, "=")
+     # main page
+     write_rst_contents(basepath)
  
-         fw(".. module:: bpy.types\n\n")
-         file.close()
+     # context
+     if "bpy.context" not in EXCLUDE_MODULES:
+         # one of a kind, context doc (uses ctypes to extract info!)
+         # doesn't work on mac
+         if PLATFORM != "darwin":
+             pycontext2sphinx(basepath)
  
-     # bpy.types and bpy.ops
-     pyrna2sphinx(BASEPATH)
+     # internal modules
+     write_rst_bpy(basepath)                 # bpy, disabled by default
+     write_rst_types_index(basepath)         # bpy.types
+     write_rst_ops_index(basepath)           # bpy.ops
+     pyrna2sphinx(basepath)                  # bpy.types.* and bpy.ops.*
+     write_rst_data(basepath)                # bpy.data
+     write_rst_importable_modules(basepath)
  
-     file.close()
+     # copy the other rsts
+     copy_handwritten_rsts(basepath)
  
  
- def handle_args():
+ def align_sphinx_in_to_sphinx_in_tmp():
      '''
-     get the args passed to blender after "--", all of which are ignored by blender
-     
-     we can give the path of sphinx-in after '--', using for example:
-     ./cmake/bin/blender -b -P ./blender/doc/python_api/sphinx_doc_gen.py -- ./python_api
+     Move changed files from SPHINX_IN_TMP to SPHINX_IN
      '''
-     
-     import argparse  # to parse options for us and print a nice help message
-     
-     # When --help or no args are given, print the usage text
-     parser = argparse.ArgumentParser(
-                                      formatter_class=argparse.RawDescriptionHelpFormatter,
-                                      usage=script_help_msg)
-     
-     # output dir for apidocs 
-     parser.add_argument("-o", "--output",
-                         dest="output_dir",
-                         type=str,
-                         required=False,
-                         help="Path of API docs directory (optional)")
-             
-     argv = []
-     if "--" in sys.argv:
-         argv = sys.argv[sys.argv.index("--") + 1:]  # get all args after "--"
-     
-     return parser.parse_args(argv)
- def main():
-     
-     args = handle_args()
-     
-     # output dirs
-     if args.output_dir:
-         output_dir = args.output_dir
-         if not os.path.exists(args.output_dir):
-             os.mkdir(args.output_dir)
-     else:
-         output_dir = SCRIPT_DIR
-     sphinx_in_dir = os.path.join(output_dir, "sphinx-in")
-     sphinx_out_dir = os.path.join(output_dir, "sphinx-out")
-     # only for partial updates
-     sphinx_in_tmp_dir = sphinx_in_dir + "-tmp"
-     if not os.path.exists(sphinx_in_dir):
-         os.mkdir(sphinx_in_dir)
+     import filecmp
  
-     for f in os.listdir(EXAMPLES_DIR):
-         if f.endswith(".py"):
-             EXAMPLE_SET.add(os.path.splitext(f)[0])
-     # only for full updates
-     if _BPY_FULL_REBUILD:
-         shutil.rmtree(sphinx_in_dir, True)
-         shutil.rmtree(sphinx_out_dir, True)
-     else:
-         # write here, then move
-         shutil.rmtree(sphinx_in_tmp_dir, True)
+     sphinx_in_files = set(os.listdir(SPHINX_IN))
+     sphinx_in_tmp_files = set(os.listdir(SPHINX_IN_TMP))
  
-     rna2sphinx(sphinx_in_tmp_dir)
+     # remove deprecated files that have been removed
+     for f in sorted(sphinx_in_files):
+         if f not in sphinx_in_tmp_files:
+             print("\tdeprecated: %s" % f)
+             os.remove(os.path.join(SPHINX_IN, f))
  
-     if not _BPY_FULL_REBUILD:
-         import filecmp
+     # freshen with new files.
+     for f in sorted(sphinx_in_tmp_files):
+         f_from = os.path.join(SPHINX_IN_TMP, f)
+         f_to = os.path.join(SPHINX_IN, f)
  
-         # now move changed files from 'sphinx_in_tmp_dir' --> 'sphinx_in_dir'
-         file_list_sphinx_in_dir = set(os.listdir(sphinx_in_dir))
-         file_list_sphinx_in_tmp_dir = set(os.listdir(sphinx_in_tmp_dir))
+         do_copy = True
+         if f in sphinx_in_files:
+             if filecmp.cmp(f_from, f_to):
+                 do_copy = False
  
-         # remove deprecated files that have been removed.
-         for f in sorted(file_list_sphinx_in_dir):
-             if f not in file_list_sphinx_in_tmp_dir:
-                 print("\tdeprecated: %s" % f)
-                 os.remove(os.path.join(sphinx_in_dir, f))
+         if do_copy:
+             print("\tupdating: %s" % f)
+             shutil.copy(f_from, f_to)
  
-         # freshen with new files.
-         for f in sorted(file_list_sphinx_in_tmp_dir):
-             f_from = os.path.join(sphinx_in_tmp_dir, f)
-             f_to = os.path.join(sphinx_in_dir, f)
  
-             do_copy = True
-             if f in file_list_sphinx_in_dir:
-                 if filecmp.cmp(f_from, f_to):
-                     do_copy = False
+ def main():
  
-             if do_copy:
-                 print("\tupdating: %s" % f)
-                 shutil.copy(f_from, f_to)
-             '''else:
-                 print("\tkeeping: %s" % f) # eh, not that useful'''
+     # dirs preparation
+     for dir_path in [ARGS.output_dir, SPHINX_IN]:
+         if not os.path.exists(dir_path):
+             os.mkdir(dir_path)
+     # dump the api in rst files
+     if ARGS.full_rebuild:
+         # only for full updates
+         shutil.rmtree(SPHINX_IN, True)
+         shutil.rmtree(SPHINX_OUT, True)
+         rna2sphinx(SPHINX_IN_TMP)
+         shutil.copytree(SPHINX_IN_TMP,
+                         SPHINX_IN,
+                         copy_function=shutil.copy)
+     else:
+         # write here, then move
+         shutil.rmtree(SPHINX_IN_TMP, True)
+         rna2sphinx(SPHINX_IN_TMP)
+         align_sphinx_in_to_sphinx_in_tmp()
  
+     # report which example files weren't used
      EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
      if EXAMPLE_SET_UNUSED:
          print("\nUnused examples found in '%s'..." % EXAMPLES_DIR)
Simple merge
Simple merge
Simple merge
index 09a7d92baa8378a373b94d235599d9b6acacefab,517ba303a1a69914285b0e01d59227b7401b9449..22da276fcadc70cce64f13b737a14b2662d040c7
@@@ -13439,29 -13234,21 +13423,43 @@@ static void do_versions(FileData *fd, L
                        do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree);
        }
  
+       /* put compatibility code here until next subversion bump */
+       {
+               {
+                       /* Set new idname of keyingsets from their now "label-only" name. */
+                       Scene *scene;
+                       for (scene = main->scene.first; scene; scene = scene->id.next) {
+                               KeyingSet *ks;
+                               for (ks = scene->keyingsets.first; ks; ks = ks->next) {
+                                       if (!ks->idname[0])
+                                               BLI_strncpy(ks->idname, ks->name, sizeof(ks->idname));
+                               }
+                       }
+               }
+       }
  
 +      /* default values in Freestyle settings */
 +      {
 +              Scene *sce;
 +              SceneRenderLayer *srl;
 +              FreestyleLineStyle *linestyle;
 +
 +              for(sce = main->scene.first; sce; sce = sce->id.next) {
 +                      for(srl= sce->r.layers.first; srl; srl= srl->next) {
 +                              if (srl->freestyleConfig.mode == 0)
 +                                      srl->freestyleConfig.mode= FREESTYLE_CONTROL_EDITOR_MODE;
 +                              if (srl->freestyleConfig.raycasting_algorithm == 0)
 +                                      srl->freestyleConfig.raycasting_algorithm= FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE;
 +                      }
 +              }
 +              for(linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
 +                      if (linestyle->chaining == 0)
 +                              linestyle->chaining= LS_CHAINING_PLAIN;
 +                      if (linestyle->rounds == 0)
 +                              linestyle->rounds= 3;
 +              }
 +      }
 +      
        /* 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! */
  
Simple merge
index fd978cf8fef928a0495f9f2b1f389f0f3ee2a627,43fde303dcd9e0aa76db67450ca6b15487c05a97..925e8703577ae4c3123341b63a43bf1ddb58567e
@@@ -2504,17 -2508,18 +2519,18 @@@ static DMDrawOption draw_dm_faces_sel__
        
        if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
                if (efa == data->efa_act) {
 -                      glColor4ubv(data->cols[2]);
 +                      glColor4ubv(data->cols[3]);
-                       return 2; /* stipple */
+                       return DM_DRAW_OPTION_STIPPLE;
                }
                else {
 -                      col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT)?1:0];
 +                      col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT)?1:BM_elem_flag_test(efa, BM_ELEM_FREESTYLE)?2:0];
-                       if (col[3]==0) return 0;
+                       if (col[3]==0)
+                               return DM_DRAW_OPTION_SKIP;
                        glColor4ubv(col);
-                       return 1;
+                       return DM_DRAW_OPTION_NORMAL;
                }
        }
-       return 0;
+       return DM_DRAW_OPTION_SKIP;
  }
  
  static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int next_index)
Simple merge
index be7ada5c5f10f9ba5f0a6bbc239545d681fcbbf5,48704fe43d418c0d9525cc6cc5f31e54e4e8e59e..4c57cd211dd7e7fc60310dffdc3f1396bfe797b2
@@@ -194,30 -194,6 +194,9 @@@ typedef struct TFace 
  /* debug only option */
  #define ME_DRAWEXTRA_INDICES (1 << 13)
  
- /* old global flags:
- #define G_DRAWEDGES           (1 << 18)
- #define G_DRAWFACES           (1 <<  7)
- #define G_DRAWNORMALS (1 <<  6)
- #define G_DRAW_VNORMALS       (1 << 14)
- #define G_ALLEDGES            (1 << 11)
- #define G_HIDDENEDGES   (1 << 21)
- #define G_DRAWCREASES (1 << 19)
- #define G_DRAWSEAMS     (1 << 20)
- #define G_DRAWSHARP     (1 << 28)
- #define G_DRAWBWEIGHTS        (1 << 31)
- #define G_DRAW_EDGELEN  (1 << 22) 
- #define G_DRAW_FACEAREA (1 << 23)
- #define G_DRAW_EDGEANG  (1 << 24)
- */
 +#define ME_DRAW_FREESTYLE_EDGE (1 << 14)
 +#define ME_DRAW_FREESTYLE_FACE (1 << 15)
 +
  /* Subsurf Type */
  #define ME_CC_SUBSURF                 0
  #define ME_SIMPLE_SUBSURF     1
index 917cac0196ca8c630e123dc5abfaea77f906864c,bb541471a19e54cf89dd5e5b1caffb328795e8f5..41775978026ecb39b8714eeeea431c323f4cf2a2
@@@ -117,35 -116,34 +117,35 @@@ static int rna_ID_name_editable(Pointer
  
  short RNA_type_to_ID_code(StructRNA *type)
  {
-       if(RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
-       if(RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
-       if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
-       if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
-       if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
-       if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
-       if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
-       if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
-       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;
-       if(RNA_struct_is_a(type, &RNA_FreestyleLineStyle)) return ID_LS;
-       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;
-       if(RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
-       if(RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
-       if(RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
-       if(RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
-       if(RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
-       if(RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
-       if(RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
-       if(RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
-       if(RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
-       if(RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
-       if(RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
-       if(RNA_struct_is_a(type, &RNA_World)) return ID_WO;
-       if(RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
-       if(RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
+       if (RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
+       if (RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
+       if (RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
+       if (RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
+       if (RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
+       if (RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
+       if (RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
+       if (RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
+       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;
++      if (RNA_struct_is_a(type, &RNA_FreestyleLineStyle)) return ID_LS;
+       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;
+       if (RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
+       if (RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
+       if (RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
+       if (RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
+       if (RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
+       if (RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
+       if (RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
+       if (RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
+       if (RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
+       if (RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
+       if (RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
+       if (RNA_struct_is_a(type, &RNA_World)) return ID_WO;
+       if (RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
+       if (RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
  
        return 0;
  }
index 6d83873bd2c547546f00d55b2db3d94347ae1451,829b1ae1f13164f00c7b9bc15f9b2b479823b55a..3df868f9afee9c0420f3e0a7130dfd9bf107c23a
@@@ -369,13 -369,7 +369,13 @@@ static void rna_def_dopesheet(BlenderRN
        RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
        RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
        
-       prop= RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE);
++      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);
 +      
-       prop= RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
        RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
        RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
index 212088849ec905aac2029ad6255a8cb1610cf293,5dd6bbbe1679aa2cc0f15f6df47f62035b349107..816ddc2758d35d27dec4c68be1cba28abb146bb4
@@@ -1336,12 -1394,7 +1394,12 @@@ static void rna_def_medge(BlenderRNA *b
        RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
  
-       prop= RNA_def_property(srna, "use_freestyle_edge_mark", PROP_BOOLEAN, PROP_NONE);
++      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");
 +
-       prop= RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE);
        RNA_def_property_ui_text(prop, "Loose", "Loose edge");
  
@@@ -1400,13 -1453,8 +1458,13 @@@ static void rna_def_mface(BlenderRNA *b
        RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
        RNA_def_property_ui_text(prop, "Smooth", "");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-       prop= RNA_def_property(srna, "use_freestyle_face_mark", PROP_BOOLEAN, PROP_NONE);
 +      
++      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");
  
-       prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
+       prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
        RNA_def_property_array(prop, 3);
        RNA_def_property_range(prop, -1.0f, 1.0f);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@@ -2598,32 -2706,27 +2716,37 @@@ static void rna_def_mesh(BlenderRNA *br
        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");
  
-       prop= RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
++      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");
 +      RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 +
-       prop= RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
++      prop = RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
 +      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");
 +
-       prop= RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_EDGELEN);
-       RNA_def_property_ui_text(prop, "Edge Length", "Display selected edge lengths, using global values when set in the transform panel");
+       RNA_def_property_ui_text(prop, "Edge Length",
+                                "Display selected edge lengths, using global values when set in the transform panel");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-       
-       prop= RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEANG);
-       RNA_def_property_ui_text(prop, "Face Angles", "Display the angles in the selected edges in degrees, using global values when set in the transform panel");
+       RNA_def_property_ui_text(prop, "Face Angles",
+                                "Display the angles in the selected edges in degrees, "
+                                "using global values when set in the transform panel");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-       
-       prop= RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEAREA);
-       RNA_def_property_ui_text(prop, "Face Area", "Display the area of selected faces, using global values when set in the transform panel");
+       RNA_def_property_ui_text(prop, "Face Area",
+                                "Display the area of selected faces, "
+                                "using global values when set in the transform panel");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
  
-       prop= RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_INDICES);
        RNA_def_property_ui_text(prop, "Indices", "Display the index numbers of selected vertices, edges, and faces");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
index d6783edda42d02d874acb99104d38c9f6a9ed440,a406e4fb9341ee5e502f6b3adb75e29543ba51c6..d3bab1a3a0b181288ac883100b5074348625c253
@@@ -1482,13 -1450,12 +1496,13 @@@ static void rna_def_tool_settings(Blend
                {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""},
                {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""},
                {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
 +              {EDGE_MODE_TAG_FREESTYLE, "FREESTYLE", 0, "Tag Freestyle Edge Mark", ""},
                {0, NULL, 0, NULL, NULL}};
  
-       srna= RNA_def_struct(brna, "ToolSettings", NULL);
+       srna = RNA_def_struct(brna, "ToolSettings", NULL);
        RNA_def_struct_ui_text(srna, "Tool Settings", "");
        
-       prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
+       prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
        RNA_def_property_struct_type(prop, "Sculpt");
        RNA_def_property_ui_text(prop, "Sculpt", "");
        
                                 "Project individual elements on the surface of other objects");
        RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
        RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
 -
 +      
-       prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
        RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
        RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
@@@ -1912,182 -1879,176 +1926,182 @@@ void rna_def_render_layer_common(Struct
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
        /* layer options */
-       prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
        RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
        RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
        RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
        RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
        RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
        RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
        RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (on top of Solid and Halos)");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
        RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
        RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
        RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
 +      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");
 +      if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
 +      else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +
        /* passes */
-       prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
        RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
        RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        
-       prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
        RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
        RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
        RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
        RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
        RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
        RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
        RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
        RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
        RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
        RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
        RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        
-       prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
        RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
        RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
        RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
        RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
        RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
-       if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  
-       prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
        RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
        RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
@@@ -3037,9 -2630,8 +3051,9 @@@ static void rna_def_scene_game_data(Ble
  static void rna_def_scene_render_layer(BlenderRNA *brna)
  {
        StructRNA *srna;
 +      PropertyRNA *prop;
  
-       srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
+       srna = RNA_def_struct(brna, "SceneRenderLayer", NULL);
        RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
        RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
  
@@@ -3841,13 -3423,8 +3855,13 @@@ static void rna_def_scene_render_data(B
        RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
        RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        
 +      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);
 +
        /* threads */
-       prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
+       prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "threads");
        RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
        RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
Simple merge
Simple merge
index 5af2bf05ef3bb21c1691e775124052e9076ac1f9,53af2f9b2c234de5321f0d8eacdd65e428dab9f7..46e483a7194e303ca98e37004790d08f651c92ba
@@@ -5,9 -5,8 +5,9 @@@ sources = env.Glob('intern/source/*.c'
  raysources = env.Glob('intern/raytrace/*.cpp')
  
  incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'
- incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
+ incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf ../blenfont'
  incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace ../bmesh'
 +incs += ' ../freestyle'
  
  cflags_raytrace = env['CCFLAGS']
  cxxflags_raytrace = env['CXXFLAGS']
index 9337dc63b62e46750a4acd1af2fab683de170547,742555600250c0007d13f1fb034744ac993e7dfd..fc64f0a6e1bc688133b7d09afe2e4edb279bee6a
@@@ -228,11 -228,9 +228,11 @@@ struct Rende
        ListBase volumes;
        ListBase volume_precache_parts;
  
 +      ListBase freestyle_renders;
 +
        /* arena for allocating data for use during render, for
-               * example dynamic TFaces to go in the VlakRen structure.
-               */
+        * example dynamic TFaces to go in the VlakRen structure.
+        */
        struct MemArena *memArena;
        
        /* callbacks */
index daaf1b0c73796593a8c727ee7a6950d848c744b4,73305755fc5fd6406715ce5bdbeca09e08403abe..b0bcf793ce5f721c0f75d46b45f734f0589a7f88
@@@ -2080,10 -2004,10 +2078,10 @@@ void RE_BlenderFrame(Render *re, Main *
                BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE);
  
                do_render_all_options(re);
 -
 +              
                if(write_still && !G.afbreek) {
                        if(BKE_imtype_is_movie(scene->r.im_format.imtype)) {
-                               /* operator checks this but incase its called from elsewhere */
+                               /* operator checks this but in case its called from elsewhere */
                                printf("Error: cant write single images with a movie format!\n");
                        }
                        else {
Simple merge