Blender  V2.93
Public Member Functions | List of all members
blender::nodes::GeoNodeExecParams Class Reference

#include <NOD_geometry_exec.hh>

Public Member Functions

 GeoNodeExecParams (const DNode node, GValueMap< StringRef > &input_values, GValueMap< StringRef > &output_values, const PersistentDataHandleMap &handle_map, const Object *self_object, const ModifierData *modifier, Depsgraph *depsgraph)
 
GMutablePointer extract_input (StringRef identifier)
 
template<typename T >
T extract_input (StringRef identifier)
 
template<typename T >
Vector< Textract_multi_input (StringRef identifier)
 
template<typename T >
const Tget_input (StringRef identifier) const
 
void set_output_by_move (StringRef identifier, GMutablePointer value)
 
void set_output_by_copy (StringRef identifier, GPointer value)
 
template<typename T >
void set_output (StringRef identifier, T &&value)
 
const bNodenode () const
 
const PersistentDataHandleMaphandle_map () const
 
const Objectself_object () const
 
Depsgraphdepsgraph () const
 
void error_message_add (const NodeWarningType type, std::string message) const
 
ReadAttributePtr get_input_attribute (const StringRef name, const GeometryComponent &component, const AttributeDomain domain, const CustomDataType type, const void *default_value) const
 
template<typename T >
bke::TypedReadAttribute< Tget_input_attribute (const StringRef name, const GeometryComponent &component, const AttributeDomain domain, const T &default_value) const
 
CustomDataType get_input_attribute_data_type (const StringRef name, const GeometryComponent &component, const CustomDataType default_type) const
 
AttributeDomain get_highest_priority_input_domain (Span< std::string > names, const GeometryComponent &component, const AttributeDomain default_domain) const
 

Detailed Description

Definition at line 60 of file NOD_geometry_exec.hh.

Constructor & Destructor Documentation

◆ GeoNodeExecParams()

blender::nodes::GeoNodeExecParams::GeoNodeExecParams ( const DNode  node,
GValueMap< StringRef > &  input_values,
GValueMap< StringRef > &  output_values,
const PersistentDataHandleMap handle_map,
const Object self_object,
const ModifierData modifier,
Depsgraph depsgraph 
)
inline

Definition at line 71 of file NOD_geometry_exec.hh.

Member Function Documentation

◆ depsgraph()

Depsgraph* blender::nodes::GeoNodeExecParams::depsgraph ( ) const
inline

Definition at line 202 of file NOD_geometry_exec.hh.

◆ error_message_add()

void blender::nodes::GeoNodeExecParams::error_message_add ( const NodeWarningType  type,
std::string  message 
) const

Add an error message displayed at the top of the node when displaying the node tree, and potentially elsewhere in Blender.

Definition at line 30 of file intern/node_geometry_exec.cc.

References BKE_nodetree_error_message_add(), BLI_assert, blender::nodes::NodeRef::bnode(), blender::nodes::NodeRef::btree(), context, DEG_get_original_id(), and type.

Referenced by get_input_attribute().

◆ extract_input() [1/2]

GMutablePointer blender::nodes::GeoNodeExecParams::extract_input ( StringRef  identifier)
inline

Get the input value for the input socket with the given identifier.

The node calling becomes responsible for destructing the value before it is done executing. This method can only be called once for each identifier.

Definition at line 94 of file NOD_geometry_exec.hh.

References blender::fn::GValueMap< Key >::extract().

◆ extract_input() [2/2]

template<typename T >
T blender::nodes::GeoNodeExecParams::extract_input ( StringRef  identifier)
inline

Get the input value for the input socket with the given identifier.

This method can only be called once for each identifier.

Definition at line 107 of file NOD_geometry_exec.hh.

References blender::fn::GValueMap< Key >::extract(), and T.

◆ extract_multi_input()

template<typename T >
Vector<T> blender::nodes::GeoNodeExecParams::extract_multi_input ( StringRef  identifier)
inline

Get input as vector for multi input socket with the given identifier.

This method can only be called once for each identifier.

Definition at line 120 of file NOD_geometry_exec.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::fn::GValueMap< Key >::contains(), blender::fn::GValueMap< Key >::extract(), T, and std::to_string().

◆ get_highest_priority_input_domain()

AttributeDomain blender::nodes::GeoNodeExecParams::get_highest_priority_input_domain ( Span< std::string >  names,
const GeometryComponent component,
const AttributeDomain  default_domain 
) const

If any of the corresponding input sockets are attributes instead of single values, use the highest priority attribute domain from among them. Otherwise return the default domain.

Definition at line 145 of file intern/node_geometry_exec.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::attribute_domain_highest_priority(), BLI_assert, component(), default_domain, bNodeSocket::identifier, names, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), SOCK_STRING, and bNodeSocket::type.

◆ get_input()

template<typename T >
const T& blender::nodes::GeoNodeExecParams::get_input ( StringRef  identifier) const
inline

Get the input value for the input socket with the given identifier.

Definition at line 141 of file NOD_geometry_exec.hh.

References blender::fn::GValueMap< Key >::lookup(), and T.

◆ get_input_attribute() [1/2]

ReadAttributePtr blender::nodes::GeoNodeExecParams::get_input_attribute ( const StringRef  name,
const GeometryComponent component,
const AttributeDomain  domain,
const CustomDataType  type,
const void *  default_value 
) const

Creates a read-only attribute based on node inputs. The method automatically detects which input socket with the given name is available.

Note
This will add an error message if the string socket is active and the input attribute does not exist.

Definition at line 56 of file intern/node_geometry_exec.cc.

References BLI_assert, CD_PROP_COLOR, CD_PROP_FLOAT, CD_PROP_FLOAT3, component(), Error, error_message_add(), bNodeSocket::identifier, SOCK_FLOAT, SOCK_RGBA, SOCK_STRING, SOCK_VECTOR, TIP_, type, and bNodeSocket::type.

Referenced by get_input_attribute().

◆ get_input_attribute() [2/2]

template<typename T >
bke::TypedReadAttribute<T> blender::nodes::GeoNodeExecParams::get_input_attribute ( const StringRef  name,
const GeometryComponent component,
const AttributeDomain  domain,
const T default_value 
) const
inline

◆ get_input_attribute_data_type()

CustomDataType blender::nodes::GeoNodeExecParams::get_input_attribute_data_type ( const StringRef  name,
const GeometryComponent component,
const CustomDataType  default_type 
) const

Get the type of an input property or the associated constant socket types with the same names. Fall back to the default value if no attribute exists with the name.

Definition at line 104 of file intern/node_geometry_exec.cc.

References BLI_assert, CD_PROP_BOOL, CD_PROP_COLOR, CD_PROP_FLOAT, CD_PROP_FLOAT3, component(), bNodeSocket::identifier, SOCK_BOOLEAN, SOCK_FLOAT, SOCK_RGBA, SOCK_STRING, SOCK_VECTOR, and bNodeSocket::type.

◆ handle_map()

const PersistentDataHandleMap& blender::nodes::GeoNodeExecParams::handle_map ( ) const
inline

Definition at line 192 of file NOD_geometry_exec.hh.

◆ node()

const bNode& blender::nodes::GeoNodeExecParams::node ( ) const
inline

Get the node that is currently being executed.

Definition at line 187 of file NOD_geometry_exec.hh.

References blender::nodes::NodeRef::bnode().

◆ self_object()

const Object* blender::nodes::GeoNodeExecParams::self_object ( ) const
inline

Definition at line 197 of file NOD_geometry_exec.hh.

◆ set_output()

template<typename T >
void blender::nodes::GeoNodeExecParams::set_output ( StringRef  identifier,
T &&  value 
)
inline

Store the output value for the given socket identifier.

Definition at line 176 of file NOD_geometry_exec.hh.

References blender::fn::GValueMap< Key >::add_new(), and blender::fn::CPPType::get().

◆ set_output_by_copy()

void blender::nodes::GeoNodeExecParams::set_output_by_copy ( StringRef  identifier,
GPointer  value 
)
inline

◆ set_output_by_move()

void blender::nodes::GeoNodeExecParams::set_output_by_move ( StringRef  identifier,
GMutablePointer  value 
)
inline

Move-construct a new value based on the given value and store it for the given socket identifier.

Definition at line 153 of file NOD_geometry_exec.hh.

References blender::fn::GValueMap< Key >::add_new_by_move(), BLI_assert, blender::fn::GMutablePointer::get(), and blender::fn::GMutablePointer::type().


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