Merged changes in the trunk up to revision 46309.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 5 May 2012 11:40:42 +0000 (11:40 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 5 May 2012 11:40:42 +0000 (11:40 +0000)
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_tools.c

53 files changed:
1  2 
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_operators.h
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_nla/nla_channels.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_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/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/intern/bpy.c
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/intern/wm_files.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c

Simple merge
index 181ed88ed87267528749d428978b926f018dabac,c0ae6415fe1e0532774380f6529ec71cb15dcfe8..5a8a74e1ba208caa26d288dead31fcd6ed99f995
@@@ -13444,42 -7315,107 +7504,137 @@@ static void do_versions(FileData *fd, L
  
  
        if (main->versionfile < 263) {
-               /* Default for old files is to save particle rotations to pointcache */
-               ParticleSettings *part;
-               for (part = main->particle.first; part; part = part->id.next)
-                       part->flag |= PART_ROTATIONS;
+               {
+                       /* Default for old files is to save particle rotations to pointcache */
+                       ParticleSettings *part;
+                       for (part = main->particle.first; part; part = part->id.next)
+                               part->flag |= PART_ROTATIONS;
+               }
+               {
+                       /* file output node paths are now stored in the file info struct instead socket name */
+                       Scene *sce;
+                       bNodeTree *ntree;
+                       
+                       for (sce = main->scene.first; sce; sce=sce->id.next)
+                               if (sce->nodetree)
+                                       do_versions_nodetree_multi_file_output_path_2_64_0(sce->nodetree);
+                       for (ntree = main->nodetree.first; ntree; ntree=ntree->id.next)
+                               do_versions_nodetree_multi_file_output_path_2_64_0(ntree);
+               }
+       }
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 3)) {
+               Scene *scene;
+               Brush *brush;
+               /* For weight paint, each brush now gets its own weight;
+                  unified paint settings also have weight. Update unified
+                  paint settings and brushes with a default weight value. */
+               
+               for (scene = main->scene.first; scene; scene = scene->id.next) {
+                       ToolSettings *ts = scene->toolsettings;
+                       if (ts) {
+                               ts->unified_paint_settings.weight = ts->vgroup_weight;
+                               ts->unified_paint_settings.flag |= UNIFIED_PAINT_WEIGHT;
+                       }
+               }
+               for (brush = main->brush.first; brush; brush = brush->id.next) {
+                       brush->weight = 0.5;
+               }
+       }
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 2)) {
+               bScreen *sc;
+               for (sc = main->screen.first; sc; sc = sc->id.next) {
+                       ScrArea *sa;
+                       for (sa = sc->areabase.first; sa; sa = sa->next) {
+                               SpaceLink *sl;
+                               for (sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_CLIP) {
+                                               SpaceClip *sclip = (SpaceClip *)sl;
+                                               ARegion *ar;
+                                               int hide = FALSE;
+                                               for (ar = sa->regionbase.first; ar; ar = ar->next) {
+                                                       if (ar->regiontype == RGN_TYPE_PREVIEW) {
+                                                               if (ar->alignment != RGN_ALIGN_NONE) {
+                                                                       ar->flag |= RGN_FLAG_HIDDEN;
+                                                                       ar->v2d.flag &= ~V2D_IS_INITIALISED;
+                                                                       ar->alignment = RGN_ALIGN_NONE;
+                                                                       hide = TRUE;
+                                                               }
+                                                       }
+                                               }
+                                               if (hide) {
+                                                       sclip->view = SC_VIEW_CLIP;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 4))
+       {
+               Lamp *la;
+               Camera *cam;
+               Curve *cu;
+               for (la= main->lamp.first; la; la= la->id.next) {
+                       if (la->shadow_frustum_size == 0.0)
+                               la->shadow_frustum_size= 10.0f;
+               }
+               for (cam = main->camera.first; cam; cam = cam->id.next) {
+                       if (cam->flag & CAM_PANORAMA) {
+                               cam->type = CAM_PANO;
+                               cam->flag &= ~CAM_PANORAMA;
+                       }
+               }
+               for(cu= main->curve.first; cu; cu= cu->id.next) {
+                       if(cu->bevfac2 == 0.0f) {
+                               cu->bevfac1 = 0.0f;
+                               cu->bevfac2 = 1.0f;
+                       }
+               }
        }
  
 +      /* default values in Freestyle settings */
 +      {
 +              Scene *sce;
 +              SceneRenderLayer *srl;
 +              FreestyleLineStyle *linestyle;
 +
 +              for(sce = main->scene.first; sce; sce = sce->id.next) {
 +                      if (sce->r.line_thickness_mode == 0) {
 +                              sce->r.line_thickness_mode= R_LINE_THICKNESS_ABSOLUTE;
 +                              sce->r.unit_line_thickness= 1.f;
 +                      }
 +                      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->thickness_position == 0) {
 +                              linestyle->thickness_position= LS_THICKNESS_CENTER;
 +                              linestyle->thickness_ratio= 0.5f;
 +                      }
 +                      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! */
  
index 12da5968e48e8605afb94c2cfc5e4829d055a660,1589bbc123f2a4f7a3da4e29ba23d1fb613bfe54..4694a743d5959a85667dd71f72f1b58eced6a60c
@@@ -1781,19 -1778,17 +1784,30 @@@ void init_userdef_do_versions(void
                }
        }
  
+       if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) {
+               bTheme *btheme;
+               for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+                       if (btheme->tclip.strip[0] == 0) {
+                               rgba_char_args_set(btheme->tclip.list, 0x66, 0x66, 0x66, 0xff);
+                               rgba_char_args_set(btheme->tclip.strip, 0x0c, 0x0a, 0x0a, 0x80);
+                               rgba_char_args_set(btheme->tclip.strip_select, 0xff, 0x8c, 0x00, 0xff);
+                       }
+               }
+       }
 +      /* Freestyle color settings */
 +      {
 +              bTheme *btheme;
 +
 +              for(btheme= U.themes.first; btheme; btheme= btheme->next) {
 +                      /* check for alpha==0 is safe, then color was never set */
 +                      if(btheme->tv3d.freestyle_edge_mark[3]==0) {
 +                              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);
 +                      }
 +              }
 +      }
 +
        /* GL Texture Garbage Collection (variable abused above!) */
        if (U.textimeout == 0) {
                U.texcollectrate = 60;
index e3916d0aa51570d7a1d8713e9061f16ed3abcf5e,96cfd95b96abae3e7d6b2bfbf9ab6ad07753086a..533b2ca12de473e92fe3c06cfdfabbbff2e3ee7a
@@@ -4266,106 -4314,165 +4314,269 @@@ void MESH_OT_inset(wmOperatorType *ot
        RNA_def_boolean(ot->srna, "use_select_inset", TRUE, "Select Outer", "Select the new inset faces");
  }
  
+ static int edbm_wireframe_exec(bContext *C, wmOperator *op)
+ {
+       Object *obedit = CTX_data_edit_object(C);
+       BMEditMesh *em = BMEdit_FromObject(obedit);
+       BMOperator bmop;
+       const int use_boundary        = RNA_boolean_get(op->ptr, "use_boundary");
+       const int use_even_offset     = RNA_boolean_get(op->ptr, "use_even_offset");
+       const int use_replace         = RNA_boolean_get(op->ptr, "use_replace");
+       const int use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset");
+       const int use_crease          = RNA_boolean_get(op->ptr, "use_crease");
+       const float thickness         = RNA_float_get(op->ptr,   "thickness");
+       EDBM_op_init(em, &bmop, op,
+                    "wireframe faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b use_crease=%b "
+                    "thickness=%f",
+                    BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, use_crease,
+                    thickness);
+       BMO_op_exec(em->bm, &bmop);
+       if (use_replace) {
+               BM_mesh_elem_hflag_disable_all(em->bm, BM_FACE, BM_ELEM_TAG, FALSE);
+               BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+               BMO_op_callf(em->bm, "del geom=%hvef context=%i", BM_ELEM_TAG, DEL_FACES);
+       }
+       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
+       BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_FACE, BM_ELEM_SELECT, TRUE);
+       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+               return OPERATOR_CANCELLED;
+       }
+       else {
+               EDBM_update_generic(C, em, TRUE);
+               return OPERATOR_FINISHED;
+       }
+ }
+ void MESH_OT_wireframe(wmOperatorType *ot)
+ {
+       PropertyRNA *prop;
+       /* identifiers */
+       ot->name = "Wire Frame";
+       ot->idname = "MESH_OT_wireframe";
+       ot->description = "Inset new faces into selected faces";
+       /* api callbacks */
+       ot->exec = edbm_wireframe_exec;
+       ot->poll = ED_operator_editmesh;
+       /* flags */
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+       /* properties */
+       RNA_def_boolean(ot->srna, "use_boundary",        TRUE,  "Boundary",        "Inset face boundaries");
+       RNA_def_boolean(ot->srna, "use_even_offset",     TRUE,  "Offset Even",     "Scale the offset to give more even thickness");
+       RNA_def_boolean(ot->srna, "use_relative_offset", FALSE, "Offset Relative", "Scale the offset by surrounding geometry");
+       RNA_def_boolean(ot->srna, "use_crease",          FALSE, "Crease",          "Crease hub edges for improved subsurf");
+       prop = RNA_def_float(ot->srna, "thickness", 0.01f, 0.0f, FLT_MAX, "Thickness", "", 0.0f, 10.0f);
+       /* use 1 rather then 10 for max else dragging the button moves too far */
+       RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
+       RNA_def_boolean(ot->srna, "use_replace",         TRUE, "Replace", "Remove original faces");
+ }
+ static int edbm_convex_hull_exec(bContext *C, wmOperator *op)
+ {
+       Object *obedit = CTX_data_edit_object(C);
+       BMEditMesh *em = BMEdit_FromObject(obedit);
+       BMOperator bmop;
+               
+       EDBM_op_init(em, &bmop, op, "convex_hull input=%hvef "
+                                "use_existing_faces=%b",
+                                BM_ELEM_SELECT,
+                                RNA_boolean_get(op->ptr, "use_existing_faces"));
+       BMO_op_exec(em->bm, &bmop);
+       /* Hull fails if input is coplanar */
+       if (BMO_error_occurred(em->bm)) {
+               EDBM_op_finish(em, &bmop, op, TRUE);
+               return OPERATOR_CANCELLED;
+       }
+       
+       /* Delete unused vertices, edges, and faces */
+       if (RNA_boolean_get(op->ptr, "delete_unused")) {
+               if (!EDBM_op_callf(em, op, "del geom=%s context=%i",
+                                  &bmop, "unused_geom", DEL_ONLYTAGGED))
+               {
+                       EDBM_op_finish(em, &bmop, op, TRUE);
+                       return OPERATOR_CANCELLED;
+               }
+       }
+       /* Delete hole edges/faces */
+       if (RNA_boolean_get(op->ptr, "make_holes")) {
+               if (!EDBM_op_callf(em, op, "del geom=%s context=%i",
+                                  &bmop, "holes_geom", DEL_ONLYTAGGED))
+               {
+                       EDBM_op_finish(em, &bmop, op, TRUE);
+                       return OPERATOR_CANCELLED;
+               }
+       }
+       /* Merge adjacent triangles */
+       if (RNA_boolean_get(op->ptr, "join_triangles")) {
+               if (!EDBM_op_callf(em, op, "join_triangles faces=%s limit=%f",
+                                  &bmop, "geomout",
+                                  RNA_float_get(op->ptr, "limit")))
+               {
+                       EDBM_op_finish(em, &bmop, op, TRUE);
+                       return OPERATOR_CANCELLED;
+               }
+       }
+       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+               return OPERATOR_CANCELLED;
+       }
+       else {
+               EDBM_update_generic(C, em, TRUE);
+               EDBM_selectmode_flush(em);
+               return OPERATOR_FINISHED;
+       }
+ }
+ void MESH_OT_convex_hull(wmOperatorType *ot)
+ {
+       /* identifiers */
+       ot->name = "Convex Hull";
+       ot->description = "Enclose selected vertices in a convex polyhedron";
+       ot->idname = "MESH_OT_convex_hull";
+       /* api callbacks */
+       ot->exec = edbm_convex_hull_exec;
+       ot->poll = EM_view3d_poll;
+       /* flags */
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+       /* props */
+       RNA_def_boolean(ot->srna, "delete_unused", TRUE,
+                                       "Delete Unused",
+                                       "Delete selected elements that are not used by the hull");
+       RNA_def_boolean(ot->srna, "use_existing_faces", TRUE,
+                                       "Use Existing Faces",
+                                       "Skip hull triangles that are covered by a pre-existing face");
+       RNA_def_boolean(ot->srna, "make_holes", FALSE,
+                                       "Make Holes",
+                                       "Delete selected faces that are used by the hull");
+       RNA_def_boolean(ot->srna, "join_triangles", TRUE,
+                                       "Join Triangles",
+                                       "Merge adjacent triangles into quads");
+       join_triangle_props(ot);
+ }
++
 +static int edbm_mark_freestyle_edge(bContext *C, wmOperator *op)
 +{
 +      Object *obedit = CTX_data_edit_object(C);
 +      Mesh *me = ((Mesh *)obedit->data);
 +      BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
 +      BMEdge *eed;
 +      BMIter iter;
 +      int clear = RNA_boolean_get(op->ptr, "clear");
 +
 +      if (em == NULL) return OPERATOR_FINISHED;
 +
 +      /* auto-enable seams drawing */
 +      if (clear == 0) {
 +              me->drawflag |= ME_DRAW_FREESTYLE_EDGE;
 +      }
 +
 +      if (clear) {
 +              BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
 +                      if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN))
 +                              BM_elem_flag_disable(eed, BM_ELEM_FREESTYLE);
 +              }
 +      }
 +      else {
 +              BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
 +                      if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN))
 +                              BM_elem_flag_enable(eed, BM_ELEM_FREESTYLE);
 +              }
 +      }
 +
 +      DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
 +      WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 +
 +      return OPERATOR_FINISHED;
 +}
 +
 +void MESH_OT_mark_freestyle_edge(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name = "Mark Freestyle Edge";
 +      ot->description = "(un)mark selected edges as Freestyle feature edges";
 +      ot->idname = "MESH_OT_mark_freestyle_edge";
 +
 +      /* api callbacks */
 +      ot->exec = edbm_mark_freestyle_edge;
 +      ot->poll = ED_operator_editmesh;
 +
 +      /* flags */
 +      ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
 +
 +      RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
 +}
 +
 +static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
 +{
 +      Object *obedit = CTX_data_edit_object(C);
 +      Mesh *me = ((Mesh *)obedit->data);
 +      BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
 +      BMFace *efa;
 +      BMIter iter;
 +      int clear = RNA_boolean_get(op->ptr, "clear");
 +
 +      if (em == NULL) return OPERATOR_FINISHED;
 +
 +      /* auto-enable Freestyle face mark drawing */
 +      if(!clear) {
 +              me->drawflag |= ME_DRAW_FREESTYLE_FACE;
 +      }
 +
 +      if(clear) {
 +              BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 +                      if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
 +                              BM_elem_flag_disable(efa, BM_ELEM_FREESTYLE);
 +              }
 +      } else {
 +              BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 +                      if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
 +                              BM_elem_flag_enable(efa, BM_ELEM_FREESTYLE);
 +              }
 +      }
 +
 +      DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
 +      WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 +
 +      return OPERATOR_FINISHED;
 +}
 +
 +void MESH_OT_mark_freestyle_face(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name = "Mark Freestyle Face";
 +      ot->description = "(un)mark selected faces for exclusion from Freestyle feature edge detection";
 +      ot->idname = "MESH_OT_mark_freestyle_face";
 +
 +      /* api callbacks */
 +      ot->exec = edbm_mark_freestyle_face_exec;
 +      ot->poll = ED_operator_editmesh;
 +
 +      /* flags */
 +      ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
 +
 +      RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
 +}
 +
Simple merge
Simple merge
Simple merge
index 8013251fb3ce1631a8746f9c368889a16545581e,f6030c8c0b545b63315b42db6fd825c911fb25a9..4a3493d1a00993368d6b219fb8a3d9c14368c7d3
@@@ -4325,25 -4281,8 +4325,25 @@@ static void check_non_flat_quads(Object
                                        vlr->v4 = vlr1->v4 = NULL;
                                        
                                        /* new normals */
-                                       normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
-                                       normal_tri_v3( vlr1->n,vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
+                                       normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+                                       normal_tri_v3(vlr1->n, vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
 +
 +                                      /* Freestyle edge marks */
 +                                      if (vlr->flag & R_DIVIDE_24) {
 +                                              vlr1->freestyle_edge_mark=
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V2V3) ? R_EDGE_V1V2 : 0) |
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V3V4) ? R_EDGE_V2V3 : 0);
 +                                              vlr->freestyle_edge_mark=
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V1V2) ? R_EDGE_V1V2 : 0) |
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V4V1) ? R_EDGE_V3V1 : 0);
 +                                      } else {
 +                                              vlr1->freestyle_edge_mark=
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V3V4) ? R_EDGE_V2V3 : 0) |
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V4V1) ? R_EDGE_V3V1 : 0);
 +                                              vlr->freestyle_edge_mark=
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V1V2) ? R_EDGE_V1V2 : 0) |
 +                                                      ((vlr->freestyle_edge_mark & R_EDGE_V2V3) ? R_EDGE_V2V3 : 0);
 +                                      }
                                }
                                /* clear the flag when not divided */
                                else vlr->flag &= ~R_DIVIDE_24;
index 416acae2f0d2011aa44e61951a5d18143b8a8c5f,f0fea0725303f0c853b3c4b12eef92b6650e7f94..30788f6723835df21245b92f7233b89dde248460
@@@ -2100,10 -2021,10 +2102,10 @@@ void RE_BlenderFrame(Render *re, Main *
        if (render_initialize_from_main(re, bmain, scene, srl, camera_override, lay, 0, 0)) {
                MEM_reset_peak_memory();
  
-               BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE);
+               BLI_callback_exec(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 in case its called from elsewhere */
index 874611150cb82252ddcc5ec25bbf83e0b12a583e,a366810e6472c0a7a5e7608a92f840473db954c8..6ed6e13f3d026fe6d6b4383459d693133de5ef7e
@@@ -421,10 -419,9 +421,10 @@@ void WM_read_file(bContext *C, const ch
                BPY_app_handlers_reset(FALSE);
                BPY_modules_load_user(C);
  #endif
 +              FRS_read_file(C);
  
                /* important to do before NULL'ing the context */
-               BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
+               BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
  
                if (!G.background) {
                        /* in background mode this makes it hard to load
index 4d81706abdc8d209fc263ee08d942a4fdf6d86d6,55124ab227ca6757eb0404ad737362654b201840..5ced611f6656753f64ee0793f27d48ada13c9d26
@@@ -502,14 -499,9 +502,16 @@@ float BPY_driver_exec(struct ChannelDri
  void BPY_DECREF(void *pyob_ptr) {}
  void BPY_pyconstraint_exec(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets) {}
  void macro_wrapper(struct wmOperatorType *ot, void *userdata) {}
+ int pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id){ return 0; }
+ struct PyObject *pyrna_id_CreatePyObject(struct ID *id) {return NULL; }
  
 +/* Freestyle */
 +void FRS_add_freestyle_config(struct SceneRenderLayer* srl) {}
 +void FRS_free_freestyle_config(struct SceneRenderLayer* srl) {}
 +struct FreestyleLineSet *FRS_get_active_lineset(struct FreestyleConfig *config) { return NULL; }
 +short FRS_get_active_lineset_index(struct FreestyleConfig *config) { return 0; }
 +void FRS_set_active_lineset_index(struct FreestyleConfig *config, short index) {}
 +void FRS_unlink_target_object(struct FreestyleConfig *config, struct Object *ob) {}
  /* intern/dualcon */
  struct DualConMesh;
  struct DualConMesh *dualcon(const struct DualConMesh *input_mesh,
Simple merge
Simple merge