diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2011-09-09 16:21:41 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2011-09-09 16:21:41 +0400 |
commit | c1c4743696c67f562eda31e90d03c72eaec04567 (patch) | |
tree | 12c992e4160d7ff878f05f33549ff24b0ae3faa1 /source/blender/makesrna/intern/rna_modifier.c | |
parent | dbd6658d737b1592a633ddf6397be14e50e434d9 (diff) | |
parent | 01744abd8187d1566b336bf38033673aa05b6786 (diff) |
svn merge -r 39975:40061 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 370 |
1 files changed, 370 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index ab89ec43740..370c9b8bd0c 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -68,7 +68,11 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""}, {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""}, {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""}, + {0, "", 0, "Modify", ""}, {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""}, + {eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Edit", ""}, + {eModifierType_WeightVGMix, "VERTEX_WEIGHT_MIX", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Mix", ""}, + {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Proximity", ""}, {0, "", 0, "Deform", ""}, {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""}, {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""}, @@ -187,6 +191,12 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_WarpModifier; case eModifierType_NavMesh: return &RNA_NavMeshModifier; + case eModifierType_WeightVGEdit: + return &RNA_VertexWeightEditModifier; + case eModifierType_WeightVGMix: + return &RNA_VertexWeightMixModifier; + case eModifierType_WeightVGProximity: + return &RNA_VertexWeightProximityModifier; default: return &RNA_Modifier; } @@ -379,6 +389,46 @@ static void rna_SolidifyModifier_vgroup_set(PointerRNA *ptr, const char *value) rna_object_vgroup_name_set(ptr, value, smd->defgrp_name, sizeof(smd->defgrp_name)); } +static void rna_WeightVGModifier_vgroup_set(PointerRNA *ptr, const char *value) +{ + ModifierData *md = (ModifierData*)ptr->data; + if (md->type == eModifierType_WeightVGEdit) { + WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md; + rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name)); + } + else if (md->type == eModifierType_WeightVGMix) { + WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md; + rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_a, sizeof(wmd->defgrp_name_a)); + } + else if (md->type == eModifierType_WeightVGProximity) { + WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md; + rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name)); + } +} + +static void rna_WeightVGModifier_mask_vgroup_set(PointerRNA *ptr, const char *value) +{ + ModifierData *md = (ModifierData*)ptr->data; + if (md->type == eModifierType_WeightVGEdit) { + WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md; + rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name)); + } + else if (md->type == eModifierType_WeightVGMix) { + WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md; + rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name)); + } + else if (md->type == eModifierType_WeightVGProximity) { + WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md; + rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name)); + } +} + +static void rna_WeightVGMixModifier_vgroup2_set(PointerRNA *ptr, const char *value) +{ + WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)ptr->data; + rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_b, sizeof(wmd->defgrp_name_b)); +} + static void rna_MappingInfo_uvlayer_set(PointerRNA *ptr, const char *value) { MappingInfoModifierData *mmd= (MappingInfoModifierData *)ptr->data; @@ -403,6 +453,23 @@ static void rna_WaveModifier_uvlayer_set(PointerRNA *ptr, const char *value) rna_object_uvlayer_name_set(ptr, value, wmd->uvlayer_name, sizeof(wmd->uvlayer_name)); } +static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *value) +{ + ModifierData *md = (ModifierData*)ptr->data; + if (md->type == eModifierType_WeightVGEdit) { + WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md; + rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name)); + } + else if (md->type == eModifierType_WeightVGMix) { + WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md; + rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name)); + } + else if (md->type == eModifierType_WeightVGProximity) { + WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md; + rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name)); + } +} + static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max) { MultiresModifierData *mmd = (MultiresModifierData*)ptr->data; @@ -2423,6 +2490,7 @@ static void rna_def_modifier_screw(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Modifier_update");*/ } +<<<<<<< .working static void rna_def_modifier_navmesh(BlenderRNA *brna) { StructRNA *srna; @@ -2434,6 +2502,302 @@ static void rna_def_modifier_navmesh(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM); } +======= +static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) +{ + static EnumPropertyItem weightvg_mask_tex_map_items[] = { + {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", ""}, + {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""}, + {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""}, + {MOD_DISP_MAP_UV, "UV", 0, "UV", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem weightvg_mask_tex_used_items[] = { + {MOD_WVG_MASK_TEX_USE_INT, "INT", 0, "Intensity", ""}, + {MOD_WVG_MASK_TEX_USE_RED, "RED", 0, "Red", ""}, + {MOD_WVG_MASK_TEX_USE_GREEN, "GREEN", 0, "Green", ""}, + {MOD_WVG_MASK_TEX_USE_BLUE, "BLUE", 0, "Blue", ""}, + {MOD_WVG_MASK_TEX_USE_HUE, "HUE", 0, "Hue", ""}, + {MOD_WVG_MASK_TEX_USE_SAT, "SAT", 0, "Saturation", ""}, + {MOD_WVG_MASK_TEX_USE_VAL, "VAL", 0, "Value", ""}, + {MOD_WVG_MASK_TEX_USE_ALPHA, "ALPHA", 0, "Alpha", ""}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + prop= RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); + RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "mask_defgrp_name"); + RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_vgroup_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE); + RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items); + RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items); + RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates " + "to use for mapping."); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "mask_tex_uvlayer_name"); + RNA_def_property_ui_text(prop, "UV Layer", "UV layer name"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_uvlayer_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj"); + RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture " + "coordinates from."); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); +} + +static void rna_def_modifier_weightvgedit(BlenderRNA *brna) +{ + static EnumPropertyItem weightvg_edit_falloff_type_items[] = { + {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", ""}, + {MOD_WVG_MAPPING_CURVE, "CURVE", ICON_RNDCURVE, "Custom Curve", ""}, + {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, + {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, + {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, + {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""}, + {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, + {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE, "Median Step", ""}, /* Would need a better icon... */ + {0, NULL, 0, NULL, NULL}}; + + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "WeightVG Edit Modifier", + "Edit the weights of vertices in a group."); + RNA_def_struct_sdna(srna, "WeightVGEditModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); + + 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."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items); + RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG); + RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold " + "to vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG); + RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold " + "from vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, 1.0f); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); + RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if " + "it is not in the vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve"); + RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "add_threshold"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); + RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex's weight " + "to be added to the vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "rem_threshold"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); + RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex's weight " + "to be removed from the vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + /* Common masking properties. */ + rna_def_modifier_weightvg_mask(brna, srna); +} + +static void rna_def_modifier_weightvgmix(BlenderRNA *brna) +{ + static EnumPropertyItem weightvg_mix_modes_items[] = { + {MOD_WVG_MIX_SET, "SET", 0, "Replace weights", ""}, + {MOD_WVG_MIX_ADD, "ADD", 0, "Add to weights", ""}, + {MOD_WVG_MIX_SUB, "SUB", 0, "Subtract from weights", ""}, + {MOD_WVG_MIX_MUL, "MUL", 0, "Multiply weights", ""}, + {MOD_WVG_MIX_DIV, "DIV", 0, "Divide weights", ""}, + {MOD_WVG_MIX_DIF, "DIF", 0, "Difference", ""}, + {MOD_WVG_MIX_AVG, "AVG", 0, "Average", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem weightvg_mix_set_items[] = { + {MOD_WVG_SET_ALL, "ALL", 0, "All vertices", ""}, + {MOD_WVG_SET_A, "A", 0, "Vertices from group A", ""}, + {MOD_WVG_SET_B, "B", 0, "Vertices from group B", ""}, + {MOD_WVG_SET_OR, "OR", 0, "Vertices from one group", ""}, + {MOD_WVG_SET_AND, "AND", 0, "Vertices from both groups", ""}, + {0, NULL, 0, NULL, NULL}}; + + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier", + "Mix the weights of two vertex groups."); + RNA_def_struct_sdna(srna, "WeightVGMixModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); + + prop= RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a"); + RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "defgrp_name_b"); + RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGMixModifier_vgroup2_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "default_weight_a", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, 1.0f); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); + RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if " + "it is not in the first vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, 1.0f); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); + RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if " + "it is not in the second vgroup."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_mix_modes_items); + RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup 2 affect weights " + "of vgroup 1."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_mix_set_items); + RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + /* Common masking properties. */ + rna_def_modifier_weightvg_mask(brna, srna); +} + +static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) +{ + static EnumPropertyItem weightvg_proximity_modes_items[] = { + {MOD_WVG_PROXIMITY_OBJECT, "OBJECT", 0, "Object Distance", + "Use distance between affected and target objects."}, + {MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance", + "Use distance between affected object's vertices and target object, or target object's geometry."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem proximity_geometry_items[] = { + {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex."}, + {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge."}, + {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem weightvg_proximity_falloff_type_items[] = { + {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", ""}, + /* No curve mapping here! */ + {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, + {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, + {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, + {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""}, + {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, + {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE, "Median Step", ""}, /* Would need a better icon... */ + {0, NULL, 0, NULL, NULL}}; + + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier", + "Set the weights of vertices in a group from a target object's " + "distance."); + RNA_def_struct_sdna(srna, "WeightVGProximityModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); + + 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."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_proximity_modes_items); + RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "proximity_flags"); + RNA_def_property_enum_items(prop, proximity_geometry_items); + RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */ + RNA_def_property_ui_text(prop, "Proximity Geometry", + "Use the shortest computed distance to target object's geometry " + "as weight."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target"); + RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from."); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0); + RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0 (or weight 1.0 if above Highest Dist)."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0); + RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0 (or weight 0.0 if below Lowest Dist)."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items); + RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + /* Common masking properties. */ + rna_def_modifier_weightvg_mask(brna, srna); +} + +>>>>>>> .merge-right.r40061 void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; @@ -2531,7 +2895,13 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_smoke(brna); rna_def_modifier_solidify(brna); rna_def_modifier_screw(brna); +<<<<<<< .working rna_def_modifier_navmesh(brna); +======= + rna_def_modifier_weightvgedit(brna); + rna_def_modifier_weightvgmix(brna); + rna_def_modifier_weightvgproximity(brna); +>>>>>>> .merge-right.r40061 } #endif |