diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-02 00:16:16 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-02 00:16:16 +0300 |
commit | 14776f48730924f92ee512576a1e7625155d78c1 (patch) | |
tree | a67430e1faa8d319cb9a512e539bd9d5b89acc6a /source/blender | |
parent | 112385660aeefbd503b128c91a3c7fc09d1e6d5a (diff) |
Added RNA for the Subsurf and Lattice modifiers.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 3d51780abc0..37318c60cf2 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -104,19 +104,56 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) static void rna_def_modifier_subsurf(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_subdivision_type_items[] = { + {0, "CATMULLCLARK", "Catmull-Clark", ""}, + {1, "SIMPLE", "Simple", ""}, + {0, NULL, NULL, NULL}}; srna= RNA_def_struct(brna, "SubsurfModifier", "Modifier"); - RNA_def_struct_ui_text(srna , "Subsurf Modifier", "Subsurf Modifier."); + RNA_def_struct_ui_text(srna, "Subsurf Modifier", "Subsurf Modifier."); RNA_def_struct_sdna(srna, "SubsurfModifierData"); + + prop= RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "subdivType"); + RNA_def_property_enum_items(prop, prop_subdivision_type_items); + RNA_def_property_ui_text(prop, "Subdivision Type", "Selects type of subdivision algorithm."); + + prop= RNA_def_property(srna, "levels", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 1, 6); + RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform."); + + prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "renderLevels"); + RNA_def_property_range(prop, 1, 6); + RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering."); + + prop= RNA_def_property(srna, "optimal_draw", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges); + RNA_def_property_ui_text(prop, "Optimal Draw", "Skip drawing/rendering of interior subdivided edges"); + + prop= RNA_def_property(srna, "subsurf_uv", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv); + RNA_def_property_ui_text(prop, "Subsurf UV", "Use subsurf to subdivide UVs."); } static void rna_def_modifier_lattice(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna= RNA_def_struct(brna, "LatticeModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Lattice Modifier", "Lattice Modifier."); RNA_def_struct_sdna(srna, "LatticeModifierData"); + + prop= RNA_def_property(srna, "lattice", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "object"); + RNA_def_property_ui_text(prop, "Lattice", "Lattice object to deform with."); + + prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); } static void rna_def_modifier_curve(BlenderRNA *brna) |