Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

Is it possible to allow a custom property value to go as high or low as needed?

In other words, is it possible to make a custom property without clamping it with a min and a max?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Blender does not accept infinity as min or max value for a custom property directly, only with a trick. Usualy you can get infinity (of a float) by typing float("inf") and negative infinity with float("-inf"). This works in skripts and the python console, but number-fields in Blender do not accept these values (although they can evaluate the expression, try float("2.3") for example).

What you can do instead is setting the min and max values to the smallest / largest possible number. I don't know a way to get these values in a number-field directly, but you can get them from the python console:

>>> import sys
>>> sys.float_info.max
1.7976931348623157e+308

Note that sys.float_info.min will NOT give you the smallest negative value, but the value closest to zero that a floating point number in python can represent. To get the smallest possible negative number just put a minus in front of the max value.
If you copy and paste this value into the number field, Blender will show inf as the value. This is how you get infinity.
enter image description here

If you click on the number field Blender will however still show a number with 308 digits, so I do not know how the numbers are handeled internally.

share|improve this answer
    
I'm guessing it's still limited at some point, but close enough to infinity for me :) –  gandalf3 Jun 6 at 19:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.