Merging trunk into soc-2011-tomato up to revision 40241
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 15 Sep 2011 18:59:30 +0000 (18:59 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 15 Sep 2011 18:59:30 +0000 (18:59 +0000)
50 files changed:
1  2 
CMakeLists.txt
extern/CMakeLists.txt
extern/SConscript
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/object/object_constraint.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/render/intern/include/render_types.h
source/blenderplayer/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/SConscript
source/gameengine/Ketsji/KX_KetsjiEngine.cpp

diff --cc CMakeLists.txt
Simple merge
Simple merge
@@@ -3,8 -3,10 +3,11 @@@
  Import('env')
  
  SConscript(['glew/SConscript'])
 +SConscript(['colamd/SConscript'])
  
+ if env['WITH_BF_GAMEENGINE']:
+     SConscript(['recastnavigation/SConscript'])
  if env['WITH_BF_ELTOPO']:
      SConscript(['eltopo/SConscript'])
  
@@@ -359,11 -352,16 +358,22 @@@ if(WITH_LZMA
        add_definitions(-DWITH_LZMA)
  endif()
  
++
+ if(WITH_GAMEENGINE)
+       list(APPEND INC_SYS
+         ../../../extern/recastnavigation/Recast/Include
+       )
+       list(APPEND SRC
+               intern/navmesh_conversion.cpp
+               BKE_navmesh_conversion.h
+       )
+ endif()
 +if(WITH_LIBMV)
 +      list(APPEND INC ../../../extern/libmv)
 +      add_definitions(-DWITH_LIBMV)
 +endif()
 +
  if(MSVC)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
  endif()
@@@ -90,10 -91,12 +91,16 @@@ if env['WITH_BF_LZMA']
      incs += ' #/extern/lzma'
      defs.append('WITH_LZMA')
  
+ if env['WITH_BF_GAMEENGINE']:
+     incs += ' #/extern/recastnavigation/Recast/Include'
+     defs.append('WITH_GAMEENGINE')
+ else:
+     sources.remove('intern' + os.sep + 'navmesh_conversion.cpp')
 +if env['WITH_BF_LIBMV']:
 +    incs += ' #/extern/libmv'
 +    defs.append('WITH_LIBMV')
 +
  if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
      incs += ' ' + env['BF_PTHREADS_INC']
  
@@@ -12125,60 -12037,46 +12147,97 @@@ static void do_versions(FileData *fd, L
        /* put compatibility code here until next subversion bump */
  
        {
 +              bScreen *sc;
 +              Camera *cam;
 +              MovieClip *clip;
  
 +              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_VIEW3D) {
 +                                              View3D *v3d= (View3D *)sl;
 +
 +                                              if(v3d->bundle_size==0.0f) {
 +                                                      v3d->bundle_size= 0.1f;
 +                                                      v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
 +                                              }
 +
 +                                              if(v3d->bundle_drawtype==0)
 +                                                      v3d->bundle_drawtype= OB_EMPTY_SPHERE;
 +                                      }
 +                                      else if(sl->spacetype==SPACE_CLIP) {
 +                                              SpaceClip *sclip= (SpaceClip *)sl;
 +                                              if(sclip->scopes.track_preview_height==0)
 +                                                      sclip->scopes.track_preview_height= 120;
 +                                      }
 +                              }
 +                      }
 +              }
 +
 +              for (clip= main->movieclip.first; clip; clip= clip->id.next) {
 +                      if(clip->aspx<1.0f) {
 +                              clip->aspx= 1.0f;
 +                              clip->aspy= 1.0f;
 +                      }
 +
 +                      /* XXX: a bit hacky, probably include imbuf and use real constants are nicer */
 +                      clip->proxy.build_tc_flags= 7;
 +                      if(clip->proxy.build_size_flags==0)
 +                              clip->proxy.build_size_flags= 1;
 +
 +                      if(clip->proxy.quality==0)
 +                              clip->proxy.quality= 90;
 +
 +                      if(clip->tracking.camera.pixel_aspect<0.01f)
 +                              clip->tracking.camera.pixel_aspect= 1.f;
 +              }
 +
 +              for(cam= main->camera.first; cam; cam= cam->id.next) {
 +                      if (cam->sensor_x < 0.01f) {
 +                              cam->sensor_x = 32.f;
 +                      }
 +              }
        }
  
+       //set defaults for obstacle avoidance, recast data
+       {
+               Scene *sce;
+               for(sce = main->scene.first; sce; sce = sce->id.next)
+               {
+                       if (sce->gm.levelHeight == 0.f)
+                               sce->gm.levelHeight = 2.f;
+                       if(sce->gm.recastData.cellsize == 0.0f)
+                               sce->gm.recastData.cellsize = 0.3f;
+                       if(sce->gm.recastData.cellheight == 0.0f)
+                               sce->gm.recastData.cellheight = 0.2f;
+                       if(sce->gm.recastData.agentmaxslope == 0.0f)
+                               sce->gm.recastData.agentmaxslope = M_PI/4;
+                       if(sce->gm.recastData.agentmaxclimb == 0.0f)
+                               sce->gm.recastData.agentmaxclimb = 0.9f;
+                       if(sce->gm.recastData.agentheight == 0.0f)
+                               sce->gm.recastData.agentheight = 2.0f;
+                       if(sce->gm.recastData.agentradius == 0.0f)
+                               sce->gm.recastData.agentradius = 0.6f;
+                       if(sce->gm.recastData.edgemaxlen == 0.0f)
+                               sce->gm.recastData.edgemaxlen = 12.0f;
+                       if(sce->gm.recastData.edgemaxerror == 0.0f)
+                               sce->gm.recastData.edgemaxerror = 1.3f;
+                       if(sce->gm.recastData.regionminsize == 0.0f)
+                               sce->gm.recastData.regionminsize = 50.f;
+                       if(sce->gm.recastData.regionmergesize == 0.0f)
+                               sce->gm.recastData.regionmergesize = 20.f;
+                       if(sce->gm.recastData.vertsperpoly<3)
+                               sce->gm.recastData.vertsperpoly = 6;
+                       if(sce->gm.recastData.detailsampledist == 0.0f)
+                               sce->gm.recastData.detailsampledist = 6.0f;
+                       if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
+                               sce->gm.recastData.detailsamplemaxerror = 1.0f;
+               }                       
+       }
+       
        /* 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! */
  
@@@ -710,8 -701,8 +702,8 @@@ static void draw_scope_end(rctf *rect, 
        
        /* outline */
        glColor4f(0.f, 0.f, 0.f, 0.5f);
-       uiSetRoundBox(15);
+       uiSetRoundBox(UI_CNR_ALL);
 -      uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f);
 +      uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin-1, rect->xmax+1, rect->ymax+1, 3.0f);
  }
  
  static void histogram_draw_one(float r, float g, float b, float alpha, float x, float y, float w, float h, float *data, int res)
Simple merge
@@@ -1238,27 -1206,9 +1207,27 @@@ static void drawviewborder(Scene *scene
  
                        UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
  
-                       uiSetRoundBox(15);
+                       uiSetRoundBox(UI_CNR_ALL);
                        uiDrawBox(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
                }
 +              if (ca && (ca->flag & CAM_SHOWSENSOR)) {
 +                      /* assume fixed sensor width for now */
 +                      float aspx = (float) scene->r.xsch*scene->r.xasp;
 +                      float aspy = (float) scene->r.ysch*scene->r.yasp;
 +                      float sensor_scale = (x2i-x1i) / ca->sensor_x;
 +                      float sensor_height, ymid, sy1, sy2;
 +
 +                      if(aspx < aspy) sensor_height = ca->sensor_x * sensor_scale * aspx / aspy;
 +                      else sensor_height = ca->sensor_x * sensor_scale * aspy / aspx;
 +
 +                      ymid = y1i + (y2i-y1i)/2.f;
 +                      sy1= ymid - sensor_height/2.f;
 +                      sy2= ymid + sensor_height/2.f;
 +
 +                      UI_ThemeColorShade(TH_WIRE, 100);
 +
 +                      uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0);
 +              }
        }
  
        setlinestyle(0);
  #include "ED_node.h"
  #include "ED_types.h"
  #include "ED_uvedit.h"
- #include "ED_curve.h" /* for ED_curve_editnurbs */
 +#include "ED_clip.h"
  #include "ED_util.h"  /* for crazyspace correction */
  
 +#include "WM_api.h"           /* for WM_event_add_notifier to deal with stabilization nodes */
 +#include "WM_types.h"
 +
  #include "UI_view2d.h"
  
  #include "BLI_math.h"
@@@ -86,8 -84,7 +86,8 @@@
  #include "ED_space_api.h"
  #include "ED_uvedit.h"
  #include "ED_view3d.h"
- #include "ED_curve.h" /* for ED_curve_editnurbs */
+ #include "ED_curve.h" /* for curve_editnurbs */
 +#include "ED_clip.h"
  
  //#include "BDR_unwrapper.h"
  
Simple merge
Simple merge
@@@ -803,8 -801,8 +807,9 @@@ endif(
                bf_intern_smoke
                extern_minilzo
                extern_lzma
 +              extern_colamd
                ge_logic_ketsji
+               extern_recastnavigation
                ge_phys_common
                ge_logic
                ge_rasterizer
Simple merge
@@@ -20,7 -20,8 +20,8 @@@ incs += ' #source/blender/misc #source/
  incs += ' #source/blender/windowmanager'
  incs += ' #source/blender/makesrna'
  incs += ' #source/blender/ikplugin'
 -incs += ' #extern/Eigen2'
+ incs += ' #extern/recastnavigation/Detour/Include'
 +incs += ' #extern/Eigen3'
  
  incs += ' ' + env['BF_BULLET_INC']