|
Blender
V2.93
|
#include <BKE_geometry_set.hh>
Public Member Functions | |
| OutputAttributePtr ()=default | |
| OutputAttributePtr (blender::bke::WriteAttributePtr attribute) | |
| operator bool () const | |
| blender::bke::WriteAttribute & | get () |
| blender::bke::WriteAttribute & | operator* () |
| blender::bke::WriteAttribute * | operator-> () |
Geometry Component | |
| OutputAttributePtr (GeometryComponent &component, AttributeDomain domain, std::string name, CustomDataType data_type) | |
| ~OutputAttributePtr () | |
| void | save () |
| void | apply_span_and_save () |
An OutputAttributePtr wraps a #WriteAttributePtr that might not be stored in its final destination yet. Therefore, once the attribute has been filled with data, the save method has to be called, to store the attribute where it belongs (possibly by replacing an existing attribute with the same name).
This is useful for example in the Attribute Color Ramp node, when the same attribute name is used as input and output. Typically the input is a float attribute, and the output is a color. Those two attributes cannot exist at the same time, due to a name collision. To handle this situation well, first the output colors have to be computed before the input floats are deleted. Therefore, the outputs have to be written to a temporary buffer that replaces the existing attribute once all computations are done.
Definition at line 71 of file BKE_geometry_set.hh.
|
default |
| OutputAttributePtr::OutputAttributePtr | ( | blender::bke::WriteAttributePtr | attribute | ) |
| OutputAttributePtr::OutputAttributePtr | ( | GeometryComponent & | component, |
| AttributeDomain | domain, | ||
| std::string | name, | ||
| CustomDataType | data_type | ||
| ) |
Definition at line 1042 of file attribute_access.cc.
References BLI_assert, buffer, component(), blender::bke::custom_data_type_to_cpp_type(), MEM_malloc_arrayN, and blender::fn::CPPType::size().
| OutputAttributePtr::~OutputAttributePtr | ( | ) |
Definition at line 1115 of file attribute_access.cc.
References CLOG_ERROR, and LOG.
| void OutputAttributePtr::apply_span_and_save | ( | ) |
Definition at line 1123 of file attribute_access.cc.
References BLI_assert, and save().
Referenced by blender::nodes::attribute_compare_calc(), blender::nodes::attribute_convert_calc(), blender::nodes::attribute_math_calc(), blender::nodes::calculate_sphere_uvs(), blender::nodes::calculate_uvs(), blender::nodes::clamp_attribute(), blender::nodes::combine_attributes(), blender::nodes::compute_special_attributes(), blender::nodes::copy_attributes_based_on_mask(), blender::nodes::execute_on_component(), blender::nodes::fill_attribute(), blender::nodes::interpolate_existing_attributes(), blender::nodes::map_range_attribute(), blender::nodes::randomize_attribute_on_component(), and blender::nodes::separate_attribute().
|
inline |
Definition at line 92 of file BKE_geometry_set.hh.
References BLI_assert.
|
inline |
Definition at line 86 of file BKE_geometry_set.hh.
|
inline |
Definition at line 98 of file BKE_geometry_set.hh.
|
inline |
Definition at line 103 of file BKE_geometry_set.hh.
References blender::bke::WriteAttribute::get().
| void OutputAttributePtr::save | ( | ) |
Definition at line 1069 of file attribute_access.cc.
References GeometryComponent::attribute_try_create(), GeometryComponent::attribute_try_delete(), GeometryComponent::attribute_try_get_for_write(), BLI_assert, blender::StringRefNull::c_str(), CLOG_WARN, blender::bke::TemporaryWriteAttribute::component, blender::bke::WriteAttribute::cpp_type(), blender::bke::TemporaryWriteAttribute::data, blender::fn::GMutableSpan::data(), blender::bke::TemporaryWriteAttribute::final_name, LOG, blender::fn::CPPType::move_to_initialized_n(), blender::fn::CPPType::name(), and blender::fn::GMutableSpan::size().
Referenced by apply_span_and_save(), blender::nodes::attribute_mix_calc(), and blender::nodes::attribute_vector_math_calc().