Blender V5.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
struct  IDPropertyGroupChildrenSet
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

void hash (const IDProperty &base_prop, XXH3_state_t *hash_state)
IDProperty to Value
std::unique_ptr< io::serialize::ArrayValue > convert_to_serialize_values (const IDProperty *properties)
 Convert the given properties to Value objects for serialization.
IDProperty from Value
IDProperty * convert_from_serialize_value (const io::serialize::Value &value)
 Convert the given value (which must be an array) to an IDProperty.
static IDProperty * idprop_from_value (const DictionaryValue &value)
static IDProperty * idprop_from_value (const ArrayValue &value)
Create Functions
std::unique_ptr< IDProperty, IDPropertyDeleter > create_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, IDPropertyDeleter > create (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, IDPropertyDeleter > create (StringRef prop_name, float value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_FLOAT, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create (StringRef prop_name, double value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_DOUBLE, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create (StringRef prop_name, StringRefNull value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_STRING, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create (StringRef prop_name, ID *value, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_ID, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create (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, IDPropertyDeleter > create (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, IDPropertyDeleter > create (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, IDPropertyDeleter > create_group (StringRef prop_name, eIDPropertyFlag flags={})
 Allocate a new IDProperty of type IDP_GROUP.
static std::unique_ptr< IDProperty, IDPropertyDeleter > array_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, IDPropertyDeleter > create_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 IDPropertySerializer & serializer_for (eIDPropertyType property_type)
 get the serializer for the given property type.
static const IDPropertySerializer & serializer_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_ITEMTYPE ("itemtype")
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

◆ convert_from_serialize_value()

IDProperty * blender::bke::idprop::convert_from_serialize_value ( const io::serialize::Value & 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 51 of file idprop_create.cc.

References create(), blender::IDPropertyTemplate::d, blender::IDP_DOUBLE, and blender::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 41 of file idprop_create.cc.

References create(), blender::IDPropertyTemplate::f, blender::IDP_FLOAT, and blender::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 69 of file idprop_create.cc.

References blender::BLI_assert(), create(), blender::ID::flag, blender::IDPropertyTemplate::id, blender::ID_FLAG_EMBEDDED_DATA, blender::IDP_ID, and blender::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 21 of file idprop_create.cc.

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

Referenced by blender::bke::action_asset_type_property(), blender::BKE_keyconfig_pref_set_select_mouse(), blender::brush_asset_metadata_ensure(), blender::ui::but_event_operator_string_from_panel(), blender::ui::but_event_property_operator_string(), blender::camera_write_cycles_compatibility_data_create(), blender::ed::object::collection_importer_add_exec(), create(), create(), create(), create(), create(), create(), create(), create(), blender::bke::create_auto_smooth_modifier(), blender::forward_compat::create_legacy_geometry_nodes_properties(), blender::bke::create_socket_meta_data_properties(), 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::idp_from_DatablockPointer(), blender::idp_from_PyFloat(), blender::idp_from_PyLong(), blender::IMB_metadata_set_field(), blender::init_node_tool_operator_idnames(), blender::keymap_update_brushes_handle_add_item(), blender::keymap_update_brushes_handle_remove_item(), blender::bke::node_create_asset_meta_data_properties(), blender::bke::node_update_asset_metadata(), blender::object_asset_dimensions_property(), blender::RNA_property_boolean_set(), blender::RNA_property_enum_set(), blender::RNA_property_float_set(), blender::RNA_property_float_set_array(), blender::RNA_property_int_set(), blender::RNA_property_int_set_array(), blender::RNA_property_pointer_set(), blender::animrig::tests::AnimDrawTest::SetUp(), blender::ui::shortcut_get_operator_property(), blender::ui::shortcut_property_from_rna(), blender::ui::shortcut_property_from_rna_for_enum(), blender::io::otio::store_foreign_metadata(), blender::bke::idprop::tests::test_array_to_value(), blender::bke::idprop::tests::test_double_to_value(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::idprop::tests::test_float_to_value(), blender::bke::idprop::tests::test_int_to_value(), blender::bke::idprop::tests::test_string_to_value(), blender::texture_paint_image_from_view_exec(), blender::bke::tests::UnusedIDsTestData::UnusedIDsTestData(), blender::version_cycles_property_int_set(), blender::version_geometry_nodes_add_attribute_input_settings(), and blender::version_geometry_nodes_properties().

◆ 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 148 of file idprop_create.cc.

References create(), and 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 141 of file idprop_create.cc.

References create(), and 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 134 of file idprop_create.cc.

References create(), and 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 61 of file idprop_create.cc.

References blender::StringRefNull::c_str(), create(), and blender::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 112 of file idprop_create.cc.

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

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

◆ create_bool()

◆ create_group()

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

Allocate a new IDProperty of type IDP_GROUP.

Parameters
prop_nameThe name of the newly created property.

Definition at line 155 of file idprop_create.cc.

References create_group(), blender::IDP_GROUP, and blender::IDP_New().

Referenced by blender::ed::asset::index::asset_metadata_from_dictionary(), blender::BKE_asset_metadata_idprop_ensure(), blender::BKE_keyconfig_pref_ensure(), blender::ui::but_event_operator_string_from_menu(), blender::ui::but_event_operator_string_from_panel(), blender::ui::but_event_property_operator_string(), blender::camera_write_cycles_compatibility_data_create(), blender::ed::object::collection_importer_add_exec(), blender::seq::compositor_effect_nodes_update_interface(), blender::seq::compositor_modifier_nodes_update_interface(), blender::bke::create_auto_smooth_modifier(), create_group(), blender::forward_compat::create_legacy_geometry_nodes_properties(), blender::bke::create_socket_meta_data_properties(), blender::bke::idprop::IDPGroupSerializer::entry_to_idprop(), blender::asset_system::DiskFileHashService::file_matches(), blender::asset_system::DiskFileHashService::get_hash(), blender::handle_operator_asset_reference_props(), blender::idp_from_PyMapping(), blender::idp_resize_group_array(), blender::idprops_ensure_named_group(), blender::IMB_metadata_ensure(), blender::ui::Layout::link(), blender::ImBuf::metadata_for_write(), blender::bke::node_create_asset_meta_data_properties(), blender::ed::space_node::node_draw_basis(), blender::operator_last_properties_init_impl(), blender::io::fbx::pchan_EnsureProperties(), blender::asset_system::remote_library_cancel_all_asset_downloads(), blender::asset_system::remote_library_cancel_all_listing_downloads(), blender::asset_system::remote_library_request_download(), blender::asset_system::remote_library_request_preview_download(), blender::RNA_property_collection_add(), blender::RNA_property_pointer_add(), blender::RNA_struct_idprops(), blender::RNA_struct_system_idprops(), blender::animrig::tests::AnimDrawTest::SetUp(), blender::ui::shortcut_get_operator_property(), blender::ui::shortcut_property_from_rna(), blender::ui::shortcut_property_from_rna_for_enum(), blender::io::otio::store_foreign_metadata(), blender::sync_system_properties(), blender::ui::template_operator_property_buts_draw_single(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::ui::uiItemFullO_ptr_ex(), blender::bke::compositor::update_effect_node_group_interface(), blender::update_system_properties(), blender::version_geometry_nodes_properties(), blender::wm_gizmo_create(), blender::WM_gizmo_operator_invoke(), blender::WM_gizmo_properties_alloc(), blender::wm_operator_create(), blender::WM_operator_last_properties_ensure_idprops(), blender::WM_operator_last_properties_store(), blender::WM_operator_properties_alloc(), blender::WM_toolsystem_ref_properties_ensure_idprops(), and blender::WM_toolsystem_ref_properties_init_for_keymap().

◆ hash()

◆ IDP_KEY_ITEMTYPE()

constexpr StringRef blender::bke::idprop::IDP_KEY_ITEMTYPE ( "itemtype" )
staticconstexpr

Remote asset listings use this name for the array element type.

See blender_asset_library_openapi.yaml for the spec.

In the future this could be handled by the remote asset listing downloader, translating from the OpenAPI data to the form the C++ code in this file expects ("subtype").

References IDP_KEY_ITEMTYPE().

Referenced by blender::bke::idprop::DictionaryEntryParser::get_subtype(), and IDP_KEY_ITEMTYPE().

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

◆ 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 753 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 749 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 752 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 751 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 754 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 750 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 748 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 755 of file idprop_serialize.cc.

Referenced by serializer_for(), and serializer_for().