- for some reason navmesh wasnt drawing when VBO was enabled.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Oct 2011 02:56:26 +0000 (02:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Oct 2011 02:56:26 +0000 (02:56 +0000)
- fix navmesh crash (may well have been from own changes)
- changing VBO's now redraws all windows - useful for checking if VBO draws differently.

source/blender/blenkernel/intern/DerivedMesh.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_userdef.c
source/gameengine/Converter/KX_IpoConvert.cpp

index e46ea1bbe38cc2f56236f05435cf1b543aff0a11..53973608cd6cccb80e8a91540cf65b394c57fae7 100644 (file)
@@ -3001,7 +3001,7 @@ static void navmesh_drawColored(DerivedMesh *dm)
        glEnable(GL_LIGHTING);*/
 
        glDisable(GL_LIGHTING);
-       if(GPU_buffer_legacy(dm) ) {
+       /*  if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
                DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
                //glShadeModel(GL_SMOOTH);
                glBegin(glmode = GL_QUADS);
@@ -3062,8 +3062,10 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm)
        result = CDDM_copy(dm);
        if (!CustomData_has_layer(&result->faceData, CD_RECAST)) {
                int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
-               CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
-                       sourceRecastData, maxFaces, "recastData");
+               if (sourceRecastData) {
+                       CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
+                                                  sourceRecastData, maxFaces, "recastData");
+               }
        }
        recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST);
 
index 96ffa6b2ed45aaadd60c2b0f46be25b2971552ff..428599af9778df4160ac89010c9cd16446ec5a35 100644 (file)
@@ -946,6 +946,7 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
 
        if (was_navmesh != (ob->gameflag & OB_NAVMESH)) {
                if (ob->type == OB_MESH) {
+                       /* this is needed to refresh the derived meshes draw func */
                        DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
                        WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
                }
@@ -1424,8 +1425,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
        prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "body_type");
        RNA_def_property_enum_items(prop, body_type_items);
-       RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get",
-                                   "rna_GameObjectSettings_physics_type_set", NULL);
+       RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
        RNA_def_property_ui_text(prop, "Physics Type",  "Selects the type of physical representation");
        RNA_def_property_update(prop, NC_LOGIC, NULL);
 
index 5d2f24e8324d50e78b5bcef3d2edc795655ae82f..e7f534a3528ec8ebed89ab6ca838f64f88a632c6 100644 (file)
@@ -2661,8 +2661,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
-       RNA_def_property_ui_text(prop, "VBOs",
-                                "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
+       RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
+       RNA_def_property_update(prop, NC_WINDOW, NULL); /* this isnt essential but nice to check if VBO draws any differently */
 
        prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
index b13dbe324f5e1f5ad12086ec39e6ef6c80d4855b..4ea77e4349d34014103ae2313a3227c695d51988 100644 (file)
@@ -102,7 +102,7 @@ SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_B
                rotmode = "rotation_axis_angle";
                drotmode = "delta_rotation_axis_angle";
                break;
-       case ROT_MODE_QUAT:
+       case ROT_MODE_QUAT: /* XXX, this isnt working, currently only eulers are supported [#28853] */
                rotmode = "rotation_quaternion";
                drotmode = "delta_rotation_quaternion";
                break;