MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ bind() [3/3]

void MayaFlux::Nodes::Network::MeshFieldOperator::bind ( uint32_t  slot_index,
FieldTarget  target,
Kinesis::VectorField  field 
)

Bind a VectorField to a slot.

Parameters
slot_indexTarget slot index.
targetMask of vertex attributes to drive. Any combination of POSITION, COLOR, NORMAL and TANGENT.
fieldVectorField: glm::vec3 -> glm::vec3.

Creates a FieldOperator for the slot if one does not yet exist. The FieldOperator is initialised from the slot's current vertex data. Subsequent binds on the same slot append fields to the existing operator.

Definition at line 41 of file MeshFieldOperator.cpp.

43{
44 if (!m_slots) {
46 "MeshFieldOperator::bind called before set_slots() -- "
47 "FieldOperator will be initialised lazily on first process()");
48 }
49
50 if (m_slots) {
51 if (slot_index >= m_slots->size()) {
53 "MeshFieldOperator::bind: slot_index {} out of range ({})",
54 slot_index, m_slots->size());
55 return;
56 }
57 auto op = get_or_create((*m_slots)[slot_index], slot_index);
58 op->bind(target, std::move(field));
59 } else {
60 auto& op = m_field_ops[slot_index];
61 if (!op)
62 op = std::make_shared<FieldOperator>(FieldMode::ABSOLUTE);
63 op->bind(target, std::move(field));
64 }
65}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::unordered_map< uint32_t, std::shared_ptr< FieldOperator > > m_field_ops
std::shared_ptr< FieldOperator > get_or_create(MeshSlot &slot, uint32_t slot_index)
Return an existing FieldOperator for the slot, or create and initialise one from the slot's current v...
std::vector< MeshSlot > * m_slots
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References get_or_create(), m_field_ops, MayaFlux::Nodes::Network::MeshOperator::m_slots, MF_ERROR, MF_WARN, MayaFlux::Journal::NodeProcessing, and MayaFlux::Journal::Nodes.

+ Here is the call graph for this function: