Merged changes in the trunk up to revision 47056.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 26 May 2012 22:22:45 +0000 (22:22 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 26 May 2012 22:22:45 +0000 (22:22 +0000)
Conflicts resolved:
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/editors/interface/resources.c
source/blender/render/intern/source/convertblender.c

45 files changed:
1  2 
build_files/scons/tools/Blender.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/CMakeLists.txt
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/include/ED_anim_api.h
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/render/render_shading.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_nla/nla_buttons.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_action_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/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_internal.h
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.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
Simple merge
index 95d3f56f9b31bb043f019753fffe60bc9e7515bf,8d41b54501a0deb36ecbe808cb7ea410c35e0d7d..8a589bd191cc8885c961774b8e033913098abd82
@@@ -4830,11 -4782,9 +4783,10 @@@ static void lib_link_scene(FileData *fd
        Base *base, *next;
        Sequence *seq;
        SceneRenderLayer *srl;
 +      FreestyleLineSet *fls;
        TimeMarker *marker;
        
-       sce = main->scene.first;
-       while (sce) {
+       for (sce = main->scene.first; sce; sce = sce->id.next) {
                if (sce->id.flag & LIB_NEEDLINK) {
                        /* Link ID Properties -- and copy this comment EXACTLY for easy finding
                         * of library blocks that implement this.*/
                                composite_patch(sce->nodetree, sce);
                        }
                        
-                       for (srl= sce->r.layers.first; srl; srl= srl->next) {
+                       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);
 +                              }
                        }
                        /*Game Settings: Dome Warp Text*/
                        sce->gm.dome.warptext = newlibadr(fd, sce->id.lib, sce->gm.dome.warptext);
@@@ -7703,37 -7465,60 +7654,90 @@@ static void do_versions(FileData *fd, L
                        }
                }
        }
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 6))
+       {
+               /* update use flags for node sockets (was only temporary before) */
+               Scene *sce;
+               Material *mat;
+               Tex *tex;
+               Lamp *lamp;
+               World *world;
+               bNodeTree *ntree;
+               
+               for (sce=main->scene.first; sce; sce=sce->id.next)
+                       if (sce->nodetree)
+                               do_versions_nodetree_frame_2_64_6(sce->nodetree);
+               
+               for (mat=main->mat.first; mat; mat=mat->id.next)
+                       if (mat->nodetree)
+                               do_versions_nodetree_frame_2_64_6(mat->nodetree);
+               
+               for (tex=main->tex.first; tex; tex=tex->id.next)
+                       if (tex->nodetree)
+                               do_versions_nodetree_frame_2_64_6(tex->nodetree);
+               
+               for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
+                       if (lamp->nodetree)
+                               do_versions_nodetree_frame_2_64_6(lamp->nodetree);
+               
+               for (world=main->world.first; world; world=world->id.next)
+                       if (world->nodetree)
+                               do_versions_nodetree_frame_2_64_6(world->nodetree);
+               
+               for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+                       do_versions_nodetree_frame_2_64_6(ntree);
+       }
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 7))
+       {
+               Object *ob;
+               for (ob = main->object.first; ob; ob = ob->id.next) {
+                       ModifierData *md;
+                       for (md = ob->modifiers.first; md; md = md->next) {
+                               if (md->type == eModifierType_Smoke) {
+                                       SmokeModifierData *smd = (SmokeModifierData *)md;
+                                       if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
+                                               int maxres = MAX3(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2]);
+                                               smd->domain->scale = smd->domain->dx * maxres;
+                                               smd->domain->dx = 1.0f / smd->domain->scale;
+                                       }
+                               }
+                       }
+               }
+       }
        
 +      /* 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! */
        {
@@@ -8862,12 -8622,9 +8868,12 @@@ static void expand_main(FileData *fd, M
                                        case ID_MC:
                                                expand_movieclip(fd, mainvar, (MovieClip *)id);
                                                break;
 +                                      case ID_LS:
 +                                              expand_linestyle(fd, mainvar, (FreestyleLineStyle *)id);
 +                                              break;
                                        }
                                        
-                                       doit = 1;
+                                       do_it = TRUE;
                                        id->flag -= LIB_TEST;
                                        
                                }
index 3ecb1fe92f87a890ce006feaec2b93b8d016b617,737efde8391f27713f4364e9fe1f8d0688d813d1..e180335cf06965cfe667fb60b36b60b319fb5443
@@@ -225,12 -225,11 +225,12 @@@ enum 
                                   * when temp tagging is handy.
                                   * always assume dirty & clear before use. */
  
-       BM_ELEM_FREESTYLE = (1 << 5), /* used for Freestyle faces and edges */
+       BM_ELEM_DRAW    = (1 << 5), /* edge display */
  
-       /* we have 2 spare flags which is awesome but since we're limited to 8
+       /* we have 1 spare flag which is awesome but since we're limited to 8
         * only add new flags with care! - campbell */
-       /* BM_ELEM_SPARE  = (1 << 5), */
        /* BM_ELEM_SPARE  = (1 << 6), */
++      BM_ELEM_FREESTYLE = (1 << 6), /* used for Freestyle faces and edges */
  
        BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging,
                                       * since tools may want to tag verts and
index 38e9e6ffd5346d77d4d695c321604c947bf56ec4,589a5fbaa662e6b135ffbcbe17a2de3945b10aad..84b569009cedfaa3a4e983fe4b4bd19b8c3fff9b
@@@ -973,9 -973,9 +973,10 @@@ char BM_edge_flag_from_mflag(const shor
  {
        return ( ((meflag & SELECT)        ? BM_ELEM_SELECT : 0) |
                 ((meflag & ME_SEAM)       ? BM_ELEM_SEAM   : 0) |
+                ((meflag & ME_EDGEDRAW)   ? BM_ELEM_DRAW   : 0) |
                 ((meflag & ME_SHARP) == 0 ? BM_ELEM_SMOOTH : 0) | /* invert */
 -               ((meflag & ME_HIDE)       ? BM_ELEM_HIDDEN : 0)
 +               ((meflag & ME_HIDE)       ? BM_ELEM_HIDDEN : 0) |
 +               ((meflag & ME_FREESTYLE_EDGE) ? BM_ELEM_FREESTYLE : 0)
                 );
  }
  char BM_face_flag_from_mflag(const char  meflag)
@@@ -1000,13 -1000,13 +1002,14 @@@ short BM_edge_flag_to_mflag(BMEdge *eed
  {
        const char hflag = eed->head.hflag;
  
-       return ( ((hflag & BM_ELEM_SELECT)       ? SELECT    : 0) |
-                ((hflag & BM_ELEM_SEAM)         ? ME_SEAM   : 0) |
-                ((hflag & BM_ELEM_SMOOTH) == 0  ? ME_SHARP  : 0) |
-                ((hflag & BM_ELEM_HIDDEN)       ? ME_HIDE   : 0) |
-                ((hflag & BM_ELEM_FREESTYLE) ? ME_FREESTYLE_EDGE : 0) |
-                ((BM_edge_is_wire(eed)) ? ME_LOOSEEDGE : 0) | /* not typical */
-                (ME_EDGEDRAW | ME_EDGERENDER)
+       return ( ((hflag & BM_ELEM_SELECT)       ? SELECT       : 0) |
+                ((hflag & BM_ELEM_SEAM)         ? ME_SEAM      : 0) |
+                ((hflag & BM_ELEM_DRAW)         ? ME_EDGEDRAW  : 0) |
+                ((hflag & BM_ELEM_SMOOTH) == 0  ? ME_SHARP     : 0) |
+                ((hflag & BM_ELEM_HIDDEN)       ? ME_HIDE      : 0) |
++               ((hflag & BM_ELEM_FREESTYLE)    ? ME_FREESTYLE_EDGE : 0) |
+                ((BM_edge_is_wire(eed))         ? ME_LOOSEEDGE : 0) | /* not typical */
+                ME_EDGERENDER
                 );
  }
  char  BM_face_flag_to_mflag(BMFace *efa)
index a83797db4323d8e4e350221be393b0da961fb4b2,2d409879ba350dce1dc6f94e47fe5aaabdb8f429..04a9c1c2d613c923ebb927cb400b6383085ffb3d
@@@ -197,11 -197,10 +197,13 @@@ enum 
        TH_STITCH_PREVIEW_UNSTITCHABLE,
        TH_STITCH_PREVIEW_ACTIVE,
  
 +      TH_FREESTYLE_EDGE_MARK,
 +      TH_FREESTYLE_FACE_MARK,
 +
        TH_MATCH,           /* highlight color for search matches */
-       TH_SELECT_HIGHLIGHT /* highlight color for selected outliner item */
+       TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
+       TH_SKIN_ROOT
  };
  /* XXX WARNING: previous is saved in file, so do not change order! */
  
index 4694a743d5959a85667dd71f72f1b58eced6a60c,0d16e0f4dc01c316390cdb75bb8d6c8f34acf68d..2162f248c29af3380148f9bd90c2a91e0d13cbde
@@@ -1795,19 -1814,12 +1820,25 @@@ void init_userdef_do_versions(void
                }
        }
  
+       if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 6)) {
+               bTheme *btheme;
+               for (btheme = U.themes.first; btheme; btheme = btheme->next)
+                       rgba_char_args_set(btheme->tv3d.skin_root, 180, 77, 77, 255);
+       }
 +      /* 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;
Simple merge
index fe8662c51a75ff09fbb88afe59a7f06436ebbcc4,bda8baa5e3010ddd423d82bd21b0aae9f733e1ef..ae9236ebece008c5bcc527720ecfc1f723d75243
@@@ -3444,9 -3416,7 +3444,8 @@@ static void init_render_mesh(Render *re
                                                
                                                if ( mface->mat_nr==a1 ) {
                                                        float len;
-                                                               
-                                                       int reverse_verts = negative_scale!=0 && do_autosmooth==0;
 +                                                      int edge_mark= 0;
+                                                       int reverse_verts = (negative_scale != 0 && do_autosmooth == FALSE);
                                                        int rev_tab[] = {reverse_verts==0 ? 0 : 2, 1, reverse_verts==0 ? 2 : 0, 3};
                                                        v1= reverse_verts==0 ? mface->v1 : mface->v3;
                                                        v2= mface->v2;
index d75748e43ec821e61928c79c7374d203de34854a,86567873256281f5e7dd4e13e1ea6dc6f4c708ac..9f0e2749e34d1ba64b4ce6c790e1a324960df5ce
@@@ -503,17 -492,10 +495,17 @@@ 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; }
+ int pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id) { return 0; }
  struct PyObject *pyrna_id_CreatePyObject(struct ID *id) {return NULL; }
- void BPY_context_update(struct bContext *C){};
+ void BPY_context_update(struct bContext *C) {};
  
 +/* 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,
index ddb70db88d0b2c6f87ccd124052cf8f8e2222d7b,0f674b407e249f6c79784edf3e49c033429a3064..ed069e54785b3a7eac711e07ca876b82db8e85cf
@@@ -37,9 -37,7 +37,8 @@@ blender_include_dirs
        ../blender/render/extern/include
        ../blender/makesdna
        ../blender/gpu
 +      ../blender/freestyle
        ../blender/windowmanager
-       ../blender/opencl
  )
  
  if(WIN32)
index 12f72c07c089e5f536359ecff9a2b1f2bf9f65a0,a21497b82fa0ed5fd25ef22dcc942ace5dfebc58..b626b94f98406fe5e460656d5c751dbd51f81b44
  
  #include "BLI_scanfill.h" /* for BLI_setErrorCallBack, TODO, move elsewhere */
  
 +#include "FRS_freestyle.h"
 +
  #ifdef WITH_BUILDINFO_HEADER
- #define BUILD_DATE
+ #  define BUILD_DATE
  #endif
  
  /* for passing information between creator and gameengine */