diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-10-22 20:43:23 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-10-22 20:43:23 +0400 |
commit | d4541fd891a246f851f647c3259fc26648fc926d (patch) | |
tree | 5397c3a85424b8c08854fa4f9711db4344a790b7 /source/blender/makesrna/intern/rna_object_force.c | |
parent | 30cba27987362054d16b10e73ddf2601af93be68 (diff) | |
parent | 952560dc028516d60a5318eadbcbd5f2c0668335 (diff) |
Merge with trunk r41197
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 72bc440f4ac..1a6fdb2da5c 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -53,7 +53,7 @@ static EnumPropertyItem effector_shape_items[] = { #ifdef RNA_RUNTIME -/* type spesific return values only used from functions */ +/* type specific return values only used from functions */ static EnumPropertyItem curve_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, @@ -98,8 +98,6 @@ static EnumPropertyItem empty_vortex_shape_items[] = { #include "BKE_pointcache.h" #include "BKE_depsgraph.h" -#include "BLI_blenlib.h" - #include "ED_object.h" static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -193,7 +191,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P pid2 = pid; else if(cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name)==0) { /*TODO: report "name exists" to user */ - strcpy(cache->name, cache->prev_name); + BLI_strncpy(cache->name, cache->prev_name, sizeof(cache->name)); new_name = 0; } } @@ -203,13 +201,13 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P char old_name[80]; char new_name[80]; - strcpy(old_name, cache->prev_name); - strcpy(new_name, cache->name); + BLI_strncpy(old_name, cache->prev_name, sizeof(old_name)); + BLI_strncpy(new_name, cache->name, sizeof(new_name)); BKE_ptcache_disk_cache_rename(pid2, old_name, new_name); } - strcpy(cache->prev_name, cache->name); + BLI_strncpy(cache->prev_name, cache->name, sizeof(cache->prev_name)); } } @@ -695,7 +693,8 @@ static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point } -static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) +static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr, + PropertyRNA *UNUSED(prop), int *UNUSED(free)) { Object *ob= NULL; @@ -741,7 +740,8 @@ static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches"); prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range"); + RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", + "rna_Cache_active_point_cache_index_range"); RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); } @@ -843,7 +843,8 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", + "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list"); rna_def_ptcache_point_caches(brna, prop); @@ -930,7 +931,8 @@ static void rna_def_collision(BlenderRNA *brna) prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2); - RNA_def_property_ui_text(prop, "Absorption", "How much of effector force gets lost during collision with this object (in percent)"); + RNA_def_property_ui_text(prop, "Absorption", + "How much of effector force gets lost during collision with this object (in percent)"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); } @@ -1144,7 +1146,9 @@ static void rna_def_field(BlenderRNA *brna) prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tex_mode"); RNA_def_property_enum_items(prop, texture_items); - RNA_def_property_ui_text(prop, "Texture Mode", "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)"); + RNA_def_property_ui_text(prop, "Texture Mode", + "How the texture effect is calculated (RGB & Curl need a RGB texture, " + "else Gradient will be used instead)"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE); @@ -1439,7 +1443,10 @@ static void rna_def_game_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "welding"); RNA_def_property_range(prop, 0.0f, 0.01f); - RNA_def_property_ui_text(prop, "Welding", "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)"); + RNA_def_property_ui_text(prop, "Welding", + "Welding threshold: distance between nearby vertices to be considered equal " + "=> set to 0.0 to disable welding test and speed up scene loading " + "(ok if the mesh has no duplicates)"); /* Integers */ @@ -1451,7 +1458,7 @@ static void rna_def_game_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "numclusteriterations"); RNA_def_property_range(prop, 1, 128); - RNA_def_property_ui_text(prop, "Cluster Iterations", "Specify the number of cluster iterations"); + RNA_def_property_ui_text(prop, "Cluster Iterations", "Number of cluster iterations"); /* Booleans */ @@ -1535,7 +1542,8 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "vertex_group_goal", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vertgroup"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not impossible .. but not supported yet */ - RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length", "rna_SoftBodySettings_goal_vgroup_set"); + RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length", + "rna_SoftBodySettings_goal_vgroup_set"); RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values"); prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); @@ -1657,7 +1665,8 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rklimit"); RNA_def_property_range(prop, 0.001f, 10.0f); - RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); + RNA_def_property_ui_text(prop, "Error Limit", + "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE); @@ -1681,7 +1690,8 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fuzzyness"); RNA_def_property_range(prop, 1, 100); - RNA_def_property_ui_text(prop, "Fuzzy", "Fuzziness while on collision, high values make collision handling faster but less stable"); + RNA_def_property_ui_text(prop, "Fuzzy", + "Fuzziness while on collision, high values make collision handling faster but less stable"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE); |