Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_geometry_set.hh
| Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | public: | ||||
| { | { | ||||
| const blender::fn::CPPType &cpp_type = blender::fn::CPPType::get<T>(); | const blender::fn::CPPType &cpp_type = blender::fn::CPPType::get<T>(); | ||||
| const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | ||||
| return this->attribute_get_constant_for_read(domain, type, &value); | return this->attribute_get_constant_for_read(domain, type, &value); | ||||
| } | } | ||||
| /** | /** | ||||
| * If an attribute with the given params exist, it is returned. | * If an attribute with the given params exist, it is returned. | ||||
| * If no attribute with the given name exists, it is created and returned. | * If no attribute with the given name exists, create it and | ||||
| * fill it with the default value if it is provided. | |||||
| * If an attribute with the given name but different domain or type exists, a temporary attribute | * If an attribute with the given name but different domain or type exists, a temporary attribute | ||||
| * is created that has to be saved after the output has been computed. This avoids deleting | * is created that has to be saved after the output has been computed. This avoids deleting | ||||
| * another attribute, before a computation is finished. | * another attribute, before a computation is finished. | ||||
| * | * | ||||
| * This might return no attribute when the attribute cannot exist on the component. | * This might return no attribute when the attribute cannot exist on the component. | ||||
| */ | */ | ||||
| OutputAttributePtr attribute_try_get_for_output(const blender::StringRef attribute_name, | OutputAttributePtr attribute_try_get_for_output(const blender::StringRef attribute_name, | ||||
| const AttributeDomain domain, | const AttributeDomain domain, | ||||
| const CustomDataType data_type); | const CustomDataType data_type, | ||||
| const void *default_value = nullptr); | |||||
| }; | }; | ||||
| template<typename T> | template<typename T> | ||||
| inline constexpr bool is_geometry_component_v = std::is_base_of_v<GeometryComponent, T>; | inline constexpr bool is_geometry_component_v = std::is_base_of_v<GeometryComponent, T>; | ||||
| /** | /** | ||||
| * A geometry set contains zero or more geometry components. There is at most one component of each | * A geometry set contains zero or more geometry components. There is at most one component of each | ||||
| * type. Individual components might be shared between multiple geometries. Shared components are | * type. Individual components might be shared between multiple geometries. Shared components are | ||||
| ▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines | |||||