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

Namespaces

namespace  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  IDPBoolSerializer
 IDPSerializer for IDP_INT. 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

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 (StringRef prop_name, bool value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_BOOLEAN, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRef 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 (StringRef prop_name, float value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_FLOAT, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRef prop_name, double value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_DOUBLE, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRef prop_name, StringRefNull value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_STRING, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRef prop_name, ID *value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_ID, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeletercreate (StringRef 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 (StringRef 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 (StringRef 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 (StringRef prop_name, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_GROUP.
static std::unique_ptr< IDProperty, IDPropertyDeleterarray_create (const StringRef 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 (StringRef 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()

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

◆ array_values_set()

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 ( StringRef 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 IDPropertyTemplate::d, IDP_DOUBLE, and IDP_New().

◆ create() [2/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRef 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 IDPropertyTemplate::f, IDP_FLOAT, and IDP_New().

◆ create() [3/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRef 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, ID::flag, IDPropertyTemplate::id, ID_FLAG_EMBEDDED_DATA, IDP_ID, and IDP_New().

◆ create() [4/8]

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

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

Definition at line 17 of file idprop_create.cc.

References IDPropertyTemplate::i, IDP_INT, and IDP_New().

Referenced by blender::bke::action_asset_type_property(), bc_set_IDPropertyMatrix(), BKE_keyconfig_pref_set_select_mouse(), brush_asset_metadata_ensure(), camera_write_cycles_compatibility_data_create(), blender::bke::create_auto_smooth_modifier(), blender::bke::idprop::IDPDoubleSerializer::entry_to_idprop(), blender::bke::idprop::IDPFloatSerializer::entry_to_idprop(), blender::bke::idprop::IDPIntSerializer::entry_to_idprop(), blender::bke::idprop::IDPStringSerializer::entry_to_idprop(), blender::nodes::id_name_or_value_prop(), blender::nodes::id_property_create_from_socket(), idp_from_DatablockPointer(), idp_from_PyFloat(), idp_from_PyLong(), blender::bke::tests::IDSubDataTestData::IDSubDataTestData(), IMB_metadata_set_field(), keymap_update_brushes_handle_add_item(), keymap_update_brushes_handle_remove_item(), blender::bke::node_update_asset_metadata(), object_asset_dimensions_property(), blender::ed::geometry::replace_strings_with_id_pointers(), RNA_property_boolean_set(), RNA_property_float_set(), RNA_property_float_set_array(), RNA_property_int_set(), RNA_property_int_set_array(), RNA_property_pointer_set(), shortcut_get_operator_property(), shortcut_property_from_rna(), blender::bke::idprop::tests::test_array_to_value(), blender::bke::idprop::tests::test_double_to_value(), blender::bke::idprop::tests::test_float_to_value(), blender::bke::idprop::tests::test_int_to_value(), blender::bke::idprop::tests::test_string_to_value(), texture_paint_image_from_view_exec(), ui_but_event_operator_string_from_panel(), ui_but_event_property_operator_string(), blender::nodes::update_input_properties_from_node_tree(), version_cycles_property_int_set(), and version_geometry_nodes_add_attribute_input_settings().

◆ create() [5/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRef 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 144 of file idprop_create.cc.

References create_array().

◆ create() [6/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRef 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 137 of file idprop_create.cc.

References create_array().

◆ create() [7/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRef 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 130 of file idprop_create.cc.

References create_array().

◆ create() [8/8]

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create ( StringRef prop_name,
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_array()

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

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

Template Parameters
PrimitiveTypeC-Primitive type of the array. Can be int32_t, float, double.
id_property_subtypeSub-type of the #ID_ARRAY. Must match PrimitiveType.

Definition at line 108 of file idprop_create.cc.

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

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

◆ create_bool()

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

◆ create_group()

std::unique_ptr< IDProperty, IDPropertyDeleter > blender::bke::idprop::create_group ( StringRef prop_name,
eIDPropertyFlag flags = {} )

◆ IDP_KEY_NAME()

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

◆ IDP_KEY_SUBTYPE()

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

◆ IDP_KEY_TYPE()

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

◆ IDP_KEY_VALUE()

◆ IDP_PROPERTY_TYPENAME_ARRAY()

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

◆ IDP_PROPERTY_TYPENAME_BOOL()

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

◆ IDP_PROPERTY_TYPENAME_DOUBLE()

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

◆ IDP_PROPERTY_TYPENAME_FLOAT()

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

◆ IDP_PROPERTY_TYPENAME_GROUP()

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

◆ IDP_PROPERTY_TYPENAME_INT()

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

◆ IDP_PROPERTY_TYPENAME_STRING()

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

◆ IDP_PROPERTY_TYPENAME_UNKNOWN()

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

◆ idprop_from_value() [1/2]

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