Merge branch 'blender-v4.2-release'
This commit is contained in:
@@ -90,6 +90,7 @@ enum class CPPTypeFlags {
|
||||
Hashable = 1 << 0,
|
||||
Printable = 1 << 1,
|
||||
EqualityComparable = 1 << 2,
|
||||
IdentityDefaultValue = 1 << 3,
|
||||
|
||||
BasicType = Hashable | Printable | EqualityComparable,
|
||||
};
|
||||
|
||||
@@ -231,8 +231,14 @@ CPPType::CPPType(TypeTag<T> /*type*/,
|
||||
default_construct_indices_ = default_construct_indices_cb<T>;
|
||||
value_initialize_ = value_initialize_cb<T>;
|
||||
value_initialize_indices_ = value_initialize_indices_cb<T>;
|
||||
static T default_value;
|
||||
default_value_ = &default_value;
|
||||
if constexpr (bool(Flags & CPPTypeFlags::IdentityDefaultValue)) {
|
||||
static const T default_value = T::identity();
|
||||
default_value_ = &default_value;
|
||||
}
|
||||
else {
|
||||
static const T default_value = T();
|
||||
default_value_ = &default_value;
|
||||
}
|
||||
}
|
||||
if constexpr (std::is_destructible_v<T>) {
|
||||
destruct_ = destruct_cb<T>;
|
||||
|
||||
@@ -66,7 +66,8 @@ BLI_CPP_TYPE_MAKE(uint64_t, CPPTypeFlags::BasicType)
|
||||
BLI_CPP_TYPE_MAKE(blender::ColorGeometry4f, CPPTypeFlags::BasicType)
|
||||
BLI_CPP_TYPE_MAKE(blender::ColorGeometry4b, CPPTypeFlags::BasicType)
|
||||
|
||||
BLI_CPP_TYPE_MAKE(blender::math::Quaternion, CPPTypeFlags::BasicType)
|
||||
BLI_CPP_TYPE_MAKE(blender::math::Quaternion,
|
||||
CPPTypeFlags::BasicType | CPPTypeFlags::IdentityDefaultValue)
|
||||
|
||||
BLI_CPP_TYPE_MAKE(std::string, CPPTypeFlags::BasicType)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user