Blender V4.3
blender::bke::idprop Namespace Reference

Namespaces

namespace  tests
 

Classes

struct  DictionaryEntryParser
 Helper class for parsing DictionaryValues. More...
 
class  IDPArraySerializer
 IDPSerializer for IDP_ARRAY. More...
 
class  IDPBoolSerializer
 IDPSerializer for IDP_INT. More...
 
class  IDPDoubleSerializer
 IDPSerializer for IDP_DOUBLE. More...
 
class  IDPFloatSerializer
 IDPSerializer for IDP_FLOAT. More...
 
class  IDPGroupSerializer
 IDPSerializer for IDP_GROUP. More...
 
class  IDPIntSerializer
 IDPSerializer for IDP_INT. More...
 
class  IDPropertyDeleter
 
class  IDPropertySerializer
 Base class for (de)serializing IDProperties. More...
 
class  IDPStringSerializer
 IDPSerializer for IDP_STRING. More...
 
class  IDPUnknownSerializer
 Dummy serializer for unknown and unsupported types. More...
 

Functions

IDProperty to Value
std::unique_ptr< blender::io::serialize::ArrayValueconvert_to_serialize_values (const IDProperty *properties)
 Convert the given properties to Value objects for serialization.
 
IDProperty from Value
IDPropertyconvert_from_serialize_value (const blender::io::serialize::Value &value)
 Convert the given value to an IDProperty.
 
static IDPropertyidprop_from_value (const DictionaryValue &value)
 
static IDPropertyidprop_from_value (const ArrayValue &value)
 
Create Functions
std::unique_ptr< IDProperty, IDPropertyDeletercreate_bool (StringRefNull prop_name, bool value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_BOOLEAN, set its name and value.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, int32_t value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_INT, set its name and value.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, float value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_FLOAT, set its name and value.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, double value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_DOUBLE, set its name and value.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, const StringRefNull value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_STRING, set its name and value.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, ID *value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_ID, set its name and value.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, Span< int32_t > values, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_ARRAY and sub-type IDP_INT.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, Span< float > values, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_ARRAY and sub-type IDP_FLOAT.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, Span< double > values, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_ARRAY and sub-type IDP_DOUBLE.
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate_group (StringRefNull prop_name, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_GROUP.
 
static std::unique_ptr< IDProperty, IDPropertyDeleterarray_create (const StringRefNull prop_name, eIDPropertyType subtype, size_t array_len, const eIDPropertyFlag flags)
 
static void array_values_set (IDProperty *property, const void *values, size_t values_len, size_t value_size)
 
template<typename PrimitiveType , eIDPropertyType id_property_subtype>
std::unique_ptr< IDProperty, IDPropertyDeletercreate_array (StringRefNull prop_name, Span< PrimitiveType > values, const eIDPropertyFlag flags)
 

ID property serialization.

static constexpr IDPStringSerializer IDP_SERIALIZER_STRING
 
static constexpr IDPBoolSerializer IDP_SERIALIZER_BOOL
 
static constexpr IDPIntSerializer IDP_SERIALIZER_INT
 
static constexpr IDPFloatSerializer IDP_SERIALIZER_FLOAT
 
static constexpr IDPDoubleSerializer IDP_SERIALIZER_DOUBLE
 
static constexpr IDPArraySerializer IDP_SERIALIZER_ARRAY
 
static constexpr IDPGroupSerializer IDP_SERIALIZER_GROUP
 
static constexpr IDPUnknownSerializer IDP_SERIALIZER_UNKNOWN
 
static const IDPropertySerializerserializer_for (eIDPropertyType property_type)
 get the serializer for the given property type.
 
static const IDPropertySerializerserializer_for (StringRef idprop_typename)
 get serializer for the given typename.
 
static constexpr StringRef IDP_KEY_NAME ("name")
 
static constexpr StringRef IDP_KEY_TYPE ("type")
 
static constexpr StringRef IDP_KEY_SUBTYPE ("subtype")
 
static constexpr StringRef IDP_KEY_VALUE ("value")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_STRING ("IDP_STRING")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_BOOL ("IDP_BOOL")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_INT ("IDP_INT")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_FLOAT ("IDP_FLOAT")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_DOUBLE ("IDP_DOUBLE")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_ARRAY ("IDP_ARRAY")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_GROUP ("IDP_GROUP")
 
static constexpr StringRef IDP_PROPERTY_TYPENAME_UNKNOWN ("IDP_UNKNOWN")
 

Function Documentation

◆ array_create()

static std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::array_create ( const StringRefNull prop_name,
eIDPropertyType subtype,
size_t array_len,
const eIDPropertyFlag flags )
static

◆ array_values_set()

static void blender::bke::idprop::array_values_set ( IDProperty * property,
const void * values,
size_t values_len,
size_t value_size )
static

Definition at line 90 of file idprop_create.cc.

References BLI_assert, IDP_Array, and IDProperty::len.

Referenced by create_array().

◆ convert_from_serialize_value()

◆ convert_to_serialize_values()

◆ create() [1/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
const StringRefNull value,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_STRING, set its name and value.

Definition at line 57 of file idprop_create.cc.

References blender::StringRefNull::c_str(), and IDP_NewString().

◆ create() [2/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
double value,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_DOUBLE, set its name and value.

Definition at line 47 of file idprop_create.cc.

References blender::StringRefNull::c_str(), IDPropertyTemplate::d, IDP_DOUBLE, and IDP_New().

◆ create() [3/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
float value,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_FLOAT, set its name and value.

Definition at line 37 of file idprop_create.cc.

References blender::StringRefNull::c_str(), IDPropertyTemplate::f, IDP_FLOAT, and IDP_New().

◆ create() [4/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
ID * value,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_ID, set its name and value.

Definition at line 65 of file idprop_create.cc.

References BLI_assert, blender::StringRefNull::c_str(), IDPropertyTemplate::id, ID_FLAG_EMBEDDED_DATA, IDP_ID, and IDP_New().

◆ create() [5/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
int32_t value,
eIDPropertyFlag flags = {} )

◆ create() [6/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
Span< double > values,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_ARRAY and sub-type IDP_DOUBLE.

Parameters
valuesThe values will be copied into the IDProperty.

Definition at line 145 of file idprop_create.cc.

References create_array().

◆ create() [7/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
Span< float > values,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_ARRAY and sub-type IDP_FLOAT.

Parameters
valuesThe values will be copied into the IDProperty.

Definition at line 138 of file idprop_create.cc.

References create_array().

◆ create() [8/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull prop_name,
Span< int32_t > values,
eIDPropertyFlag flags = {} )

Allocate a new IDProperty of type IDP_ARRAY and sub-type IDP_INT.

Parameters
valuesThe values will be copied into the IDProperty.

Definition at line 131 of file idprop_create.cc.

References create_array().

◆ create_array()

template<typename PrimitiveType , eIDPropertyType id_property_subtype>
std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create_array ( StringRefNull prop_name,
Span< PrimitiveType > values,
const eIDPropertyFlag flags )

Create a IDProperty array of id_property_subtype and fill it with the given values.

Definition at line 108 of file idprop_create.cc.

References array_create(), array_values_set(), BLI_assert, blender::StringRefNull::c_str(), IDP_DOUBLE, IDP_FLOAT, and IDP_INT.

Referenced by create(), create(), and create().

◆ create_bool()

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create_bool ( StringRefNull prop_name,
bool value,
eIDPropertyFlag flags = {} )

◆ create_group()

◆ IDP_KEY_NAME()

static constexpr StringRef blender::bke::idprop::IDP_KEY_NAME ( "name" )
staticconstexpr

◆ IDP_KEY_SUBTYPE()

static constexpr StringRef blender::bke::idprop::IDP_KEY_SUBTYPE ( "subtype" )
staticconstexpr

◆ IDP_KEY_TYPE()

static constexpr StringRef blender::bke::idprop::IDP_KEY_TYPE ( "type" )
staticconstexpr

◆ IDP_KEY_VALUE()

◆ IDP_PROPERTY_TYPENAME_ARRAY()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_ARRAY ( "IDP_ARRAY" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_BOOL()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_BOOL ( "IDP_BOOL" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_DOUBLE()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_DOUBLE ( "IDP_DOUBLE" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_FLOAT()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_FLOAT ( "IDP_FLOAT" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_GROUP()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_GROUP ( "IDP_GROUP" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_INT()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_INT ( "IDP_INT" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_STRING()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_STRING ( "IDP_STRING" )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_UNKNOWN()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_UNKNOWN ( "IDP_UNKNOWN" )
staticconstexpr

◆ idprop_from_value() [1/2]

static IDProperty * blender::bke::idprop::idprop_from_value ( const ArrayValue & value)
static

◆ idprop_from_value() [2/2]

◆ serializer_for() [1/2]

◆ serializer_for() [2/2]

Variable Documentation

◆ IDP_SERIALIZER_ARRAY

IDPArraySerializer blender::bke::idprop::IDP_SERIALIZER_ARRAY
staticconstexpr

Definition at line 729 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_BOOL

IDPBoolSerializer blender::bke::idprop::IDP_SERIALIZER_BOOL
staticconstexpr

Definition at line 725 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_DOUBLE

IDPDoubleSerializer blender::bke::idprop::IDP_SERIALIZER_DOUBLE
staticconstexpr

Definition at line 728 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_FLOAT

IDPFloatSerializer blender::bke::idprop::IDP_SERIALIZER_FLOAT
staticconstexpr

Definition at line 727 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_GROUP

IDPGroupSerializer blender::bke::idprop::IDP_SERIALIZER_GROUP
staticconstexpr

Definition at line 730 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_INT

IDPIntSerializer blender::bke::idprop::IDP_SERIALIZER_INT
staticconstexpr

Definition at line 726 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_STRING

IDPStringSerializer blender::bke::idprop::IDP_SERIALIZER_STRING
staticconstexpr

Definition at line 724 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().

◆ IDP_SERIALIZER_UNKNOWN

IDPUnknownSerializer blender::bke::idprop::IDP_SERIALIZER_UNKNOWN
staticconstexpr

Definition at line 731 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().