Blender  V2.93
Public Member Functions | List of all members
OutputAttributePtr Class Reference

#include <BKE_geometry_set.hh>

Public Member Functions

 OutputAttributePtr ()=default
 
 OutputAttributePtr (blender::bke::WriteAttributePtr attribute)
 
 operator bool () const
 
blender::bke::WriteAttributeget ()
 
blender::bke::WriteAttributeoperator* ()
 
blender::bke::WriteAttributeoperator-> ()
 
Geometry Component
 OutputAttributePtr (GeometryComponent &component, AttributeDomain domain, std::string name, CustomDataType data_type)
 
 ~OutputAttributePtr ()
 
void save ()
 
void apply_span_and_save ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ OutputAttributePtr() [1/3]

OutputAttributePtr::OutputAttributePtr ( )
default

◆ OutputAttributePtr() [2/3]

OutputAttributePtr::OutputAttributePtr ( blender::bke::WriteAttributePtr  attribute)

◆ OutputAttributePtr() [3/3]

OutputAttributePtr::OutputAttributePtr ( GeometryComponent component,
AttributeDomain  domain,
std::string  name,
CustomDataType  data_type 
)

◆ ~OutputAttributePtr()

OutputAttributePtr::~OutputAttributePtr ( )

Definition at line 1115 of file attribute_access.cc.

References CLOG_ERROR, and LOG.

Member Function Documentation

◆ apply_span_and_save()

void OutputAttributePtr::apply_span_and_save ( )

◆ get()

blender::bke::WriteAttribute& OutputAttributePtr::get ( )
inline

Definition at line 92 of file BKE_geometry_set.hh.

References BLI_assert.

◆ operator bool()

OutputAttributePtr::operator bool ( ) const
inline

Definition at line 86 of file BKE_geometry_set.hh.

◆ operator*()

blender::bke::WriteAttribute& OutputAttributePtr::operator* ( )
inline

Definition at line 98 of file BKE_geometry_set.hh.

◆ operator->()

blender::bke::WriteAttribute* OutputAttributePtr::operator-> ( )
inline

Definition at line 103 of file BKE_geometry_set.hh.

References blender::bke::WriteAttribute::get().

◆ save()

void OutputAttributePtr::save ( )

The documentation for this class was generated from the following files: