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

◆ process_batch()

void MayaFlux::Nodes::Network::MeshNetwork::process_batch ( unsigned int  num_samples)
overridevirtual

Process the network for the given number of samples.

Parameters
num_samplesNumber of samples/frames to process

Subclasses implement their specific processing logic:

  1. Update internal state (physics, relationships, etc.)
  2. Process individual nodes
  3. Apply inter-node interactions
  4. Aggregate outputs if needed

Called by NodeGraphManager during token processing.

Implements MayaFlux::Nodes::Network::NodeNetwork.

Definition at line 105 of file MeshNetwork.cpp.

106{
107 if (!is_enabled() || m_slots.empty())
108 return;
109
110 if (m_sort_dirty)
111 rebuild_sort();
112
113 const float dt = get_timestep();
114
115 for (unsigned int frame = 0; frame < num_samples; ++frame) {
117
118 if (m_operator) {
119 if (auto* mesh_op = dynamic_cast<MeshOperator*>(m_operator.get()))
120 mesh_op->set_slots(m_slots, m_sorted_indices);
121 m_operator->process(dt);
122 }
123
124 if (m_operator_chain) {
125 for (const auto& op : m_operator_chain->operators()) {
126 if (auto* mesh_op = dynamic_cast<MeshOperator*>(op.get()))
127 mesh_op->set_slots(m_slots, m_sorted_indices);
128 op->process(dt);
129 }
130 }
131 }
132
133 for (const auto& slot : m_slots) {
134 if (slot.node)
135 slot.node->compute_frame();
136 }
137}
std::vector< uint32_t > m_sorted_indices
Processing order: indices into m_slots, parents before children.
bool m_sort_dirty
Set when add_slot() changes the DAG and a re-sort is needed.
std::shared_ptr< NetworkOperator > m_operator
bool is_enabled() const
Check if network is enabled.
float get_timestep() const
Seconds one visual frame advances this network.
std::shared_ptr< OperatorChain > m_operator_chain

References MayaFlux::Nodes::Network::NodeNetwork::get_timestep(), MayaFlux::Nodes::Network::NodeNetwork::is_enabled(), m_operator, MayaFlux::Nodes::Network::NodeNetwork::m_operator_chain, m_slots, m_sort_dirty, m_sorted_indices, propagate_world_transforms(), and rebuild_sort().

+ Here is the call graph for this function: