From 72279e1c9247c8779f75f495ed7fa99908209411 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Nov 2010 03:45:35 +0000 Subject: fix for RNA ranges exceeding the range of the type (INT_MAX used on short's for eg). --- source/blender/makesrna/intern/rna_curve.c | 8 ++++---- source/blender/makesrna/intern/rna_image.c | 2 +- source/blender/makesrna/intern/rna_particle.c | 6 +++--- source/blender/makesrna/intern/rna_scene.c | 2 +- source/blender/makesrna/intern/rna_sculpt_paint.c | 4 ++-- source/blender/makesrna/intern/rna_world.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index ea08930e849..ef7910745a7 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1249,7 +1249,7 @@ static void rna_def_curve(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolu"); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 64, 1, 0); RNA_def_property_ui_text(prop, "Resolution U", "Surface resolution in U direction"); RNA_def_property_update(prop, 0, "rna_Curve_resolution_u_update_data"); @@ -1257,20 +1257,20 @@ static void rna_def_curve(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolv"); RNA_def_property_ui_range(prop, 1, 64, 1, 0); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_text(prop, "Resolution V", "Surface resolution in V direction"); RNA_def_property_update(prop, 0, "rna_Curve_resolution_v_update_data"); prop= RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolu_ren"); - RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_range(prop, 0, 64, 1, 0); RNA_def_property_ui_text(prop, "Render Resolution U", "Surface resolution in U direction used while rendering. Zero skips this property"); prop= RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolv_ren"); RNA_def_property_ui_range(prop, 0, 64, 1, 0); - RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering. Zero skips this property"); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 62e7b516e9e..3874103ef7a 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -280,7 +280,7 @@ static void rna_def_imageuser(BlenderRNA *brna) prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fie_ima"); - RNA_def_property_range(prop, 1, MAXFRAMEF); + RNA_def_property_range(prop, 1, 200); RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image)"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 5481f60e81c..b9703392c10 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -942,7 +942,7 @@ static void rna_def_particle_dupliweight(BlenderRNA *brna) RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED); - RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text(prop, "Count", "The number of times this object is repeated with respect to other objects"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); } @@ -1426,7 +1426,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) //TODO: not found in UI, readonly? prop= RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, INT_MAX);//TODO:min,max + RNA_def_property_range(prop, 0, SHRT_MAX);//TODO:min,max RNA_def_property_ui_text(prop, "Keys Step", ""); /* adaptive path rendering */ @@ -2142,7 +2142,7 @@ static void rna_def_particle_system(BlenderRNA *brna) prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "target_psys"); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0cb4a251d0c..0d2421e276c 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1213,7 +1213,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number"); - RNA_def_property_range(prop, 1, 10000); + RNA_def_property_range(prop, 1, 255); RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 8f83e0b39a4..0b4d87ed642 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -420,7 +420,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "totaddkey"); - RNA_def_property_range(prop, 2, INT_MAX); + RNA_def_property_range(prop, 2, SHRT_MAX); RNA_def_property_ui_range(prop, 2, 20, 10, 3); RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with"); @@ -482,7 +482,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "steps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "step"); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 50, 10, 3); RNA_def_property_ui_text(prop, "Steps", "Brush steps"); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 969536972f7..9e74d751f69 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -285,7 +285,7 @@ static void rna_def_lighting(BlenderRNA *brna) prop= RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "ao_indirect_bounces"); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_text(prop, "Bounces", "Number of indirect diffuse light bounces to use for approximate ambient occlusion"); RNA_def_property_update(prop, 0, "rna_World_update"); -- cgit v1.2.3