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:
authorMitchell Stokes <mogurijin@gmail.com>2011-07-26 10:10:05 +0400
committerMitchell Stokes <mogurijin@gmail.com>2011-07-26 10:10:05 +0400
commit1f65b3b1a8f5ccc54a794ed0d6f8cf2d3e2c5a36 (patch)
tree236c1d8475709b45962fd5efa901626a78fedbe0 /source/blender/makesrna/intern/rna_armature.c
parent1e0e0ff5c4e88f2ee21c849b151a1899ae4c714f (diff)
BGE Animations: Adding a new choice for vertex deformation for armatures, which can be found in the Armature's Skeleton panel by the Deform options. Before only Blender's armature_deform_verts() was used. Now users can choose a vertex deformation function that is optimized for the BGE. At the moment it is mostly a copy of armature_deform_verts() with various chunks of code removed, and the BLI_math code was replaced with Eigen2. In my test scene, the new function offered about a 40% improvement over armature_deform_verts() (17~19ms rasterizer to 11~12ms). The only current limitation that I'm aware of if that B-Bone segments are not supported in the BGE version, and I will probably leave it out. I would like to also limit the BGE version to 4 weights to make things easier for a GPU version, but this may just make things slower (sorting weights to find the top 4).
Diffstat (limited to 'source/blender/makesrna/intern/rna_armature.c')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 3f58723a929..19a6b482621 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -818,6 +818,10 @@ static void rna_def_armature(BlenderRNA *brna)
{ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing deformation influence volume"},
{ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem prop_vdeformer[] = {
+ {ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Uses Blender's armature vertex deformation"},
+ {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Uses vertex deformation code optimized for the BGE"},
+ {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_ghost_type_items[] = {
{ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"},
{ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"},
@@ -864,6 +868,13 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Type", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
+
+ prop= RNA_def_property(srna, "vert_deformer", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer");
+ RNA_def_property_enum_items(prop, prop_vdeformer);
+ RNA_def_property_ui_text(prop, "Vertex Deformer", "");
+ RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+ RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
// XXX depreceated ....... old animviz for armatures only
prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE);