diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-02 08:20:44 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-02 08:20:44 +0300 |
commit | 983282175084607242ba36d9e17dfcd398bce642 (patch) | |
tree | a2473bd82701968b6eda6d7e10e664cee66d3dd5 /source/blender/makesrna | |
parent | 332e4718f5718393822c77c0f9616f5895d1261c (diff) |
Added RNA for the Displace modifier. Once again, not sure how to handle uvlayer.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 1567c3c20a4..313bc877af7 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -625,10 +625,60 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna) static void rna_def_modifier_displace(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_direction_items[] = { + {MOD_DISP_DIR_X, "DIRX", "X", ""}, + {MOD_DISP_DIR_Y, "DIRY", "Y", ""}, + {MOD_DISP_DIR_Z, "DIRZ", "Z", ""}, + {MOD_DISP_DIR_NOR, "DIRNORMAL", "Normal", ""}, + {MOD_DISP_DIR_RGB_XYZ, "DIRRGBTOXYZ", "RGB To XYZ", ""}, + {0, NULL, NULL, NULL}}; + + static EnumPropertyItem prop_texture_coordinates_items[] = { + {MOD_DISP_MAP_LOCAL, "MAPLOCAL", "Map", ""}, + {MOD_DISP_MAP_GLOBAL, "MAPGLOBAL", "Global", ""}, + {MOD_DISP_MAP_OBJECT, "MAPOBJECT", "Object", ""}, + {MOD_DISP_MAP_UV, "MAPUV", "UV", ""}, + {0, NULL, NULL, NULL}}; srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Displace Modifier", "Displace Modifier."); RNA_def_struct_sdna(srna, "DisplaceModifierData"); + + prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); + RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); + + prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ID"); + RNA_def_property_ui_text(prop, "Texture", ""); + + prop= RNA_def_property(srna, "midlevel", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0, 1); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement."); + + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, FLT_MIN, FLT_MAX); + RNA_def_property_ui_range(prop, -100, 100, 10, 2); + RNA_def_property_ui_text(prop, "Strength", ""); + + prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_direction_items); + RNA_def_property_ui_text(prop, "Direction", ""); + + prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "texmapping"); + RNA_def_property_enum_items(prop, prop_texture_coordinates_items); + RNA_def_property_ui_text(prop, "Texture Coordinates", ""); + + /* XXX: not sure how to handle uvlayer_tmp (for setting the UV layer if UV mapping is used.) */ + + prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "map_object"); + RNA_def_property_struct_type(prop, "ID"); + RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); } static void rna_def_modifier_uvproject(BlenderRNA *brna) |