Blender V5.0
RNA_types.hh File Reference
#include <optional>
#include <string>
#include "../blenlib/BLI_function_ref.hh"
#include "../blenlib/BLI_sys_types.h"
#include "../blenlib/BLI_utildefines.h"
#include "../blenlib/BLI_vector.hh"

Go to the source code of this file.

Classes

struct  AncestorPointerRNA
struct  PointerRNA
struct  PropertyPointerRNA
struct  PathResolvedRNA
struct  ListBaseIterator
struct  ArrayIterator
struct  CountIterator
struct  CollectionPropertyIterator
struct  CollectionVector
struct  RawArray
struct  EnumPropertyItem
struct  StringPropertySearchVisitParams
struct  ParameterList
struct  ParameterIterator
struct  ParameterDynAlloc
struct  ExtensionRNA
struct  DeprecatedRNA
struct  PrimitiveStringRNA
struct  PrimitiveIntRNA
struct  PrimitiveFloatRNA
struct  PrimitiveBooleanRNA

Macros

#define RNA_SUBTYPE_UNIT(subtype)
#define RNA_SUBTYPE_VALUE(subtype)
#define RNA_SUBTYPE_UNIT_VALUE(subtype)
#define RNA_ENUM_BITFLAG_SIZE   32
#define RNA_TRANSLATION_PREC_DEFAULT   5
#define RNA_STACK_ARRAY   32
#define RNA_ENUM_ITEM_HEADING(name, description)
#define RNA_ENUM_ITEM_SEPR   {0, "", 0, NULL, NULL}
#define RNA_ENUM_ITEM_SEPR_COLUMN   RNA_ENUM_ITEM_HEADING("", NULL)

Typedefs

using IteratorSkipFunc = bool (*)(CollectionPropertyIterator *iter, void *data)
using BooleanPropertyGetFunc = bool (*)(PointerRNA *ptr, PropertyRNA *prop)
using BooleanPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool value)
using BooleanPropertyGetTransformFunc
using BooleanPropertySetTransformFunc
using BooleanArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool *r_values)
using BooleanArrayPropertySetFunc
using BooleanArrayPropertyGetTransformFunc
using BooleanArrayPropertySetTransformFunc
using IntPropertyGetFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop)
using IntPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value)
using IntPropertyGetTransformFunc
using IntPropertySetTransformFunc
using IntArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int *values)
using IntArrayPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, const int *values)
using IntArrayPropertyGetTransformFunc
using IntArrayPropertySetTransformFunc
using IntPropertyRangeFunc
using FloatPropertyGetFunc = float (*)(PointerRNA *ptr, PropertyRNA *prop)
using FloatPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, float value)
using FloatPropertyGetTransformFunc
using FloatPropertySetTransformFunc
using FloatArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, float *values)
using FloatArrayPropertySetFunc
using FloatArrayPropertyGetTransformFunc
using FloatArrayPropertySetTransformFunc
using FloatPropertyRangeFunc
using StringPropertyGetFunc = std::string (*)(PointerRNA *ptr, PropertyRNA *prop)
using StringPropertyLengthFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop)
using StringPropertySetFunc
using StringPropertyGetTransformFunc
using StringPropertySetTransformFunc
using StringPropertySearchFunc
using StringPropertyPathFilterFunc
using EnumPropertyGetFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop)
using EnumPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value)
using EnumPropertyGetTransformFunc
using EnumPropertySetTransformFunc
using EnumPropertyItemFunc
using CallFunc = void (*)(bContext *C, ReportList *reports, PointerRNA *ptr, ParameterList *parms)
using StructValidateFunc = int (*)(PointerRNA *ptr, void *data, bool *have_function)
using StructCallbackFunc
using StructFreeFunc = void (*)(void *data)
using StructRegisterFunc
using StructUnregisterFunc = bool (*)(Main *bmain, StructRNA *type)
using StructInstanceFunc = void **(*)(PointerRNA * ptr)

Enumerations

enum  PropertyType {
  PROP_BOOLEAN = 0 , PROP_INT = 1 , PROP_FLOAT = 2 , PROP_STRING = 3 ,
  PROP_ENUM = 4 , PROP_POINTER = 5 , PROP_COLLECTION = 6
}
enum  PropertyUnit {
  PROP_UNIT_NONE = (0 << 16) , PROP_UNIT_LENGTH = (1 << 16) , PROP_UNIT_AREA = (2 << 16) , PROP_UNIT_VOLUME = (3 << 16) ,
  PROP_UNIT_MASS = (4 << 16) , PROP_UNIT_ROTATION = (5 << 16) , PROP_UNIT_TIME = (6 << 16) , PROP_UNIT_TIME_ABSOLUTE = (7 << 16) ,
  PROP_UNIT_VELOCITY = (8 << 16) , PROP_UNIT_ACCELERATION = (9 << 16) , PROP_UNIT_CAMERA = (10 << 16) , PROP_UNIT_POWER = (11 << 16) ,
  PROP_UNIT_TEMPERATURE = (12 << 16) , PROP_UNIT_WAVELENGTH = (13 << 16) , PROP_UNIT_COLOR_TEMPERATURE = (14 << 16) , PROP_UNIT_FREQUENCY = (15 << 16)
}
enum  PropertyScaleType { PROP_SCALE_LINEAR = 0 , PROP_SCALE_LOG = 1 , PROP_SCALE_CUBIC = 2 }
enum  PropertySubType {
  PROP_NONE = 0 , PROP_FILEPATH = 1 , PROP_DIRPATH = 2 , PROP_FILENAME = 3 ,
  PROP_BYTESTRING = 4 , PROP_PASSWORD = 6 , PROP_PIXEL = 12 , PROP_UNSIGNED = 13 ,
  PROP_PERCENTAGE = 14 , PROP_FACTOR = 15 , PROP_ANGLE = 16 | PROP_UNIT_ROTATION , PROP_TIME = 17 | PROP_UNIT_TIME ,
  PROP_TIME_ABSOLUTE = 17 | PROP_UNIT_TIME_ABSOLUTE , PROP_DISTANCE = 18 | PROP_UNIT_LENGTH , PROP_DISTANCE_CAMERA = 19 | PROP_UNIT_CAMERA , PROP_COLOR = 20 ,
  PROP_TRANSLATION = 21 | PROP_UNIT_LENGTH , PROP_DIRECTION = 22 , PROP_VELOCITY = 23 | PROP_UNIT_VELOCITY , PROP_ACCELERATION = 24 | PROP_UNIT_ACCELERATION ,
  PROP_MATRIX = 25 , PROP_EULER = 26 | PROP_UNIT_ROTATION , PROP_QUATERNION = 27 , PROP_AXISANGLE = 28 ,
  PROP_XYZ = 29 , PROP_XYZ_LENGTH = 29 | PROP_UNIT_LENGTH , PROP_COLOR_GAMMA = 30 , PROP_COORDS = 31 ,
  PROP_LAYER = 40 , PROP_LAYER_MEMBER = 41 , PROP_POWER = 42 | PROP_UNIT_POWER , PROP_TEMPERATURE = 43 | PROP_UNIT_TEMPERATURE ,
  PROP_WAVELENGTH = 44 | PROP_UNIT_WAVELENGTH , PROP_COLOR_TEMPERATURE = 45 | PROP_UNIT_COLOR_TEMPERATURE , PROP_FREQUENCY = 46 | PROP_UNIT_FREQUENCY , PROP_PIXEL_DIAMETER = 47 ,
  PROP_DISTANCE_DIAMETER = 48 | PROP_UNIT_LENGTH
}
enum  PropertyFlag {
  PROP_EDITABLE = (1 << 0) , PROP_LIB_EXCEPTION = (1 << 16) , PROP_ANIMATABLE = (1 << 1) , PROP_TEXTEDIT_UPDATE = (1u << 31) ,
  PROP_ICONS_CONSECUTIVE = (1 << 12) , PROP_ICONS_REVERSE = (1 << 8) , PROP_HIDDEN = (1 << 19) , PROP_SKIP_SAVE = (1 << 28) ,
  PROP_PROPORTIONAL = (1 << 26) , PROP_ID_REFCOUNT = (1 << 6) , PROP_ID_SELF_CHECK = (1 << 20) , PROP_NEVER_NULL = (1 << 18) ,
  PROP_NEVER_UNLINK = (1 << 25) , PROP_PTR_NO_OWNERSHIP = (1 << 7) , PROP_ENUM_FLAG = (1 << 21) , PROP_CONTEXT_UPDATE = (1 << 22) ,
  PROP_CONTEXT_PROPERTY_UPDATE = PROP_CONTEXT_UPDATE | (1 << 27) , PROP_REGISTER = (1 << 4) , PROP_REGISTER_OPTIONAL = PROP_REGISTER | (1 << 5) , PROP_THICK_WRAP = (1 << 23) ,
  PROP_IDPROPERTY = (1 << 10) , PROP_DYNAMIC = (1 << 17) , PROP_ENUM_NO_CONTEXT = (1 << 24) , PROP_ENUM_NO_TRANSLATE = (1 << 29) ,
  PROP_NO_DEG_UPDATE = (1 << 30) , PROP_DEG_SYNC_ONLY = (1 << 9) , PROP_PATH_OUTPUT = (1 << 2) , PROP_PATH_SUPPORTS_BLEND_RELATIVE = (1 << 15) ,
  PROP_PATH_SUPPORTS_TEMPLATES = (1 << 14) , PROP_SKIP_PRESET = (1 << 11)
}
enum  PropertyPathTemplateType { PROP_VARIABLES_NONE = 0 , PROP_VARIABLES_RENDER_OUTPUT }
enum  PropertyOverrideFlag {
  PROPOVERRIDE_OVERRIDABLE_LIBRARY = (1 << 0) , PROPOVERRIDE_NO_COMPARISON = (1 << 1) , PROPOVERRIDE_IGNORE = (1 << 2) , PROPOVERRIDE_LIBRARY_INSERTION = (1 << 10) ,
  PROPOVERRIDE_NO_PROP_NAME = (1 << 11)
}
enum  ParameterFlag { PARM_REQUIRED = (1 << 0) , PARM_OUTPUT = (1 << 1) , PARM_RNAPTR = (1 << 2) , PARM_PYFUNC_REGISTER_OPTIONAL = (1 << 3) }
enum  RawPropertyType {
  PROP_RAW_UNSET = -1 , PROP_RAW_INT , PROP_RAW_SHORT , PROP_RAW_CHAR ,
  PROP_RAW_BOOLEAN , PROP_RAW_DOUBLE , PROP_RAW_FLOAT , PROP_RAW_UINT8 ,
  PROP_RAW_UINT16 , PROP_RAW_INT64 , PROP_RAW_UINT64 , PROP_RAW_INT8
}
enum  eStringPropertySearchFlag { PROP_STRING_SEARCH_SUPPORTED = (1 << 0) , PROP_STRING_SEARCH_SORT = (1 << 1) , PROP_STRING_SEARCH_SUGGESTION = (1 << 2) }
enum  FunctionFlag {
  FUNC_USE_SELF_ID = (1 << 11) , FUNC_SELF_AS_RNA = (1 << 13) , FUNC_NO_SELF = (1 << 0) , FUNC_USE_SELF_TYPE = (1 << 1) ,
  FUNC_USE_MAIN = (1 << 2) , FUNC_USE_CONTEXT = (1 << 3) , FUNC_USE_REPORTS = (1 << 4) , FUNC_REGISTER = (1 << 5) ,
  FUNC_REGISTER_OPTIONAL = FUNC_REGISTER | (1 << 6) , FUNC_ALLOW_WRITE = (1 << 12) , FUNC_BUILTIN = (1 << 7) , FUNC_EXPORT = (1 << 8) ,
  FUNC_RUNTIME = (1 << 9) , FUNC_FREE_POINTERS = (1 << 10)
}
enum  StructFlag {
  STRUCT_ID = (1 << 0) , STRUCT_ID_REFCOUNT = (1 << 1) , STRUCT_UNDO = (1 << 2) , STRUCT_RUNTIME = (1 << 3) ,
  STRUCT_FREE_POINTERS = (1 << 5) , STRUCT_NO_IDPROPERTIES = (1 << 6) , STRUCT_NO_DATABLOCK_IDPROPERTIES = (1 << 7) , STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES = (1 << 8) ,
  STRUCT_PUBLIC_NAMESPACE = (1 << 9) , STRUCT_PUBLIC_NAMESPACE_INHERIT = (1 << 10) , STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID = (1 << 11)
}

Functions

 ENUM_OPERATORS (PropertyOverrideFlag, PROPOVERRIDE_NO_PROP_NAME)

Variables

constexpr int64_t ANCESTOR_POINTERRNA_DEFAULT_SIZE = 2
const PointerRNA PointerRNA_NULL

Macro Definition Documentation

◆ RNA_ENUM_BITFLAG_SIZE

#define RNA_ENUM_BITFLAG_SIZE   32

Definition at line 222 of file RNA_types.hh.

Referenced by enum_items_from_py(), pyrna_enum_bitfield_as_set(), and pyrna_enum_to_py().

◆ RNA_ENUM_ITEM_HEADING

#define RNA_ENUM_ITEM_HEADING ( name,
description )
Value:
{0, "", 0, name, description}
const char * name

Heading for RNA enum items (shown in the UI).

The description is currently only shown in the Python documentation. By convention the value should be a non-empty string or NULL when there is no description (never an empty string).

Definition at line 673 of file RNA_types.hh.

◆ RNA_ENUM_ITEM_SEPR

◆ RNA_ENUM_ITEM_SEPR_COLUMN

#define RNA_ENUM_ITEM_SEPR_COLUMN   RNA_ENUM_ITEM_HEADING("", NULL)

Separator for RNA enum that begins a new column in menus (shown in the UI).

Definition at line 679 of file RNA_types.hh.

◆ RNA_STACK_ARRAY

#define RNA_STACK_ARRAY   32

Definition at line 226 of file RNA_types.hh.

◆ RNA_SUBTYPE_UNIT

#define RNA_SUBTYPE_UNIT ( subtype)

◆ RNA_SUBTYPE_UNIT_VALUE

◆ RNA_SUBTYPE_VALUE

#define RNA_SUBTYPE_VALUE ( subtype)
Value:
((subtype) & ~0x00FF0000)

Definition at line 219 of file RNA_types.hh.

◆ RNA_TRANSLATION_PREC_DEFAULT

Typedef Documentation

◆ BooleanArrayPropertyGetFunc

using BooleanArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool *r_values)

Definition at line 697 of file RNA_types.hh.

◆ BooleanArrayPropertyGetTransformFunc

Initial value:
void (*)(
PointerRNA *ptr, PropertyRNA *prop, const bool *curr_values, bool is_set, bool *r_values)
PointerRNA * ptr
Definition wm_files.cc:4238

Definition at line 701 of file RNA_types.hh.

◆ BooleanArrayPropertySetFunc

Initial value:
void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const bool *r_values)

Definition at line 698 of file RNA_types.hh.

◆ BooleanArrayPropertySetTransformFunc

Initial value:
void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const bool *new_values,
const bool *curr_values,
bool is_set,
bool *r_values)

Definition at line 703 of file RNA_types.hh.

◆ BooleanPropertyGetFunc

using BooleanPropertyGetFunc = bool (*)(PointerRNA *ptr, PropertyRNA *prop)

Definition at line 688 of file RNA_types.hh.

◆ BooleanPropertyGetTransformFunc

Initial value:
bool (*)(PointerRNA *ptr,
PropertyRNA *prop,
bool value,
bool is_set)

Definition at line 690 of file RNA_types.hh.

◆ BooleanPropertySetFunc

using BooleanPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, bool value)

Definition at line 689 of file RNA_types.hh.

◆ BooleanPropertySetTransformFunc

Initial value:
bool (*)(PointerRNA *ptr, PropertyRNA *prop, bool new_value, bool curr_value, bool is_set)

Definition at line 694 of file RNA_types.hh.

◆ CallFunc

using CallFunc = void (*)(bContext *C, ReportList *reports, PointerRNA *ptr, ParameterList *parms)

Definition at line 945 of file RNA_types.hh.

◆ EnumPropertyGetFunc

using EnumPropertyGetFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop)

Definition at line 821 of file RNA_types.hh.

◆ EnumPropertyGetTransformFunc

Initial value:
int (*)(PointerRNA *ptr,
PropertyRNA *prop,
int value,
bool is_set)

Definition at line 823 of file RNA_types.hh.

◆ EnumPropertyItemFunc

Initial value:

Definition at line 830 of file RNA_types.hh.

◆ EnumPropertySetFunc

using EnumPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value)

Definition at line 822 of file RNA_types.hh.

◆ EnumPropertySetTransformFunc

Initial value:
int (*)(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set)

Definition at line 827 of file RNA_types.hh.

◆ FloatArrayPropertyGetFunc

using FloatArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, float *values)

Definition at line 739 of file RNA_types.hh.

◆ FloatArrayPropertyGetTransformFunc

Initial value:
void (*)(
PointerRNA *ptr, PropertyRNA *prop, const float *curr_values, bool is_set, float *r_values)

Definition at line 743 of file RNA_types.hh.

◆ FloatArrayPropertySetFunc

Initial value:
void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const float *values)

Definition at line 740 of file RNA_types.hh.

◆ FloatArrayPropertySetTransformFunc

Initial value:
void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const float *new_values,
const float *curr_values,
bool is_set,
float *r_values)

Definition at line 745 of file RNA_types.hh.

◆ FloatPropertyGetFunc

Definition at line 731 of file RNA_types.hh.

◆ FloatPropertyGetTransformFunc

Initial value:
PropertyRNA *prop,
float value,
bool is_set)
nullptr float

Definition at line 733 of file RNA_types.hh.

◆ FloatPropertyRangeFunc

Initial value:
void (*)(
PointerRNA *ptr, PropertyRNA *prop, float *min, float *max, float *softmin, float *softmax)
#define min(a, b)
Definition sort.cc:36
max
Definition text_draw.cc:251

Definition at line 751 of file RNA_types.hh.

◆ FloatPropertySetFunc

using FloatPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, float value)

Definition at line 732 of file RNA_types.hh.

◆ FloatPropertySetTransformFunc

Initial value:
float (*)(PointerRNA *ptr, PropertyRNA *prop, float new_value, float curr_value, bool is_set)

Definition at line 737 of file RNA_types.hh.

◆ IntArrayPropertyGetFunc

using IntArrayPropertyGetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int *values)

Definition at line 718 of file RNA_types.hh.

◆ IntArrayPropertyGetTransformFunc

Initial value:
void (*)(
PointerRNA *ptr, PropertyRNA *prop, const int *curr_values, bool is_set, int *r_values)

Definition at line 720 of file RNA_types.hh.

◆ IntArrayPropertySetFunc

using IntArrayPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, const int *values)

Definition at line 719 of file RNA_types.hh.

◆ IntArrayPropertySetTransformFunc

Initial value:
void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const int *new_values,
const int *curr_values,
bool is_set,
int *r_values)

Definition at line 722 of file RNA_types.hh.

◆ IntPropertyGetFunc

using IntPropertyGetFunc = int (*)(PointerRNA *ptr, PropertyRNA *prop)

Definition at line 710 of file RNA_types.hh.

◆ IntPropertyGetTransformFunc

Initial value:
int (*)(PointerRNA *ptr,
PropertyRNA *prop,
int value,
bool is_set)

Definition at line 712 of file RNA_types.hh.

◆ IntPropertyRangeFunc

Initial value:
void (*)(PointerRNA *ptr, PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax)

Definition at line 728 of file RNA_types.hh.

◆ IntPropertySetFunc

using IntPropertySetFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int value)

Definition at line 711 of file RNA_types.hh.

◆ IntPropertySetTransformFunc

Initial value:
int (*)(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set)

Definition at line 716 of file RNA_types.hh.

◆ IteratorSkipFunc

using IteratorSkipFunc = bool (*)(CollectionPropertyIterator *iter, void *data)

Definition at line 563 of file RNA_types.hh.

◆ StringPropertyGetFunc

using StringPropertyGetFunc = std::string (*)(PointerRNA *ptr, PropertyRNA *prop)

Definition at line 754 of file RNA_types.hh.

◆ StringPropertyGetTransformFunc

Initial value:
std::string (*)(PointerRNA *ptr,
PropertyRNA *prop,
const std::string &value,
bool is_set)

Definition at line 759 of file RNA_types.hh.

◆ StringPropertyLengthFunc

Definition at line 755 of file RNA_types.hh.

◆ StringPropertyPathFilterFunc

Initial value:
std::optional<std::string> (*)(const bContext *C,
PropertyRNA *prop)

Returns an optional glob pattern (e.g. *.png) that can be passed to the file browser to filter valid files for this property.

Definition at line 817 of file RNA_types.hh.

◆ StringPropertySearchFunc

Initial value:
Parameters
Ccontext, may be NULL (in this case all available items should be shown).
ptrRNA pointer.
propRNA property. This must have its StringPropertyRNA.search callback set, to check this use RNA_property_string_search_flag(prop) & PROP_STRING_SEARCH_SUPPORTED.
edit_textOptionally use the string being edited by the user as a basis for the search results (auto-complete Python attributes for example).
visit_fnThis function is called with every search candidate and is typically responsible for storing the search results.

Definition at line 806 of file RNA_types.hh.

◆ StringPropertySetFunc

Initial value:
void (*)(PointerRNA *ptr,
PropertyRNA *prop,
const std::string &value)

Definition at line 756 of file RNA_types.hh.

◆ StringPropertySetTransformFunc

Initial value:
std::string (*)(PointerRNA *ptr,
PropertyRNA *prop,
const std::string &new_value,
const std::string &curr_value,
bool is_set)

Definition at line 763 of file RNA_types.hh.

◆ StructCallbackFunc

Initial value:

Definition at line 986 of file RNA_types.hh.

◆ StructFreeFunc

using StructFreeFunc = void (*)(void *data)

Definition at line 990 of file RNA_types.hh.

◆ StructInstanceFunc

using StructInstanceFunc = void **(*)(PointerRNA * ptr)

Definition at line 1000 of file RNA_types.hh.

◆ StructRegisterFunc

Initial value:
StructRNA *(*)(Main * bmain,
ReportList *reports,
void *data,
const char *identifier,
void BLI_kdtree_nd_ free(KDTree *tree)
int(*)(PointerRNA *ptr, void *data, bool *have_function) StructValidateFunc
Definition RNA_types.hh:985
int(*)(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *list) StructCallbackFunc
Definition RNA_types.hh:986
void(*)(void *data) StructFreeFunc
Definition RNA_types.hh:990
BMesh const char void * data

Definition at line 991 of file RNA_types.hh.

◆ StructUnregisterFunc

using StructUnregisterFunc = bool (*)(Main *bmain, StructRNA *type)

Return true when type was successfully unregistered & freed.

Definition at line 999 of file RNA_types.hh.

◆ StructValidateFunc

using StructValidateFunc = int (*)(PointerRNA *ptr, void *data, bool *have_function)

Definition at line 985 of file RNA_types.hh.

Enumeration Type Documentation

◆ eStringPropertySearchFlag

Enumerator
PROP_STRING_SEARCH_SUPPORTED 

Used so the result of RNA_property_string_search_flag can be used to check if search is supported.

PROP_STRING_SEARCH_SORT 

Items resulting from the search must be sorted.

PROP_STRING_SEARCH_SUGGESTION 

Allow members besides the ones listed to be entered.

Warning
disabling this options causes the search callback to run on redraw and should only be enabled this doesn't cause performance issues.

Definition at line 778 of file RNA_types.hh.

◆ FunctionFlag

Options affecting callback signature.

Those add additional parameters at the beginning of the C callback, like that:

rna_my_func([ID *_selfid],
            [<DNA_STRUCT> *self|StructRNA *type],
            [Main *bmain],
            [bContext *C],
            [ReportList *reports],
            <other RNA-defined parameters>);
Enumerator
FUNC_USE_SELF_ID 

Pass ID owning 'self' data (i.e. ptr->owner_id, might be same as self in case data is an ID...).

FUNC_SELF_AS_RNA 

Pass 'self' data as a PointerRNA (by value), rather than as a pointer of the relevant DNA type.

Mutually exclusive with FUNC_NO_SELF and FUNC_USE_SELF_TYPE.

Useful for functions that need to access self as RNA data, not as DNA data (e.g. when doing 'generic', type-agnostic processing).

FUNC_NO_SELF 

Do not pass the object (DNA struct pointer) from which it is called, used to define static or class functions.

Mutually exclusive with FUNC_SELF_AS_RNA.

FUNC_USE_SELF_TYPE 

Pass RNA type, used to define class functions, only valid when FUNC_NO_SELF is set.

FUNC_USE_MAIN 
FUNC_USE_CONTEXT 
FUNC_USE_REPORTS 
FUNC_REGISTER 

This function is part of the registerable class' interface, and can be implemented/redefined in Python.

FUNC_REGISTER_OPTIONAL 

Subclasses can choose not to implement this function.

FUNC_ALLOW_WRITE 

If not set, the Python function implementing this call is not allowed to write into data-blocks. Except for WindowManager and Screen currently, see rna_id_write_error() in bpy_rna.cc.

FUNC_BUILTIN 

UNUSED CURRENTLY? ???

FUNC_EXPORT 

UNUSED CURRENTLY. ???

FUNC_RUNTIME 

Function has been defined at runtime, not statically in RNA source code.

FUNC_FREE_POINTERS 

UNUSED CURRENTLY? Function owns its identifier and description strings, and has to free them when deleted.

Definition at line 884 of file RNA_types.hh.

◆ ParameterFlag

Function parameters flags.

Warning
16bits only.
Enumerator
PARM_REQUIRED 
PARM_OUTPUT 
PARM_RNAPTR 
PARM_PYFUNC_REGISTER_OPTIONAL 

This allows for non-breaking API updates when adding non-critical new parameters to functions which Python classes register. This way, old Python code defining functions without that parameter would still work.

WARNING: any parameter after the first PARM_PYFUNC_REGISTER_OPTIONAL one will be considered as optional!

Note
only for input parameters!

Definition at line 544 of file RNA_types.hh.

◆ PropertyFlag

Enumerator
PROP_EDITABLE 

Editable means the property is editable in the user interface, properties are editable by default except for pointers and collections.

PROP_LIB_EXCEPTION 

This property is editable even if it is lib linked, meaning it will get lost on reload, but it's useful for editing.

PROP_ANIMATABLE 

Animatable means the property can be driven by some other input, be it animation curves, expressions, .. properties are animatable by default except for pointers and collections.

PROP_TEXTEDIT_UPDATE 

This flag means when the property's widget is in 'text-edit' mode, it will be updated after every typed char, instead of waiting final validation. Used e.g. for text search-box. It will also cause UI_BUT_VALUE_CLEAR to be set for text buttons. We could add a separate flag for search/filter properties, but this works just fine for now.

PROP_ICONS_CONSECUTIVE 
PROP_ICONS_REVERSE 
PROP_HIDDEN 

Hide in the user interface. That is, from auto-generated operator property UIs (like the redo panel) and the outliner "Data API" display mode. Does not hide it in the keymap UI.

Also don't save in presets, as if PROP_SKIP_PRESET was set.

PROP_SKIP_SAVE 

Doesn't preserve the last value for repeated operator calls.

Also don't save in presets, as if PROP_SKIP_PRESET was set.

PROP_PROPORTIONAL 

Each value is related proportionally (object scale, image size).

PROP_ID_REFCOUNT 

Mark this property as handling ID user count.

This is done automatically by the auto-generated setter function. If an RNA property has a custom setter, it's the setter's responsibility to correctly update the user count.

Note
In most basic cases, makesrna will automatically set this flag, based on the STRUCT_ID_REFCOUNT flag of the defined pointer type. This only works if makesrna can find a matching DNA property though, 'virtual' RNA properties (using both a getter and setter) will never get this flag defined automatically.
PROP_ID_SELF_CHECK 

Disallow assigning a variable to itself, eg an object tracking itself only apply this to types that are derived from an ID ().

PROP_NEVER_NULL 

Use for...

  • pointers: in the UI and python so unsetting or setting to None won't work.
  • strings: so our internal generated get/length/set functions know to do NULL checks before access #30865.
PROP_NEVER_UNLINK 

Currently only used for UI, this is similar to PROP_NEVER_NULL except that the value may be NULL at times, used for ObData, where an Empty's will be NULL but setting NULL on a mesh object is not possible. So if it's not NULL, setting NULL can't be done!

PROP_PTR_NO_OWNERSHIP 

Pointers to data that is not owned by the struct. Typical example: Bone.parent, Bone.child, etc., and nearly all ID pointers. This is crucial information for processes that walk the whole data of an ID e.g. (like library override). Note that all ID pointers are enforced to this by default, this probably will need to be rechecked (see ugly infamous node-trees of material/texture/scene/etc.).

PROP_ENUM_FLAG 

flag contains multiple enums. NOTE: not to be confused with prop->enumbitflags this exposes the flag as multiple options in python and the UI.

Note
These can't be animated so use with care.
PROP_CONTEXT_UPDATE 
PROP_CONTEXT_PROPERTY_UPDATE 
PROP_REGISTER 
PROP_REGISTER_OPTIONAL 
PROP_THICK_WRAP 

Use for allocated function return values of arrays or strings for any data that should not have a reference kept.

It can be used for properties which are dynamically allocated too.

Note
Currently dynamic sized thick wrapped data isn't supported. This would be a useful addition and avoid a fixed maximum sized as in done at the moment.
PROP_IDPROPERTY 

This is an IDProperty, not a DNA one.

PROP_DYNAMIC 

For dynamic arrays & return values of type string.

PROP_ENUM_NO_CONTEXT 

For enum that shouldn't be contextual

PROP_ENUM_NO_TRANSLATE 

For enums not to be translated (e.g. view-layers' names in nodes).

PROP_NO_DEG_UPDATE 

Don't do dependency graph tag from a property update callback. Use this for properties which defines interface state, for example, properties which denotes whether modifier panel is collapsed or not.

PROP_DEG_SYNC_ONLY 

Property needs to ensure evaluated data-blocks are in sync with their original counter-part but the property does not affect evaluation itself.

PROP_PATH_OUTPUT 

File-paths that refer to output get a special treatment such as having the +/- operators available in the file browser.

PROP_PATH_SUPPORTS_BLEND_RELATIVE 

Path supports relative prefix: //, paths which don't support the relative suffix show a warning if the suffix is used.

PROP_PATH_SUPPORTS_TEMPLATES 

Paths that are evaluated with templating.

Note that this doesn't cause the property to support templating, but rather indicates to other parts of Blender whether it supports templating. Support for templating needs to be manually implemented.

When this is set, the property's path_template_type field should also be set.

See also
The top-level documentation of BKE_path_templates.hh.
PROP_SKIP_PRESET 

Do not write in presets (PROP_HIDDEN and PROP_SKIP_SAVE won't either).

Definition at line 300 of file RNA_types.hh.

◆ PropertyOverrideFlag

Flags related to comparing and overriding RNA properties. Make sure enums are updated with these.

FREE FLAGS: 2, 3, 4, 5, 6, 7, 8, 9, 12 and above.

Enumerator
PROPOVERRIDE_OVERRIDABLE_LIBRARY 

Means that the property can be overridden by a local override of some linked datablock.

PROPOVERRIDE_NO_COMPARISON 

Forbid usage of this property in comparison (& hence override) code. Useful e.g. for collections of data like mesh's geometry, particles, etc. Also for runtime data that should never be considered as part of actual Blend data (e.g. depsgraph from ViewLayers...).

PROPOVERRIDE_IGNORE 

Means the property can be fully ignored by override process. Unlike NO_COMPARISON, it can still be used by diffing code, but no override operation will be created for it, and no attempt to restore the data from linked reference either.

WARNING: This flag should be used with a lot of caution, as it completely bypasses override system. It is currently only used for ID's names, since we cannot prevent local override to get a different name from the linked reference, and ID names are 'rna name property' (i.e. are used in overrides of collections of IDs). See also BKE_lib_override_library_update() where we deal manually with the value of that property at DNA level.

PROPOVERRIDE_LIBRARY_INSERTION 

The property supports insertion (collections only).

PROPOVERRIDE_NO_PROP_NAME 

Only use indices to compare items in the property, never names (collections only).

Useful when StructRNA::nameproperty of the items is generated from other data (e.g. name of material slots is actually name of assigned material).

Definition at line 501 of file RNA_types.hh.

◆ PropertyPathTemplateType

For properties that support path templates, this indicates which purpose-specific variables (if any) should be available to them and how those variables should be built.

See also
The top-level documentation of BKE_path_templates.hh.
Enumerator
PROP_VARIABLES_NONE 
PROP_VARIABLES_RENDER_OUTPUT 

Definition at line 484 of file RNA_types.hh.

◆ PropertyScaleType

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 #77868.

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.

Enumerator
PROP_SCALE_LINEAR 

Linear scale (default).

PROP_SCALE_LOG 

Logarithmic scale

  • Maximum range: 0 <= x < inf
PROP_SCALE_CUBIC 

Cubic scale.

  • Maximum range: -inf < x < inf

Definition at line 203 of file RNA_types.hh.

◆ PropertySubType

Note
Also update enums in rna_rna.cc when adding items here. Watch it: these values are written to files as part of node socket button sub-types!
Enumerator
PROP_NONE 
PROP_FILEPATH 
PROP_DIRPATH 
PROP_FILENAME 
PROP_BYTESTRING 

A string which should be represented as bytes in python, NULL terminated though.

PROP_PASSWORD 

A string which should not be displayed in UI.

PROP_PIXEL 

A dimension in pixel units, possibly before DPI scaling (so value may not be the final pixel value but the one to apply DPI scale to).

PROP_UNSIGNED 
PROP_PERCENTAGE 
PROP_FACTOR 
PROP_ANGLE 
PROP_TIME 
PROP_TIME_ABSOLUTE 
PROP_DISTANCE 

Distance in 3d space, don't use for pixel distance for eg.

PROP_DISTANCE_CAMERA 
PROP_COLOR 
PROP_TRANSLATION 
PROP_DIRECTION 
PROP_VELOCITY 
PROP_ACCELERATION 
PROP_MATRIX 
PROP_EULER 
PROP_QUATERNION 
PROP_AXISANGLE 
PROP_XYZ 
PROP_XYZ_LENGTH 
PROP_COLOR_GAMMA 

Used for colors which would be color managed before display.

PROP_COORDS 

Generic array, no units applied, only that x/y/z/w are used (Python vector).

PROP_LAYER 
PROP_LAYER_MEMBER 
PROP_POWER 

Light

PROP_TEMPERATURE 
PROP_WAVELENGTH 
PROP_COLOR_TEMPERATURE 
PROP_FREQUENCY 
PROP_PIXEL_DIAMETER 
PROP_DISTANCE_DIAMETER 

Definition at line 232 of file RNA_types.hh.

◆ PropertyType

Enumerator
PROP_BOOLEAN 
PROP_INT 
PROP_FLOAT 
PROP_STRING 
PROP_ENUM 
PROP_POINTER 
PROP_COLLECTION 

Definition at line 161 of file RNA_types.hh.

◆ PropertyUnit

Enumerator
PROP_UNIT_NONE 
PROP_UNIT_LENGTH 
PROP_UNIT_AREA 
PROP_UNIT_VOLUME 
PROP_UNIT_MASS 
PROP_UNIT_ROTATION 
PROP_UNIT_TIME 
PROP_UNIT_TIME_ABSOLUTE 
PROP_UNIT_VELOCITY 
PROP_UNIT_ACCELERATION 
PROP_UNIT_CAMERA 
PROP_UNIT_POWER 
PROP_UNIT_TEMPERATURE 
PROP_UNIT_WAVELENGTH 
PROP_UNIT_COLOR_TEMPERATURE 
PROP_UNIT_FREQUENCY 

Definition at line 172 of file RNA_types.hh.

◆ RawPropertyType

Enumerator
PROP_RAW_UNSET 
PROP_RAW_INT 
PROP_RAW_SHORT 
PROP_RAW_CHAR 
PROP_RAW_BOOLEAN 
PROP_RAW_DOUBLE 
PROP_RAW_FLOAT 
PROP_RAW_UINT8 
PROP_RAW_UINT16 
PROP_RAW_INT64 
PROP_RAW_UINT64 
PROP_RAW_INT8 

Definition at line 622 of file RNA_types.hh.

◆ StructFlag

enum StructFlag
Enumerator
STRUCT_ID 

Indicates that this struct is an ID struct.

STRUCT_ID_REFCOUNT 

Indicates that this ID type's usages should typically be refcounted (i.e. makesrna will automatically set PROP_ID_REFCOUNT to PointerRNA properties that have this RNA type assigned).

STRUCT_UNDO 

defaults on, indicates when changes in members of a StructRNA should trigger undo steps.

STRUCT_RUNTIME 
STRUCT_FREE_POINTERS 
STRUCT_NO_IDPROPERTIES 

Menus and Panels don't need properties

STRUCT_NO_DATABLOCK_IDPROPERTIES 

e.g. for Operator

STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES 

for PropertyGroup which contains pointers to datablocks

STRUCT_PUBLIC_NAMESPACE 

Added to type-map BlenderRNA.structs_map

STRUCT_PUBLIC_NAMESPACE_INHERIT 

All sub-types are added too.

STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID 

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.

Definition at line 951 of file RNA_types.hh.

Function Documentation

◆ ENUM_OPERATORS()

Variable Documentation

◆ ANCESTOR_POINTERRNA_DEFAULT_SIZE

int64_t ANCESTOR_POINTERRNA_DEFAULT_SIZE = 2
constexpr

Allows to benefit from the max_full_copy_size optimization on copy of blender::Vector.

Definition at line 40 of file RNA_types.hh.

◆ PointerRNA_NULL

const PointerRNA PointerRNA_NULL
extern