26 prop_template.
i = value;
28 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
36 prop_template.
i = value;
38 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
46 prop_template.
f = value;
48 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
56 prop_template.
d = value;
58 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
66 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
77 prop_template.
id = value;
79 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
88 prop_template.
array.len = array_len;
89 prop_template.
array.type = subtype;
91 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
117 "Allowed values for PrimitiveType are int32_t, float and double.");
118 static_assert(!std::is_same_v<PrimitiveType, int32_t> || id_property_subtype ==
IDP_INT,
119 "PrimitiveType and id_property_type do not match (int32_t).");
120 static_assert(!std::is_same_v<PrimitiveType, float> || id_property_subtype ==
IDP_FLOAT,
121 "PrimitiveType and id_property_type do not match (float).");
122 static_assert(!std::is_same_v<PrimitiveType, double> || id_property_subtype ==
IDP_DOUBLE,
123 "PrimitiveType and id_property_type do not match (double).");
127 std::unique_ptr<IDProperty, IDPropertyDeleter>
property =
array_create(
128 prop_name, id_property_subtype, values_len, flags);
130 property.get(),
static_cast<const void *
>(values.
data()), values_len,
sizeof(
PrimitiveType));
160 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
#define IDP_array_voidp_get(prop)
ID and Library types, which are fundamental for SDNA.
constexpr const T * data() const
constexpr int64_t size() const
constexpr const char * c_str() const
std::unique_ptr< IDProperty, IDPropertyDeleter > create_array(StringRef prop_name, Span< PrimitiveType > values, const eIDPropertyFlag flags)
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.
static void array_values_set(IDProperty *property, const void *values, size_t values_len, size_t value_size)
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.
static std::unique_ptr< IDProperty, IDPropertyDeleter > array_create(const StringRef prop_name, eIDPropertyType subtype, size_t array_len, const eIDPropertyFlag flags)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
constexpr bool is_same_any_v
IDProperty * IDP_NewString(const char *st, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
IDProperty * IDP_New(char type, const IDPropertyTemplate *val, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct blender::IDPropertyTemplate::@100215251242210352227251277016155305041022127377 array