Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier de Blois <rddeblois@gmail.com>2016-04-05 21:38:42 +0300
committerPorteries Tristan <republicthunderbolt9@gmail.com>2016-04-05 22:39:04 +0300
commitc084520b0376c4ab92cb0193577a79cf23e5bb80 (patch)
tree645f35cdaa87464bb55e5c2b5657f86a142fedb2 /source/blender/makesrna
parent176538f61360fb54f0e4ce209fc7d7632bce1401 (diff)
Expose new Recast partitioning methods for navmesh generation
This patch depends on D1747, which upgrades the Recast version. It exposes the new Recast partitioning methods in the navmesh generation. Reviewers: campbellbarton, moguri Reviewed By: moguri Projects: #bf_blender Differential Revision: https://developer.blender.org/D1748
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 2af58a93305..94223f7f7da 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3565,6 +3565,13 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem rna_enum_partitioning_items[] = {
+ {RC_PARTITION_WATERSHED, "WATERSHED", 0, "Watershed", "Classic Recast partitioning method generating the nicest tessellation"},
+ {RC_PARTITION_MONOTONE, "MONOTONE", 0, "Monotone", "Fastest navmesh generation method, may create long thin polygons"},
+ {RC_PARTITION_LAYERS, "LAYERS", 0, "Layers", "Reasonably fast method that produces better triangles than monotone partitioning"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna = RNA_def_struct(brna, "SceneGameRecastData", NULL);
RNA_def_struct_sdna(srna, "RecastData");
RNA_def_struct_nested(brna, srna, "Scene");
@@ -3627,6 +3634,13 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)");
RNA_def_property_update(prop, NC_SCENE, NULL);
+ prop = RNA_def_property(srna, "partitioning", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "partitioning");
+ RNA_def_property_enum_items(prop, rna_enum_partitioning_items);
+ RNA_def_property_enum_default(prop, RC_PARTITION_WATERSHED);
+ RNA_def_property_ui_text(prop, "Partitioning", "Choose partitioning method");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
prop = RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "edgemaxlen");
RNA_def_property_ui_range(prop, 0, 50, 1, 2);