diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-30 20:09:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-30 20:09:05 +0400 |
commit | f469e0652aa3152752845834477f2939c40f908d (patch) | |
tree | a0c291dd1b3a6a08e76f8ed00850b3727a9de8e5 /source/blender | |
parent | 953af01d2ae4cc18789616edcb75454851ef4202 (diff) |
Node socket values now only have soft limits, rather than hard limits, so you
can type in any value, and only when sliding the number value there is a limit.
It was already possible to assign any value to a socket with node linking, so
this shouldn't cause any new issues.
Also raised the limits on the math nodes, with a patch by Agustin Benavidez.
Diffstat (limited to 'source/blender')
26 files changed, 98 insertions, 83 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 987d7c1ade2..6f73fc65151 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -687,15 +687,15 @@ static void rna_clamp_value_range(FILE *f, PropertyRNA *prop) if (prop->type == PROP_FLOAT) { FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; if (fprop->range) { - fprintf(f, " float prop_clamp_min, prop_clamp_max;\n"); - fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(fprop->range)); + fprintf(f, " float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, prop_soft_max;\n"); + fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n", rna_function_string(fprop->range)); } } else if (prop->type == PROP_INT) { IntPropertyRNA *iprop = (IntPropertyRNA*)prop; if (iprop->range) { - fprintf(f, " int prop_clamp_min, prop_clamp_max;\n"); - fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(iprop->range)); + fprintf(f, " int prop_clamp_min = INT_MIN, prop_clamp_max = INT_MAX, prop_soft_min, prop_soft_max;\n"); + fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n", rna_function_string(iprop->range)); } } } diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d2537f9fabd..d5363b33fe9 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -901,6 +901,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax) { IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop); + int softmin, softmax; if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ @@ -920,7 +921,10 @@ void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, in } if (iprop->range) { - iprop->range(ptr, hardmin, hardmax); + *hardmin = INT_MIN; + *hardmax = INT_MAX; + + iprop->range(ptr, hardmin, hardmax, &softmin, &softmax); } else { *hardmin = iprop->hardmin; @@ -953,14 +957,17 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, } } + *softmin = iprop->softmin; + *softmax = iprop->softmax; + if (iprop->range) { - iprop->range(ptr, &hardmin, &hardmax); - *softmin = MAX2(iprop->softmin, hardmin); - *softmax = MIN2(iprop->softmax, hardmax); - } - else { - *softmin = iprop->softmin; - *softmax = iprop->softmax; + hardmin = INT_MIN; + hardmax = INT_MAX; + + iprop->range(ptr, &hardmin, &hardmax, softmin, softmax); + + *softmin = MAX2(*softmin, hardmin); + *softmax = MIN2(*softmax, hardmax); } *step = iprop->step; @@ -969,6 +976,7 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax) { FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop); + float softmin, softmax; if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ @@ -988,7 +996,10 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin } if (fprop->range) { - fprop->range(ptr, hardmin, hardmax); + *hardmin = -FLT_MAX; + *hardmax = FLT_MAX; + + fprop->range(ptr, hardmin, hardmax, &softmin, &softmax); } else { *hardmin = fprop->hardmin; @@ -1025,14 +1036,17 @@ void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *soft } } + *softmin = fprop->softmin; + *softmax = fprop->softmax; + if (fprop->range) { - fprop->range(ptr, &hardmin, &hardmax); - *softmin = MAX2(fprop->softmin, hardmin); - *softmax = MIN2(fprop->softmax, hardmax); - } - else { - *softmin = fprop->softmin; - *softmax = fprop->softmax; + hardmin = -FLT_MAX; + hardmax = FLT_MAX; + + fprop->range(ptr, &hardmin, &hardmax, softmin, softmax); + + *softmin = MAX2(*softmin, hardmin); + *softmax = MIN2(*softmax, hardmax); } *step = fprop->step; diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index fe729f1c44b..1159a1ba20e 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -180,7 +180,7 @@ static void rna_Action_active_pose_marker_index_set(PointerRNA *ptr, int value) act->active_marker = value+1; } -static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { bAction *act = (bAction*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index fce618228b3..94ea79099c2 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -321,7 +321,7 @@ static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value) ks->active_path = value+1; } -static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { KeyingSet *ks = (KeyingSet *)ptr->data; diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 3767a019a62..1e77959a971 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -151,7 +151,7 @@ static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr) } return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, NULL); } -static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { BoidState *state = (BoidState*)ptr->data; *min = 0; @@ -217,7 +217,7 @@ static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr) } return rna_pointer_inherit_refine(ptr, &RNA_BoidState, NULL); } -static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { BoidSettings *boids = (BoidSettings*)ptr->data; *min = 0; diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 6ea59dc12e5..ed2283dedab 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -100,7 +100,7 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value curvemapping_set_black_white(cumap, NULL, NULL); } -static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max) +static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { CurveMapping *cumap = (CurveMapping*)ptr->data; @@ -108,7 +108,7 @@ static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float * *max = cumap->clipr.xmax; } -static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max) +static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { CurveMapping *cumap = (CurveMapping*)ptr->data; @@ -116,7 +116,7 @@ static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float * *max = cumap->clipr.ymax; } -static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max) +static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { CurveMapping *cumap = (CurveMapping*)ptr->data; @@ -124,7 +124,7 @@ static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float * *max = 100.0f; } -static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max) +static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { CurveMapping *cumap = (CurveMapping*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 511239f6697..6519b9ad5a0 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -307,7 +307,7 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), return space_object_items; } -static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max) +static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { bConstraint *con = (bConstraint*)ptr->data; bActionConstraint *acon = (bActionConstraint *)con->data; diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 94ef3018812..17023e391a2 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -248,7 +248,7 @@ static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values) copy_v3_v3(cu->size, values); } -static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Curve *cu = (Curve*)ptr->id.data; *min = 0; @@ -256,7 +256,7 @@ static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max) *max = MAX2(0, *max); } -static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Curve *cu = (Curve*)ptr->id.data; *min = 0; diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index 1e47965be15..b3e89a4e5f8 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -186,7 +186,7 @@ static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value return; } -static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max) +static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 2108daf23be..ac199e67a1b 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -453,7 +453,7 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value)) fm->flag |= FMODIFIER_FLAG_ACTIVE; } -static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; @@ -461,7 +461,7 @@ static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float * *max = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->efra : MAXFRAMEF; } -static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; @@ -469,7 +469,7 @@ static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *ma *max = MAXFRAMEF; } -static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; @@ -520,7 +520,7 @@ static void rna_FModifierGenerator_coefficients_set(PointerRNA *ptr, const float memcpy(gen->coefficients, values, gen->arraysize * sizeof(float)); } -static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; FMod_Limits *data = fcm->data; @@ -529,7 +529,7 @@ static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *m *max = (data->flag & FCM_LIMIT_XMAX)? data->rect.xmax : MAXFRAMEF; } -static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; FMod_Limits *data = fcm->data; @@ -538,7 +538,7 @@ static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *m *max = MAXFRAMEF; } -static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; FMod_Limits *data = fcm->data; @@ -547,7 +547,7 @@ static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *m *max = (data->flag & FCM_LIMIT_YMAX)? data->rect.ymax : FLT_MAX; } -static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; FMod_Limits *data = fcm->data; @@ -557,7 +557,7 @@ static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *m } -static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; FMod_Stepped *data = fcm->data; @@ -566,7 +566,7 @@ static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, *max = (data->flag & FCM_STEPPED_NO_AFTER)? data->end_frame : MAXFRAMEF; } -static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max) +static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { FModifier *fcm = (FModifier*)ptr->data; FMod_Stepped *data = fcm->data; diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 3fc6b0e4599..ccfb83b61e3 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -77,12 +77,12 @@ typedef int (*PropIntGetFunc)(struct PointerRNA *ptr); typedef void (*PropIntSetFunc)(struct PointerRNA *ptr, int value); typedef void (*PropIntArrayGetFunc)(struct PointerRNA *ptr, int *values); typedef void (*PropIntArraySetFunc)(struct PointerRNA *ptr, const int *values); -typedef void (*PropIntRangeFunc)(struct PointerRNA *ptr, int *min, int *max); +typedef void (*PropIntRangeFunc)(struct PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax); typedef float (*PropFloatGetFunc)(struct PointerRNA *ptr); typedef void (*PropFloatSetFunc)(struct PointerRNA *ptr, float value); typedef void (*PropFloatArrayGetFunc)(struct PointerRNA *ptr, float *values); typedef void (*PropFloatArraySetFunc)(struct PointerRNA *ptr, const float *values); -typedef void (*PropFloatRangeFunc)(struct PointerRNA *ptr, float *min, float *max); +typedef void (*PropFloatRangeFunc)(struct PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax); typedef void (*PropStringGetFunc)(struct PointerRNA *ptr, char *value); typedef int (*PropStringLengthFunc)(struct PointerRNA *ptr); typedef void (*PropStringSetFunc)(struct PointerRNA *ptr, const char *value); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index e4ee67c746d..304af04ec27 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -93,7 +93,7 @@ static void rna_ShapeKey_value_set(PointerRNA *ptr, float value) data->curval = value; } -static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max) +static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { KeyBlock *data = (KeyBlock*)ptr->data; @@ -104,7 +104,7 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max) /* epsilon for how close one end of shapekey range can get to the other */ #define SHAPEKEY_SLIDER_TOL 0.001f -static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max) +static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { KeyBlock *data = (KeyBlock*)ptr->data; @@ -115,14 +115,14 @@ static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *ma static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value) { KeyBlock *data = (KeyBlock*)ptr->data; - float min, max; + float min, max, softmin, softmax; - rna_ShapeKey_slider_min_range(ptr, &min, &max); + rna_ShapeKey_slider_min_range(ptr, &min, &max, &softmin, &softmax); CLAMP(value, min, max); data->slidermin = value; } -static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max) +static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { KeyBlock *data = (KeyBlock*)ptr->data; @@ -133,9 +133,9 @@ static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *ma static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value) { KeyBlock *data = (KeyBlock*)ptr->data; - float min, max; + float min, max, softmin, softmax; - rna_ShapeKey_slider_max_range(ptr, &min, &max); + rna_ShapeKey_slider_max_range(ptr, &min, &max, &softmin, &softmax); CLAMP(value, min, max); data->slidermax = value; } diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index a765cbb6690..7802241a25b 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -195,7 +195,7 @@ static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA va nodeSetActiveID(ma->nodetree, ID_MA, &ma_act->id); } -static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max) +static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { Material *ma = (Material*)ptr->id.data; @@ -209,7 +209,7 @@ static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, flo } } -static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float *max) +static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { Material *ma = (Material*)ptr->id.data; diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 5a724526960..2421cebeaf3 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -937,7 +937,7 @@ static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values) } } -static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Mesh *me = rna_mesh(ptr); *min = 0; diff --git a/source/blender/makesrna/intern/rna_mesh_utils.h b/source/blender/makesrna/intern/rna_mesh_utils.h index f262e717eef..932a69680af 100644 --- a/source/blender/makesrna/intern/rna_mesh_utils.h +++ b/source/blender/makesrna/intern/rna_mesh_utils.h @@ -64,7 +64,8 @@ return data ? CustomData_number_of_layers(data, layer_type) : 0; \ } \ /* index range */ \ - static void rna_Mesh_##collection_name##_index_range(PointerRNA *ptr, int *min, int *max) \ + static void rna_Mesh_##collection_name##_index_range(PointerRNA *ptr, int *min, int *max, \ + int *softmin, int *softmax) \ { \ CustomData *data = rna_mesh_##customdata_type(ptr); \ *min = 0; \ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index f170d7df6f0..8b2bf6197dd 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -470,7 +470,7 @@ static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *v } } -static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max) +static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { MultiresModifierData *mmd = (MultiresModifierData*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 9b00e0e4fc3..b14f2b7fb90 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -436,28 +436,28 @@ static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr) } #endif -static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max) +static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { bNodeSocket *sock = (bNodeSocket*)ptr->data; bNodeSocketValueInt *val = (bNodeSocketValueInt*)sock->default_value; - *min = val->min; - *max = val->max; + *softmin = val->min; + *softmax = val->max; } -static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max) +static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { bNodeSocket *sock = (bNodeSocket*)ptr->data; bNodeSocketValueFloat *val = (bNodeSocketValueFloat*)sock->default_value; - *min = val->min; - *max = val->max; + *softmin = val->min; + *softmax = val->max; } -static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max) +static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { bNodeSocket *sock = (bNodeSocket*)ptr->data; bNodeSocketValueVector *val = (bNodeSocketValueVector*)sock->default_value; - *min = val->min; - *max = val->max; + *softmin = val->min; + *softmax = val->max; } static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 71a826f1351..d06dfdb8e7f 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -506,7 +506,7 @@ static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value) ob->actdef = value+1; } -static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = (Object*)ptr->id.data; @@ -618,7 +618,7 @@ static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) } } -static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = (Object*)ptr->id.data; *min = 0; @@ -643,7 +643,7 @@ static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value) assign_material(ob, value.data, ob->actcol); } -static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = (Object*)ptr->id.data; *min = 0; @@ -1066,7 +1066,7 @@ static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values) } } -static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = (Object*)ptr->id.data; Key *key = ob_get_key(ob); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index be28300eb01..7a4361d1504 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -225,7 +225,7 @@ static void rna_Cache_list_begin(CollectionPropertyIterator *iter, PointerRNA *p rna_iterator_listbase_begin(iter, &lb, NULL); } -static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = ptr->id.data; PointCache *cache = ptr->data; @@ -289,7 +289,7 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v BLI_freelistN(&pidlist); } -static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max) +static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = ptr->id.data; PointCache *cache = ptr->data; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 81d0e01d6a2..18bbf2bca12 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -470,7 +470,7 @@ static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr) ParticleSettings *settings = (ParticleSettings*)ptr->data; return settings->draw_line[0]; } -static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max) +static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -526,7 +526,7 @@ static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr) } return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL); } -static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { ParticleSystem *psys = (ParticleSystem*)ptr->data; *min = 0; @@ -666,7 +666,7 @@ static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr) } return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL); } -static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { ParticleSettings *part = (ParticleSettings*)ptr->id.data; *min = 0; diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 4b1090c2ae0..b6153162fc7 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -365,7 +365,7 @@ static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value) pchan->agrp_index = value+1; } -static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { Object *ob = (Object*)ptr->id.data; bPose *pose = (ob) ? ob->pose : NULL; @@ -404,7 +404,7 @@ static void rna_Pose_active_bone_group_index_set(PointerRNA *ptr, int value) pose->active_group = value+1; } -static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { bPose *pose = (bPose*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 67710817de3..94bcda6a1e1 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -962,7 +962,7 @@ static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value rd->actlay = value; } -static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { RenderData *rd = (RenderData*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 50336d525e6..42e83e662d1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -776,7 +776,7 @@ static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value) ci->cursor = len; } -static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { ConsoleLine *ci = (ConsoleLine*)ptr->data; diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 70af5599a15..5fe13336e83 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -128,7 +128,7 @@ static void rna_tracking_active_object_index_set(PointerRNA *ptr, int value) clip->tracking.objectnr = value; } -static void rna_tracking_active_object_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_tracking_active_object_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { MovieClip *clip = (MovieClip*)ptr->id.data; @@ -302,7 +302,7 @@ static void rna_tracking_stabTracks_active_index_set(PointerRNA *ptr, int value) clip->tracking.stabilization.act_track = value; } -static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max) +static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { MovieClip *clip = (MovieClip*)ptr->id.data; diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index 045fef1b010..44df496f5d6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -35,8 +35,8 @@ /* **************** SCALAR MATH ******************** */ static bNodeSocketTemplate sh_node_math_in[]= { - { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, - { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, + { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, + { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c index 9b57780cd9d..a0fe67d591d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c @@ -36,8 +36,8 @@ /* **************** VECTOR MATH ******************** */ static bNodeSocketTemplate sh_node_vect_math_in[]= { - { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f, PROP_NONE}, - { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f, PROP_NONE}, + { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, + { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE}, { -1, 0, "" } }; |