Blender  V3.3
Namespaces | Classes | Functions
blender::bke::idprop Namespace Reference

Namespaces

 tests
 

Classes

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

Functions

std::unique_ptr< io::serialize::ArrayValueconvert_to_serialize_values (const IDProperty *properties)
 Convert the given properties to Value objects for serialization. More...
 
IDProperty from Value
IDPropertyconvert_from_serialize_value (const blender::io::serialize::Value &value)
 Convert the given value to an IDProperty. More...
 
static IDPropertyidprop_from_value (const DictionaryValue &value)
 
static IDPropertyidprop_from_value (const ArrayValue &value)
 
Create Functions
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, int32_t value)
 Allocate a new IDProperty of type IDP_INT, set its name and value. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, float value)
 Allocate a new IDProperty of type IDP_FLOAT, set its name and value. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, double value)
 Allocate a new IDProperty of type IDP_DOUBLE, set its name and value. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, const StringRefNull value)
 Allocate a new IDProperty of type IDP_STRING, set its name and value. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, Span< int32_t > values)
 Allocate a new IDProperty of type IDP_ARRAY and subtype IDP_INT. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, Span< float > values)
 Allocate a new IDProperty of type IDP_ARRAY and subtype IDP_FLOAT. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRefNull prop_name, Span< double > values)
 Allocate a new IDProperty of type IDP_ARRAY and subtype IDP_DOUBLE. More...
 
std::unique_ptr< IDProperty, IDPropertyDeletercreate_group (StringRefNull prop_name)
 Allocate a new IDProperty of type IDP_GROUP. More...
 
static std::unique_ptr< IDProperty, IDPropertyDeleterarray_create (const StringRefNull prop_name, eIDPropertyType subtype, size_t array_len)
 
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)
 
IDProperty to Value
std::unique_ptr< ArrayValueconvert_to_serialize_values (const struct IDProperty *properties)
 

ID property serialization.

static constexpr IDPStringSerializer IDP_SERIALIZER_STRING
 
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. More...
 
static const IDPropertySerializerserializer_for (StringRef idprop_typename)
 get serializer for the given typename. More...
 
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_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 
)
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 58 of file idprop_create.cc.

References BLI_assert, IDP_Array, and IDProperty::len.

Referenced by create_array().

◆ convert_from_serialize_value()

IDProperty * blender::bke::idprop::convert_from_serialize_value ( const blender::io::serialize::Value value)

◆ convert_to_serialize_values() [1/2]

std::unique_ptr<io::serialize::ArrayValue> blender::bke::idprop::convert_to_serialize_values ( const IDProperty properties)

◆ convert_to_serialize_values() [2/2]

std::unique_ptr<ArrayValue> blender::bke::idprop::convert_to_serialize_values ( const struct IDProperty properties)

◆ create() [1/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
const StringRefNull  value 
)

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

Definition at line 40 of file idprop_create.cc.

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

◆ create() [2/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
double  value 
)

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

Definition at line 32 of file idprop_create.cc.

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

◆ create() [3/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
float  value 
)

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

Definition at line 24 of file idprop_create.cc.

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

◆ create() [4/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
int32_t  value 
)

◆ create() [5/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
Span< double values 
)

Allocate a new IDProperty of type IDP_ARRAY and subtype IDP_DOUBLE.

Parameters
valuesThe values will be copied into the IDProperty.

Definition at line 110 of file idprop_create.cc.

◆ create() [6/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
Span< float values 
)

Allocate a new IDProperty of type IDP_ARRAY and subtype IDP_FLOAT.

Parameters
valuesThe values will be copied into the IDProperty.

Definition at line 104 of file idprop_create.cc.

◆ create() [7/7]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRefNull  prop_name,
Span< int32_t values 
)

Allocate a new IDProperty of type IDP_ARRAY and subtype IDP_INT.

Parameters
valuesThe values will be copied into the IDProperty.

Definition at line 98 of file idprop_create.cc.

◆ 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 
)

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

Definition at line 76 of file idprop_create.cc.

References array_create(), array_values_set(), BLI_assert, blender::StringRefNull::c_str(), blender::Span< T >::data(), IDP_DOUBLE, IDP_FLOAT, IDP_INT, and blender::Span< T >::size().

◆ create_group()

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create_group ( StringRefNull  prop_name)

Allocate a new IDProperty of type IDP_GROUP.

Parameters
prop_nameThe name of the newly created property.

Definition at line 116 of file idprop_create.cc.

References blender::StringRefNull::c_str(), IDP_GROUP, and IDP_New().

Referenced by blender::bke::idprop::IDPGroupSerializer::entry_to_idprop().

◆ 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()

static constexpr StringRef blender::bke::idprop::IDP_KEY_VALUE ( "value"  )
staticconstexpr

◆ IDP_PROPERTY_TYPENAME_ARRAY()

static constexpr StringRef blender::bke::idprop::IDP_PROPERTY_TYPENAME_ARRAY ( "IDP_ARRAY"  )
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]

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

◆ serializer_for() [1/2]

static const IDPropertySerializer & blender::bke::idprop::serializer_for ( eIDPropertyType  property_type)
static

◆ serializer_for() [2/2]

static const IDPropertySerializer & blender::bke::idprop::serializer_for ( StringRef  idprop_typename)
static

Variable Documentation

◆ IDP_SERIALIZER_ARRAY

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

Definition at line 691 of file idprop_serialize.cc.

Referenced by serializer_for().

◆ IDP_SERIALIZER_DOUBLE

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

Definition at line 690 of file idprop_serialize.cc.

Referenced by serializer_for().

◆ IDP_SERIALIZER_FLOAT

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

Definition at line 689 of file idprop_serialize.cc.

Referenced by serializer_for().

◆ IDP_SERIALIZER_GROUP

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

Definition at line 692 of file idprop_serialize.cc.

Referenced by serializer_for().

◆ IDP_SERIALIZER_INT

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

Definition at line 688 of file idprop_serialize.cc.

Referenced by serializer_for().

◆ IDP_SERIALIZER_STRING

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

Definition at line 687 of file idprop_serialize.cc.

Referenced by serializer_for().

◆ IDP_SERIALIZER_UNKNOWN

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

Definition at line 693 of file idprop_serialize.cc.

Referenced by serializer_for().