diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-22 19:29:01 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-22 19:29:01 +0400 |
commit | 8801330c18b063e341e8263131c91695cd1b7bdf (patch) | |
tree | c20e9b923d0c53a7327632c7290e211cffbb97ce /source/blender/makesrna/intern/rna_modifier.c | |
parent | f7b116e0bdedf68631cbc20eb99e2fb22b4325fa (diff) |
Add skin modifier: DNA, RNA, UI, and MOD_skin.c implementation.
Skin modifier documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/SkinModifier
Implementation based in part off the paper "B-Mesh: A Fast Modeling
System for Base Meshes of 3D Articulated Shapes" (Zhongping Ji,
Ligang Liu, Yigang Wang)
Note that to avoid confusion with Blender's BMesh data structure,
this tool is renamed as the Skin modifier.
The B-Mesh paper is current available here:
http://www.math.zju.edu.cn/ligangliu/CAGD/Projects/BMesh/
The main missing features in this code compared to the paper are:
* No mesh evolution. The paper suggests iteratively subsurfing the
skin output and adapting the output to better conform with the
spheres of influence surrounding each vertex.
* No mesh fairing. The paper suggests re-aligning output edges to
follow principal mesh curvatures.
* No auxiliary balls. These would serve to influence mesh
evolution, which as noted above is not implemented.
The code also adds some features not present in the paper:
* Loops in the input edge graph.
* Concave surfaces around branch nodes. The paper does not discuss
how to handle non-convex regions; this code adds a number of
cleanup operations to handle many (though not all) of these
cases.
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 4a7050b47e9..659c04015df 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -75,6 +75,7 @@ EnumPropertyItem modifier_type_items[] = { {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""}, {eModifierType_Remesh, "REMESH", ICON_MOD_REMESH, "Remesh", ""}, {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""}, + {eModifierType_Skin, "SKIN", ICON_MOD_SKIN, "Skin", ""}, {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""}, {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""}, {0, "", 0, N_("Deform"), ""}, @@ -207,6 +208,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_DynamicPaintModifier; case eModifierType_Remesh: return &RNA_RemeshModifier; + case eModifierType_Skin: + return &RNA_SkinModifier; default: return &RNA_Modifier; } @@ -3196,6 +3199,42 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) /* XXX how to update? */ } +static void rna_def_modifier_skin(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "SkinModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Skin Modifier", "Generate Skin"); + RNA_def_struct_sdna(srna, "SkinModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_SKIN); + + prop = RNA_def_property(srna, "branch_smoothing", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Branch Smoothing", "Smooth complex geometry around branches"); + RNA_def_property_ui_range(prop, 0, 1, 1, 0); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SKIN_SMOOTH_SHADING); + RNA_def_property_ui_text(prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "use_x_symmetry", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_X); + RNA_def_property_ui_text(prop, "X", "Avoid making unsymmetric quads across the X axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "use_y_symmetry", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_Y); + RNA_def_property_ui_text(prop, "Y", "Avoid making unsymmetric quads across the Y axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "use_z_symmetry", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_Z); + RNA_def_property_ui_text(prop, "Z", "Avoid making unsymmetric quads across the Z axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); +} + void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; @@ -3301,6 +3340,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_dynamic_paint(brna); rna_def_modifier_ocean(brna); rna_def_modifier_remesh(brna); + rna_def_modifier_skin(brna); } #endif |