diff options
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index c4f6707dad5..8e1cfafcc42 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -82,19 +82,46 @@ typedef enum PropertyType { /* also update rna_property_subtype_unit when you change this */ typedef enum PropertyUnit { PROP_UNIT_NONE = (0 << 16), - PROP_UNIT_LENGTH = (1 << 16), /* m */ - PROP_UNIT_AREA = (2 << 16), /* m^2 */ - PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ - PROP_UNIT_MASS = (4 << 16), /* kg */ - PROP_UNIT_ROTATION = (5 << 16), /* radians */ - PROP_UNIT_TIME = (6 << 16), /* frame */ - PROP_UNIT_VELOCITY = (7 << 16), /* m/s */ - PROP_UNIT_ACCELERATION = (8 << 16), /* m/(s^2) */ - PROP_UNIT_CAMERA = (9 << 16), /* mm */ - PROP_UNIT_POWER = (10 << 16), /* W */ - PROP_UNIT_TEMPERATURE = (11 << 16), /* C */ + PROP_UNIT_LENGTH = (1 << 16), /* m */ + PROP_UNIT_AREA = (2 << 16), /* m^2 */ + PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ + PROP_UNIT_MASS = (4 << 16), /* kg */ + PROP_UNIT_ROTATION = (5 << 16), /* radians */ + PROP_UNIT_TIME = (6 << 16), /* frame */ + PROP_UNIT_TIME_ABSOLUTE = (7 << 16), /* time in seconds (independent of scene) */ + PROP_UNIT_VELOCITY = (8 << 16), /* m/s */ + PROP_UNIT_ACCELERATION = (9 << 16), /* m/(s^2) */ + PROP_UNIT_CAMERA = (10 << 16), /* mm */ + PROP_UNIT_POWER = (11 << 16), /* W */ + PROP_UNIT_TEMPERATURE = (12 << 16), /* C */ } PropertyUnit; +/** + * Use values besides #PROP_SCALE_LINEAR + * so the movement of the mouse doesn't map linearly to the value of the slider. + * + * For some settings it's useful to space motion in a non-linear way, see T77868. + * + * NOTE: The scale types are available for all float sliders. + * For integer sliders they are only available if they use the visible value bar. + * Sliders with logarithmic scale and value bar must have a range > 0 + * while logarithmic sliders without the value bar can have a range of >= 0. + */ +typedef enum PropertyScaleType { + /** Linear scale (default). */ + PROP_SCALE_LINEAR = 0, + /** + * Logarithmic scale + * - Maximum range: `0 <= x < inf` + */ + PROP_SCALE_LOG = 1, + /** + * Cubic scale. + * - Maximum range: `-inf < x < inf` + */ + PROP_SCALE_CUBIC = 2, +} PropertyScaleType; + #define RNA_SUBTYPE_UNIT(subtype) ((subtype)&0x00FF0000) #define RNA_SUBTYPE_VALUE(subtype) ((subtype) & ~0x00FF0000) #define RNA_SUBTYPE_UNIT_VALUE(subtype) ((subtype) >> 16) @@ -131,6 +158,7 @@ typedef enum PropertySubType { PROP_FACTOR = 15, PROP_ANGLE = 16 | PROP_UNIT_ROTATION, PROP_TIME = 17 | PROP_UNIT_TIME, + PROP_TIME_ABSOLUTE = 17 | PROP_UNIT_TIME_ABSOLUTE, /** Distance in 3d space, don't use for pixel distance for eg. */ PROP_DISTANCE = 18 | PROP_UNIT_LENGTH, PROP_DISTANCE_CAMERA = 19 | PROP_UNIT_CAMERA, @@ -619,7 +647,7 @@ typedef enum StructFlag { /** Indicates that this struct is an ID struct, and to use reference-counting. */ STRUCT_ID = (1 << 0), STRUCT_ID_REFCOUNT = (1 << 1), - /** defaults on, clear for user preferences and similar */ + /** defaults on, indicates when changes in members of a StructRNA should trigger undo steps. */ STRUCT_UNDO = (1 << 2), /* internal flags */ @@ -636,6 +664,12 @@ typedef enum StructFlag { STRUCT_PUBLIC_NAMESPACE = (1 << 9), /** All subtypes are added too. */ STRUCT_PUBLIC_NAMESPACE_INHERIT = (1 << 10), + /** + * When the #PointerRNA.owner_id is NULL, this signifies the property should be accessed + * without any context (the key-map UI and import/export for example). + * So accessing the property should not read from the current context to derive values/limits. + */ + STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID = (1 << 11), } StructFlag; typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function); |