synched with trunk at revision 31065
authorNick Samarin <nicks1987@bigmir.net>
Thu, 5 Aug 2010 13:54:56 +0000 (13:54 +0000)
committerNick Samarin <nicks1987@bigmir.net>
Thu, 5 Aug 2010 13:54:56 +0000 (13:54 +0000)
26 files changed:
1  2 
projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
projectfiles_vc9/blender/editors/ED_editors.vcproj
projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_game.py
release/scripts/ui/properties_scene.py
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.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/include/ED_object.h
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_navmesh.cpp
source/blender/editors/object/object_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/makesdna/DNA_actuator_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_Scene.cpp

index f1b92cde83709b9b5fc55e56ce246b7b7976165f,f1b92cde83709b9b5fc55e56ce246b7b7976165f..08a45c47fa9123b0562566871c2c7c2460d9345b
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0" encoding="Windows-1252"?>\r
  <VisualStudioProject\r
        ProjectType="Visual C++"\r
--      Version="9,00"\r
++      Version="9.00"\r
        Name="BKE_blenkernel"\r
        ProjectGUID="{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}"\r
        RootNamespace="BKE_blenkernel"\r
                                RelativePath="..\..\..\source\blender\blenkernel\intern\script.c"\r
                                >\r
                        </File>\r
++                      <File\r
++                              RelativePath="..\..\..\source\blender\blenkernel\intern\seqcache.c"\r
++                              >\r
++                      </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\blenkernel\intern\seqeffects.c"\r
                                >\r
index 38e9e31d7e75d1fe4f5b59f3a5d922ae0116ace9,cda69b46f5edd4b870ca5cad353caaab5254a659..d1908f16ed585c58efb211f177a8c50ae146ab7b
                                RelativePath="..\..\..\source\blender\editors\space_logic\logic_buttons.c"\r
                                >\r
                        </File>\r
--                      <File\r
--                              RelativePath="..\..\..\source\blender\editors\space_logic\logic_header.c"\r
--                              >\r
--                      </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\space_logic\logic_intern.h"\r
                                >\r
index 4fb2e780853f3a0e5067d378c45c9075babfc797,4fb2e780853f3a0e5067d378c45c9075babfc797..705e7da43e8c024367d5ce5c81bdc741f5446ecf
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0" encoding="Windows-1252"?>\r
  <VisualStudioProject\r
        ProjectType="Visual C++"\r
--      Version="9,00"\r
++      Version="9.00"\r
        Name="RNA_rna"\r
        ProjectGUID="{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}"\r
        RootNamespace="RNA_rna"\r
@@@ -43,7 -43,7 +43,7 @@@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
--                              AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
++                              AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;GAMEBLENDER=1"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
--                              AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
++                              AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesrna\intern;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\ikplugin;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\source\blender\gpu;..\..\..\source\blender\render\extern\include"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;GAMEBLENDER=1"\r
                                MinimalRebuild="true"\r
                                RuntimeLibrary="0"\r
index b3baeada0fdfc2986b54fb98871eda48b20cc2ec,b12f368f5f47de51018fd777a047701324335ba3..888fcb46a1e2536cc5bd385c303f261a3a0a4932
@@@ -196,33 -196,9 +196,33 @@@ class PHYSICS_PT_game_collision_bounds(
          if wide_ui:
              col = split.column()
          col.prop(game, "collision_compound", text="Compound")
-               
- class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel):
-     bl_label = "Create obstacle"
  
++class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, bpy.types.Panel):
++    bl_label = "Create obstacle"
++    COMPAT_ENGINES = {'BLENDER_GAME'}
 +    def poll(self, context):
 +        game = context.object.game
 +        rd = context.scene.render
 +        return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
 +
 +    def draw_header(self, context):
 +        game = context.active_object.game
 +
 +        self.layout.prop(game, "create_obstacle", text="")
 +
 +    def draw(self, context):
 +        layout = self.layout
 +
 +        game = context.active_object.game
 +        wide_ui = context.region.width > narrowui
 +
 +        layout.active = game.create_obstacle
 +
 +        split = layout.split()
 +        col = split.column()
 +        col.prop(game, "obstacle_radius", text="Radius")
  
- class RenderButtonsPanel(bpy.types.Panel):
+ class RenderButtonsPanel():
      bl_space_type = 'PROPERTIES'
      bl_region_type = 'WINDOW'
      bl_context = "render"
@@@ -546,45 -522,9 +546,23 @@@ class WORLD_PT_game_physics(WorldButton
              col.label(text="Logic Steps:")
              col.prop(gs, "logic_step_max", text="Max")
  
- class WORLD_PT_game_physics_obstacles(WorldButtonsPanel):
++class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, bpy.types.Panel):
 +    bl_label = "Obstacle simulation"
 +    COMPAT_ENGINES = {'BLENDER_GAME'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +
 +        gs = context.scene.game_data
 +        wide_ui = context.region.width > narrowui
 +
 +        layout.prop(gs, "obstacle_simulation", text = "Type")
 +        if gs.obstacle_simulation != 'None':
 +            layout.prop(gs, "level_height")
 +            layout.prop(gs, "show_obstacle_simulation")
-                       
- classes = [
-     PHYSICS_PT_game_physics,
-     PHYSICS_PT_game_collision_bounds,
-     PHYSICS_PT_game_obstacles,
-     RENDER_PT_game,
-     RENDER_PT_game_player,
-     RENDER_PT_game_stereo,
-     RENDER_PT_game_shading,
-     RENDER_PT_game_performance,
-     RENDER_PT_game_sound,
-     WORLD_PT_game_context_world,
-     WORLD_PT_game_world,
-     WORLD_PT_game_mist,
-     WORLD_PT_game_physics,
-     WORLD_PT_game_physics_obstacles]
  
  def register():
-     register = bpy.types.register
-     for cls in classes:
-         register(cls)
+     pass
  
  
  def unregister():
index 252ef9123fbc8c9a1992b630ccce2ec153e4384e,859fcc3ce478333e7ccafe1a4f9c7885c76066a7..0601b8d3415fcc2e04b911dc741429ae88816400
@@@ -333,97 -333,9 +333,81 @@@ class ANIM_OT_keying_set_export(bpy.typ
          wm.add_fileselect(self)
          return {'RUNNING_MODAL'}
  
- class SCENE_PT_navmesh(SceneButtonsPanel):
++class SCENE_PT_navmesh(SceneButtonsPanel, bpy.types.Panel):
 +    bl_label = "Navmesh"
 +    bl_default_closed = True
 +    COMPAT_ENGINES = {'BLENDER_RENDER'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +
 +        rd = context.scene.game_data.recast_data
 +        wide_ui = context.region.width > narrowui
 +
 +        layout.operator("object.create_navmesh", text='Build navigation mesh')
 +
 +        layout.label(text="Rasterization:")
 +        split = layout.split()
 +
 +        col = split.column()
 +        col.prop(rd, "cellsize")
 +        if wide_ui:
 +            col = split.column()
 +        col.prop(rd, "cellheight")
 +
 +        layout.separator()
 +
 +        layout.label(text="Agent:")
 +        split = layout.split()
 +        col = split.column()
 +        row = col.row()
 +        row.prop(rd, "agentheight")
 +        row = col.row()
 +        row.prop(rd, "agentradius")
 +        if wide_ui:
 +            col = split.column()
 +        row = col.row()
 +        row.prop(rd, "agentmaxslope")
 +        row = col.row()
 +        row.prop(rd, "agentmaxclimb")
 +
 +        layout.separator()
 +
 +        layout.label(text="Region:")
 +        split = layout.split()
 +        col = split.column()
 +        col.prop(rd, "regionminsize")
 +        if wide_ui:
 +            col = split.column()
 +        col.prop(rd, "regionmergesize")
 +
 +        layout.separator()
 +
 +        layout.label(text="Polygonization:")
 +        split = layout.split()
 +        col = split.column()
 +        row = col.row()
 +        row.prop(rd, "edgemaxlen")
 +        row = col.row()
 +        row.prop(rd, "edgemaxerror")
 +        if wide_ui:
 +            col = split.column()
 +        row = col.row()
 +        row.prop(rd, "vertsperpoly")
 +
 +        layout.separator()
 +
 +        layout.label(text="Detail Mesh:")
 +        split = layout.split()
 +        col = split.column()
 +        col.prop(rd, "detailsampledist")
 +        if wide_ui:
 +            col = split.column()
 +        col.prop(rd, "detailsamplemaxerror")
 +
  
- classes = [
-     SCENE_PT_scene,
-     SCENE_PT_unit,
-     SCENE_PT_keying_sets,
-     SCENE_PT_keying_set_paths,
-     SCENE_PT_physics,
-     SCENE_PT_simplify,
-       SCENE_PT_navmesh,
-     SCENE_PT_custom_props,
-     ANIM_OT_keying_set_export]
  def register():
-     register = bpy.types.register
-     for cls in classes:
-         register(cls)
+     pass
  
  
  def unregister():
index 5f88c32068f0e00559836326a3c12c6eba37680f,88ddca3328c321bd37ee4d2ab4a38eeac38de923..d137d57e2b8e8e449d4c91e56c233c391e7bc6b6
@@@ -11092,8 -11039,80 +11082,79 @@@ static void do_versions(FileData *fd, L
                        }
                }
        }
 -
+       /* GSOC Sculpt 2010 - Sanity check on Sculpt/Paint settings */
+       if (main->versionfile < 253) {
+               Scene *sce;
+               for (sce= main->scene.first; sce; sce= sce->id.next) {
+                       if (sce->toolsettings->sculpt_paint_unified_alpha == 0)
+                               sce->toolsettings->sculpt_paint_unified_alpha = 0.5f;
+                       if (sce->toolsettings->sculpt_paint_unified_unprojected_radius == 0) 
+                               sce->toolsettings->sculpt_paint_unified_unprojected_radius = 0.125f;
+                       if (sce->toolsettings->sculpt_paint_unified_size == 0)
+                               sce->toolsettings->sculpt_paint_unified_size = 35;
+               }
+       }
+       if (main->versionfile < 253 || (main->versionfile == 253 && main->subversionfile < 1))
+               {
+                       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)
+                                               {
+                                                       smd->domain->vorticity = 2.0f;
+                                                       smd->domain->time_scale = 1.0f;
+                                                       if(!(smd->domain->flags & (1<<4)))
+                                                               continue;
+                                                       /* delete old MOD_SMOKE_INITVELOCITY flag */
+                                                       smd->domain->flags &= ~(1<<4);
+                                                       /* for now just add it to all flow objects in the scene */
+                                                       {
+                                                               Object *ob2;
+                                                               for(ob2 = main->object.first; ob2; ob2 = ob2->id.next) {
+                                                                       ModifierData *md2;
+                                                                       for(md2= ob2->modifiers.first; md2; md2= md2->next) {
+                                                                               if (md2->type == eModifierType_Smoke) {
+                                                                                       SmokeModifierData *smd2 = (SmokeModifierData *)md2;
+                                                                                       if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+                                                                                       {
+                                                                                               smd2->flow->flags |= MOD_SMOKE_FLOW_INITVELOCITY;
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                               else if((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow)
+                                               {
+                                                       smd->flow->vel_multi = 1.0f;
+                                               }
+                                       }
+                               }
+                       }
+               }
        /* put compatibility code here until next subversion bump */
        {
+               Brush *br;
+               for(br= main->brush.first; br; br= br->id.next) {
+                       if(br->ob_mode==0)
+                               br->ob_mode= (OB_MODE_SCULPT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT);
+               }
+               
        }
  
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
index 8a73c5bd04000bb66790424c4b632220b46358ab,f243b4cc497534f72c119f7c83fd41d9b8377953..04e70225f4170e0e03865612db7f7a180f5e688d
@@@ -124,13 -131,13 +131,13 @@@ void ED_setflagsLatt(struct Object *obe
  enum {
        MODIFIER_APPLY_DATA=1,
        MODIFIER_APPLY_SHAPE,
 -} eModifier_Apply_Mode;
 +};//eModifier_Apply_Mode
  
- struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, char *name, int type);
- int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md);
+ struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, char *name, int type);
+ int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
  int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
  int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
- int ED_object_modifier_convert(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md);
+ int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
  int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md, int mode);
  int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
  
index dd947e02de6f25ba51fbc1477a170b1593199cbc,0000000000000000000000000000000000000000..572edcff976a364e6de7426e474c924baeda8878
mode 100644,000000..100644
--- /dev/null
@@@ -1,619 -1,0 +1,620 @@@
-               ED_object_modifier_add(NULL, scene, obedit, NULL, eModifierType_NavMesh);
 +/**
 +* $Id:$
 +*
 +* ***** BEGIN GPL LICENSE BLOCK *****
 +*
 +* This program is free software; you can redistribute it and/or
 +* modify it under the terms of the GNU General Public License
 +* as published by the Free Software Foundation; either version 2
 +* of the License, or (at your option) any later version.
 +*
 +* This program is distributed in the hope that it will be useful,
 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +* GNU General Public License for more details.
 +*
 +* You should have received a copy of the GNU General Public License
 +* along with this program; if not, write to the Free Software Foundation,
 +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 +*
 +* The Original Code is Copyright (C) 2004 by Blender Foundation
 +* All rights reserved.
 +*
 +* The Original Code is: all of this file.
 +*
 +* Contributor(s): none yet.
 +*
 +* ***** END GPL LICENSE BLOCK *****
 +*/
 +#include <math.h>
 +#include "Recast.h"
 +
 +extern "C"
 +{
 +#include "MEM_guardedalloc.h"
 +
 +#include "DNA_scene_types.h"
 +#include "DNA_object_types.h"
 +#include "DNA_meshdata_types.h"
 +#include "DNA_modifier_types.h"
 +#include "DNA_ID.h"
 +
 +#include "BKE_library.h"
 +#include "BKE_depsgraph.h"
 +#include "BKE_context.h"
 +#include "BKE_mesh.h"
 +#include "BKE_modifier.h"
 +#include "BKE_scene.h"
 +#include "BKE_DerivedMesh.h"
 +#include "BKE_cdderivedmesh.h"
 +#include "BLI_editVert.h"
 +#include "BLI_listbase.h"
 +#include "ED_object.h"
 +#include "BLI_math_vector.h"
 +
 +#include "RNA_access.h"
 +
 +#include "ED_mesh.h"
 +
 +/*mesh/mesh_intern.h */
 +extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example);
 +extern struct EditFace *addfacelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges);
 +extern void free_vertlist(EditMesh *em, ListBase *edve);
 +extern void free_edgelist(EditMesh *em, ListBase *lb);
 +extern void free_facelist(EditMesh *em, ListBase *lb);
 +
 +#include "WM_api.h"
 +#include "WM_types.h"
 +
 +static void createVertsTrisData(bContext *C, LinkNode* obs, int& nverts, float*& verts, int &ntris, int*& tris)
 +{
 +      MVert *mvert;
 +      int nfaces = 0, *tri, i, curnverts, basenverts, curnfaces;
 +      MFace *mface;
 +      float co[3], wco[3];
 +      Object *ob;
 +      LinkNode *oblink, *dmlink;
 +      DerivedMesh *dm;
 +      Scene* scene = CTX_data_scene(C);
 +      LinkNode* dms = NULL;
 +
 +      nverts = 0;
 +      ntris = 0;
 +      //calculate number of verts and tris
 +      for (oblink = obs; oblink; oblink = oblink->next) 
 +      {
 +              ob = (Object*) oblink->link;    
 +              DerivedMesh *dm = mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH);
 +              BLI_linklist_append(&dms, (void*)dm);
 +
 +              nverts += dm->getNumVerts(dm);
 +              nfaces = dm->getNumFaces(dm);
 +              ntris += nfaces;
 +
 +              //resolve quad faces
 +              mface = dm->getFaceArray(dm);
 +              for (i=0; i<nfaces; i++)
 +              {
 +                      MFace* mf = &mface[i];
 +                      if (mf->v4)
 +                              ntris+=1;
 +              }
 +      }
 +
 +      //create data
 +      verts = (float*) MEM_mallocN(sizeof(float)*3*nverts, "verts");
 +      tris = (int*) MEM_mallocN(sizeof(int)*3*ntris, "faces");
 +
 +      basenverts = 0;
 +      tri = tris;
 +      for (oblink = obs, dmlink = dms; oblink && dmlink; 
 +                      oblink = oblink->next, dmlink = dmlink->next)
 +      {
 +              ob = (Object*) oblink->link;
 +              dm = (DerivedMesh*) dmlink->link;
 +
 +              curnverts = dm->getNumVerts(dm);
 +              mvert = dm->getVertArray(dm);
 +              //copy verts    
 +              for (i=0; i<curnverts; i++)
 +              {
 +                      MVert *v = &mvert[i];
 +                      copy_v3_v3(co, v->co);
 +                      mul_v3_m4v3(wco, ob->obmat, co);
 +                      verts[3*(basenverts+i)+0] = wco[0];
 +                      verts[3*(basenverts+i)+1] = wco[2];
 +                      verts[3*(basenverts+i)+2] = wco[1];
 +              }
 +
 +              //create tris
 +              curnfaces = dm->getNumFaces(dm);
 +              mface = dm->getFaceArray(dm);
 +              for (i=0; i<curnfaces; i++)
 +              {
 +                      MFace* mf = &mface[i]; 
 +                      tri[0]= basenverts + mf->v1; tri[1]= basenverts + mf->v3;       tri[2]= basenverts + mf->v2; 
 +                      tri += 3;
 +                      if (mf->v4)
 +                      {
 +                              tri[0]= basenverts + mf->v1; tri[1]= basenverts + mf->v4; tri[2]= basenverts + mf->v3; 
 +                              tri += 3;
 +                      }
 +              }
 +              basenverts += curnverts;
 +      }
 +
 +      //release derived mesh
 +      for (dmlink = dms; dmlink; dmlink = dmlink->next)
 +      {
 +              dm = (DerivedMesh*) dmlink->link;
 +              dm->release(dm);
 +      }
 +      BLI_linklist_free(dms, NULL);
 +}
 +
 +static bool buildNavMesh(const RecastData& recastParams, int nverts, float* verts, int ntris, int* tris,
 +                                                               rcPolyMesh*& pmesh, rcPolyMeshDetail*& dmesh)
 +{
 +      float bmin[3], bmax[3];
 +      rcHeightfield* solid;
 +      unsigned char *triflags;
 +      rcCompactHeightfield* chf;
 +      rcContourSet *cset;
 +
 +      rcCalcBounds(verts, nverts, bmin, bmax);
 +
 +      //
 +      // Step 1. Initialize build config.
 +      //
 +      rcConfig cfg;
 +      memset(&cfg, 0, sizeof(cfg));
 +      {
 +/*
 +              float cellsize = 0.3f;
 +              float cellheight = 0.2f;
 +              float agentmaxslope = M_PI/4;
 +              float agentmaxclimb = 0.9f;
 +              float agentheight = 2.0f;
 +              float agentradius = 0.6f;
 +              float edgemaxlen = 12.0f;
 +              float edgemaxerror = 1.3f;
 +              float regionminsize = 50.f;
 +              float regionmergesize = 20.f;
 +              int vertsperpoly = 6;
 +              float detailsampledist = 6.0f;
 +              float detailsamplemaxerror = 1.0f;
 +              cfg.cs = cellsize;
 +              cfg.ch = cellheight;
 +              cfg.walkableSlopeAngle = agentmaxslope/M_PI*180.f;
 +              cfg.walkableHeight = (int)ceilf(agentheight/ cfg.ch);
 +              cfg.walkableClimb = (int)floorf(agentmaxclimb / cfg.ch);
 +              cfg.walkableRadius = (int)ceilf(agentradius / cfg.cs);
 +              cfg.maxEdgeLen = (int)(edgemaxlen/cellsize);
 +              cfg.maxSimplificationError = edgemaxerror;
 +              cfg.minRegionSize = (int)rcSqr(regionminsize);
 +              cfg.mergeRegionSize = (int)rcSqr(regionmergesize);
 +              cfg.maxVertsPerPoly = vertsperpoly;
 +              cfg.detailSampleDist = detailsampledist< 0.9f ? 0 : cellsize * detailsampledist;
 +              cfg.detailSampleMaxError = cellheight * detailsamplemaxerror;
 +*/
 +              cfg.cs = recastParams.cellsize;
 +              cfg.ch = recastParams.cellheight;
 +              cfg.walkableSlopeAngle = recastParams.agentmaxslope/((float)M_PI)*180.f;
 +              cfg.walkableHeight = (int)ceilf(recastParams.agentheight/ cfg.ch);
 +              cfg.walkableClimb = (int)floorf(recastParams.agentmaxclimb / cfg.ch);
 +              cfg.walkableRadius = (int)ceilf(recastParams.agentradius / cfg.cs);
 +              cfg.maxEdgeLen = (int)(recastParams.edgemaxlen/recastParams.cellsize);
 +              cfg.maxSimplificationError = recastParams.edgemaxerror;
 +              cfg.minRegionSize = (int)rcSqr(recastParams.regionminsize);
 +              cfg.mergeRegionSize = (int)rcSqr(recastParams.regionmergesize);
 +              cfg.maxVertsPerPoly = recastParams.vertsperpoly;
 +              cfg.detailSampleDist = recastParams.detailsampledist< 0.9f ? 0 : 
 +                                                              recastParams.cellsize * recastParams.detailsampledist;
 +              cfg.detailSampleMaxError = recastParams.cellheight * recastParams.detailsamplemaxerror;
 +
 +      }
 +
 +      // Set the area where the navigation will be build.
 +      vcopy(cfg.bmin, bmin);
 +      vcopy(cfg.bmax, bmax);
 +      rcCalcGridSize(cfg.bmin, cfg.bmax, cfg.cs, &cfg.width, &cfg.height);
 +
 +      //
 +      // Step 2. Rasterize input polygon soup.
 +      //
 +      // Allocate voxel heightfield where we rasterize our input data to.
 +      solid = new rcHeightfield;
 +      if (!solid)
 +              return false;
 +
 +      if (!rcCreateHeightfield(*solid, cfg.width, cfg.height, cfg.bmin, cfg.bmax, cfg.cs, cfg.ch))
 +              return false;
 +
 +      // Allocate array that can hold triangle flags.
 +      triflags = (unsigned char*) MEM_mallocN(sizeof(unsigned char)*ntris, "triflags");
 +      if (!triflags)
 +              return false;
 +      // Find triangles which are walkable based on their slope and rasterize them.
 +      memset(triflags, 0, ntris*sizeof(unsigned char));
 +      rcMarkWalkableTriangles(cfg.walkableSlopeAngle, verts, nverts, tris, ntris, triflags);
 +      rcRasterizeTriangles(verts, nverts, tris, triflags, ntris, *solid);
 +      MEM_freeN(triflags);
 +      MEM_freeN(verts);
 +      MEM_freeN(tris);
 +
 +      //
 +      // Step 3. Filter walkables surfaces.
 +      //
 +      rcFilterLedgeSpans(cfg.walkableHeight, cfg.walkableClimb, *solid);
 +      rcFilterWalkableLowHeightSpans(cfg.walkableHeight, *solid);
 +
 +      //
 +      // Step 4. Partition walkable surface to simple regions.
 +      //
 +
 +      chf = new rcCompactHeightfield;
 +      if (!chf)
 +              return false;
 +      if (!rcBuildCompactHeightfield(cfg.walkableHeight, cfg.walkableClimb, RC_WALKABLE, *solid, *chf))
 +              return false;
 +
 +      delete solid; 
 +
 +      // Prepare for region partitioning, by calculating distance field along the walkable surface.
 +      if (!rcBuildDistanceField(*chf))
 +              return false;
 +
 +      // Partition the walkable surface into simple regions without holes.
 +      if (!rcBuildRegions(*chf, cfg.walkableRadius, cfg.borderSize, cfg.minRegionSize, cfg.mergeRegionSize))
 +              return false;
 +
 +      //
 +      // Step 5. Trace and simplify region contours.
 +      //
 +      // Create contours.
 +      cset = new rcContourSet;
 +      if (!cset)
 +              return false;
 +
 +      if (!rcBuildContours(*chf, cfg.maxSimplificationError, cfg.maxEdgeLen, *cset))
 +              return false;
 +
 +      //
 +      // Step 6. Build polygons mesh from contours.
 +      //
 +      pmesh = new rcPolyMesh;
 +      if (!pmesh)
 +              return false;
 +      if (!rcBuildPolyMesh(*cset, cfg.maxVertsPerPoly, *pmesh))
 +              return false;
 +
 +
 +      //
 +      // Step 7. Create detail mesh which allows to access approximate height on each polygon.
 +      //
 +
 +      dmesh = new rcPolyMeshDetail;
 +      if (!dmesh)
 +              return false;
 +
 +      if (!rcBuildPolyMeshDetail(*pmesh, *chf, cfg.detailSampleDist, cfg.detailSampleMaxError, *dmesh))
 +              return false;
 +
 +      delete chf;
 +      delete cset;
 +
 +      return true;
 +}
 +
 +static Object* createRepresentation(bContext *C, rcPolyMesh*& pmesh, rcPolyMeshDetail*& dmesh, Base* base)
 +{
 +      float co[3], rot[3];
 +      EditMesh *em;
 +      int i,j, k, polyverts;
 +      unsigned short* v;
 +      int face[3];
++      Main *bmain = CTX_data_main(C);
 +      Scene *scene= CTX_data_scene(C);
 +      Object* obedit;
 +      int createob = base==NULL;
 +      zero_v3(co);
 +      zero_v3(rot);
 +      if (createob)
 +      {
 +              //create new object
 +              obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
 +      }
 +      else
 +      {
 +              obedit = base->object;
 +              scene_select_base(scene, base);
 +              copy_v3_v3(obedit->loc, co);
 +              copy_v3_v3(obedit->rot, rot);
 +      }
 +
 +      ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER);
 +      em = BKE_mesh_get_editmesh(((Mesh *)obedit->data));
 +
 +      if (!createob)
 +      {
 +              //clear
 +              if(em->verts.first) free_vertlist(em, &em->verts);
 +              if(em->edges.first) free_edgelist(em, &em->edges);
 +              if(em->faces.first) free_facelist(em, &em->faces);
 +              if(em->selected.first) BLI_freelistN(&(em->selected));
 +      }
 +
 +      //create verts for polygon mesh
 +      for(i = 0; i < pmesh->nverts; i++) {
 +              v = &pmesh->verts[3*i];
 +              co[0] = pmesh->bmin[0] + v[0]*pmesh->cs;
 +              co[1] = pmesh->bmin[1] + v[1]*pmesh->ch;
 +              co[2] = pmesh->bmin[2] + v[2]*pmesh->cs;
 +              SWAP(float, co[1], co[2]);
 +              addvertlist(em, co, NULL);
 +      }
 +      polyverts = pmesh->nverts;
 +
 +      //create custom data layer to save polygon idx
 +      CustomData_add_layer_named(&em->fdata, CD_RECAST, CD_CALLOC, NULL, 0, "recastData");
 +
 +      //create verts and faces for detailed mesh
 +      for (i=0; i<dmesh->nmeshes; i++)
 +      {
 +              int uniquevbase = em->totvert;
 +              unsigned short vbase = dmesh->meshes[4*i+0];
 +              unsigned short ndv = dmesh->meshes[4*i+1];
 +              unsigned short tribase = dmesh->meshes[4*i+2];
 +              unsigned short trinum = dmesh->meshes[4*i+3];
 +              const unsigned short* p = &pmesh->polys[i*pmesh->nvp*2];
 +              int nv = 0;
 +              for (j = 0; j < pmesh->nvp; ++j)
 +              {
 +                      if (p[j] == 0xffff) break;
 +                      nv++;
 +              }
 +              //create unique verts 
 +              for (j=nv; j<ndv; j++)
 +              {
 +                      copy_v3_v3(co, &dmesh->verts[3*(vbase + j)]);
 +                      SWAP(float, co[1], co[2]);
 +                      addvertlist(em, co, NULL);
 +              }
 +
 +              EM_init_index_arrays(em, 1, 0, 0);
 +              
 +              //create faces
 +              for (j=0; j<trinum; j++)
 +              {
 +                      unsigned char* tri = &dmesh->tris[4*(tribase+j)];
 +                      EditFace* newFace;
 +                      for (k=0; k<3; k++)
 +                      {
 +                              if (tri[k]<nv)
 +                                      face[k] = p[tri[k]]; //shared vertex
 +                              else
 +                                      face[k] = uniquevbase+tri[k]-nv; //unique vertex
 +                      }
 +                      newFace = addfacelist(em, EM_get_vert_for_index(face[0]), EM_get_vert_for_index(face[2]), 
 +                                                                      EM_get_vert_for_index(face[1]), NULL, NULL, NULL);
 +
 +                      //set navigation polygon idx to the custom layer
 +                      int* polygonIdx = (int*)CustomData_em_get(&em->fdata, newFace->data, CD_RECAST);
 +                      *polygonIdx = i+1; //add 1 to avoid zero idx
 +              }
 +              
 +              EM_free_index_arrays();
 +      }
 +
 +      delete pmesh; pmesh = NULL;
 +      delete dmesh; dmesh = NULL;
 +
 +      BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
 +      
 +      DAG_id_flush_update((ID*)obedit->data, OB_RECALC_DATA);
 +      WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 +
 +
 +      ED_object_exit_editmode(C, EM_FREEDATA); 
 +      WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
 +
 +      if (createob)
 +      {
 +              obedit->gameflag &= ~OB_COLLISION;
 +              obedit->gameflag |= OB_NAVMESH;
 +              obedit->body_type = OB_BODY_TYPE_NAVMESH;
 +              rename_id((ID *)obedit, "Navmesh");
 +      }
 +      
 +      ModifierData *md= modifiers_findByType(obedit, eModifierType_NavMesh);
 +      if (!md)
 +      {
++              ED_object_modifier_add(NULL, bmain, scene, obedit, NULL, eModifierType_NavMesh);
 +      }
 +
 +      return obedit;
 +}
 +
 +static int create_navmesh_exec(bContext *C, wmOperator *op)
 +{
 +      Scene* scene = CTX_data_scene(C);
 +      int nverts, ntris;
 +      float* verts;
 +      int* tris;
 +      rcPolyMesh* pmesh;
 +      rcPolyMeshDetail* dmesh;
 +      LinkNode* obs = NULL;
 +      Base* navmeshBase = NULL;
 +      CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases)
 +      {
 +              if (base->object->body_type==OB_BODY_TYPE_NAVMESH)
 +              {
 +                      if (!navmeshBase || base==CTX_data_active_base(C))
 +                              navmeshBase = base;
 +              }
 +              else
 +                      BLI_linklist_append(&obs, (void*)base->object);
 +      }               
 +      CTX_DATA_END;
 +      createVertsTrisData(C, obs, nverts, verts, ntris, tris);
 +      BLI_linklist_free(obs, NULL);
 +      buildNavMesh(scene->gm.recastData, nverts, verts, ntris, tris, pmesh, dmesh);
 +      createRepresentation(C, pmesh, dmesh, navmeshBase);
 +
 +      return OPERATOR_FINISHED;
 +}
 +
 +void OBJECT_OT_create_navmesh(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Create navigation mesh";
 +      ot->description= "Create navigation mesh for selected objects";
 +      ot->idname= "OBJECT_OT_create_navmesh";
 +
 +      /* api callbacks */
 +      ot->exec= create_navmesh_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +}
 +
 +static int assign_navpolygon_poll(bContext *C)
 +{
 +      Object *ob= (Object *)CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 +      if (!ob || !ob->data)
 +              return 0;
 +      return (((Mesh*)ob->data)->edit_mesh != NULL);
 +}
 +
 +static int assign_navpolygon_exec(bContext *C, wmOperator *op)
 +{
 +      Object *obedit= CTX_data_edit_object(C);
 +      EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
 +
 +      //do work here
 +      int targetPolyIdx = -1;
 +      EditFace *ef, *efa;
 +      efa = EM_get_actFace(em, 0);
 +      if (efa) 
 +      {
 +              if (CustomData_has_layer(&em->fdata, CD_RECAST))
 +              {
 +                      targetPolyIdx = *(int*)CustomData_em_get(&em->fdata, efa->data, CD_RECAST);
 +                      targetPolyIdx = targetPolyIdx>=0? targetPolyIdx : -targetPolyIdx;
 +                      if (targetPolyIdx>0)
 +                      {
 +                              //set target poly idx to other selected faces
 +                              ef = (EditFace*)em->faces.last;
 +                              while(ef) 
 +                              {
 +                                      if((ef->f & SELECT )&& ef!=efa) 
 +                                      {
 +                                              int* recastDataBlock = (int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
 +                                              *recastDataBlock = targetPolyIdx;
 +                                      }
 +                                      ef = ef->prev;
 +                              }
 +                      }
 +              }               
 +      }
 +      
 +      DAG_id_flush_update((ID*)obedit->data, OB_RECALC_DATA);
 +      WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 +
 +      BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
 +      return OPERATOR_FINISHED;
 +}
 +
 +void OBJECT_OT_assign_navpolygon(struct wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Assign polygon index ";
 +      ot->description= "Assign polygon index to face by active face";
 +      ot->idname= "OBJECT_OT_assign_navpolygon";
 +
 +      /* api callbacks */
 +      ot->poll = assign_navpolygon_poll;
 +      ot->exec= assign_navpolygon_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +}
 +
 +static int compare(const void * a, const void * b){  
 +      return ( *(int*)a - *(int*)b );
 +}
 +static int findFreeNavPolyIndex(EditMesh* em)
 +{
 +      //construct vector of indices
 +      int numfaces = em->totface;
 +      int* indices = new int[numfaces];
 +      EditFace* ef = (EditFace*)em->faces.last;
 +      int idx = 0;
 +      while(ef) 
 +      {
 +              int polyIdx = *(int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
 +              indices[idx] = polyIdx;
 +              idx++;
 +              ef = ef->prev;
 +      }
 +      qsort(indices, numfaces, sizeof(int), compare);
 +      //search first free index
 +      int freeIdx = 1;
 +      for (int i=0; i<numfaces; i++)
 +      {
 +              if (indices[i]==freeIdx)
 +                      freeIdx++;
 +              else if (indices[i]>freeIdx)
 +                      break;
 +      }
 +      delete indices;
 +      return freeIdx;
 +}
 +
 +static int assign_new_navpolygon_exec(bContext *C, wmOperator *op)
 +{
 +      Object *obedit= CTX_data_edit_object(C);
 +      EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
 +
 +      EditFace *ef;
 +      if (CustomData_has_layer(&em->fdata, CD_RECAST))
 +      {
 +              int targetPolyIdx = findFreeNavPolyIndex(em);
 +              if (targetPolyIdx>0)
 +              {
 +                      //set target poly idx to selected faces
 +                      ef = (EditFace*)em->faces.last;
 +                      while(ef) 
 +                      {
 +                              if(ef->f & SELECT ) 
 +                              {
 +                                      int* recastDataBlock = (int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
 +                                      *recastDataBlock = targetPolyIdx;
 +                              }
 +                              ef = ef->prev;
 +                      }
 +              }
 +      }               
 +
 +      DAG_id_flush_update((ID*)obedit->data, OB_RECALC_DATA);
 +      WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 +
 +      BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
 +      return OPERATOR_FINISHED;
 +}
 +
 +void OBJECT_OT_assign_new_navpolygon(struct wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Assign new polygon index ";
 +      ot->description= "Assign new polygon index to face";
 +      ot->idname= "OBJECT_OT_assign_new_navpolygon";
 +
 +      /* api callbacks */
 +      ot->poll = assign_navpolygon_poll;
 +      ot->exec= assign_new_navpolygon_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +}
 +}
index a4885b679233e7adc1953a90cb6a6586cf7ebfde,f5145d862703538cbbf877195e18843bd5f32ecc..4a5596f7a5eefe3d9ee8374a792b78d64bce483d
@@@ -1881,83 -1865,6 +1881,83 @@@ static void rna_def_armature_actuator(B
        RNA_def_property_update(prop, NC_LOGIC, NULL);
  }
  
-       RNA_def_property_pointer_funcs(prop, NULL, "rna_SteeringActuator_navmesh_set", NULL);
 +static void rna_def_steering_actuator(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      static EnumPropertyItem prop_type_items[] ={
 +              {ACT_STEERING_SEEK, "SEEK", 0, "Seek", ""},
 +              {ACT_STEERING_FLEE, "FLEE", 0, "Flee", ""},
 +              {ACT_STEERING_PATHFOLLOWING, "PATHFOLLOWING", 0, "Path following", ""},
 +              {0, NULL, 0, NULL, NULL}};
 +
 +      srna= RNA_def_struct(brna, "SteeringActuator", "Actuator");
 +      RNA_def_struct_ui_text(srna, "Steering Actuator", "");
 +      RNA_def_struct_sdna_from(srna, "bSteeringActuator", "data");
 +
 +      prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "type");
 +      RNA_def_property_enum_items(prop, prop_type_items);
 +      RNA_def_property_ui_text(prop, "Behavior", "");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "velocity");
 +      RNA_def_property_range(prop, 0.0, 1000.0);
 +      RNA_def_property_ui_text(prop, "Velocity", "Velocity magnitude");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "acceleration");
 +      RNA_def_property_range(prop, 0.0, 1000.0);
 +      RNA_def_property_ui_text(prop, "Acceleration", "Max acceleration");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "turnspeed", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "turnspeed");
 +      RNA_def_property_range(prop, 0.0, 720.0);
 +      RNA_def_property_ui_text(prop, "Turn speed", "Max turn speed");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "dist");
 +      RNA_def_property_range(prop, 0.0, 1000.0);
 +      RNA_def_property_ui_text(prop, "Dist", "Relax distance");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "Object");
 +      RNA_def_property_pointer_sdna(prop, NULL, "target");
 +      RNA_def_property_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Target Object", "Set target object");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "selfterminated", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_SELFTERMINATED);
 +      RNA_def_property_ui_text(prop, "Self terminated", "Terminate when target is reached");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "enablevisualization", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_ENABLEVISUALIZATION);
 +      RNA_def_property_ui_text(prop, "Visualize", "Enable debug visualization");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "updateperiod", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "updateTime");
 +      RNA_def_property_ui_range(prop, -1, 100000, 1, 1);
 +      RNA_def_property_ui_text(prop, "Update period", "Path update period");
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +
 +      prop= RNA_def_property(srna, "navmesh", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "Object");
 +      RNA_def_property_pointer_sdna(prop, NULL, "navmesh");
 +      RNA_def_property_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "NavMesh Object", "Navigation mesh");
++      RNA_def_property_pointer_funcs(prop, NULL, "rna_SteeringActuator_navmesh_set", NULL, NULL);
 +      RNA_def_property_update(prop, NC_LOGIC, NULL);
 +}
 +
  void RNA_def_actuator(BlenderRNA *brna)
  {
        rna_def_actuator(brna);
index 0af14a97cb9d1afd6bccc6ce54935892ff123f47,ca388951e68de9c8e31263134f4704be2792c623..607b6363cb6bf030959000069de36e092f8e335b
@@@ -1847,35 -1793,7 +1876,35 @@@ static void rna_def_scene_game_data(Ble
        prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
        RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
-       RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+       RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
 +
 +      /* obstacle simulation */
 +      prop= RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "obstacleSimulation");
 +      RNA_def_property_enum_items(prop, obstacle_simulation_items);
 +      RNA_def_property_ui_text(prop, "Obstacle simulation", "Simulation used for obstacle avoidance in the game engine");
 +      RNA_def_property_update(prop, NC_SCENE, NULL);
 +
 +      prop= RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION);
 +      RNA_def_property_float_sdna(prop, NULL, "levelHeight");
 +      RNA_def_property_range(prop, 0.0f, 200.0f);
 +      RNA_def_property_ui_text(prop, "Level height", "Max difference in heights of obstacles to enable their interaction");
 +      RNA_def_property_update(prop, NC_SCENE, NULL);
 +
 +      prop= RNA_def_property(srna, "show_obstacle_simulation", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_OBSTACLE_SIMULATION);
 +      RNA_def_property_ui_text(prop, "Visualization", "Enable debug visualization for obstacle simulation");
 +
 +      /* Recast Settings */
 +      prop= RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_flag(prop, PROP_NEVER_NULL);
 +      RNA_def_property_pointer_sdna(prop, NULL, "recastData");
 +      RNA_def_property_struct_type(prop, "SceneGameRecastData");
 +      RNA_def_property_ui_text(prop, "Recast Data", "");
 +
 +      /* Nestled Data  */
 +      rna_def_scene_game_recast_data(brna);
 +      
  }
  
  static void rna_def_scene_render_layer(BlenderRNA *brna)
Simple merge