Enzo
Loading...
Searching...
No Matches
enzo::script::ScriptContext Class Reference

The world a script reads during one cook of a node. More...

#include <ScriptContext.h>

Inheritance diagram for enzo::script::ScriptContext:
enzo::expr::ExpressionContext

Public Member Functions

 ScriptContext (nt::NodeId currentNode, const NodePacket &input)
 
const geo::Mesh & getInputMesh (size_t primitiveIndex) const
 Returns the input mesh at a primitive index.
 
const MeshAttributeReader & getAttributeReader (size_t primitiveIndex) const
 Returns the reader for the input mesh at a primitive index.
 
void addWarning (const String &warning) const
 Adds a warning for the node, skipping one it already holds.
 
const std::vector< String > & getWarnings () const
 Returns every warning the script added, in the order they first appeared.
 
- Public Member Functions inherited from enzo::expr::ExpressionContext
 ExpressionContext (nt::NodeId currentNode)
 
nt::NodeId currentNode () const
 The node a relative parameter path resolves against.
 
template<typename Value >
std::optional< Value > readParameter (const String &path, unsigned int index) const
 Returns a parameter's value, evaluated on the first read and reused after.
 
const std::vector< nt::Unit > & getExpressionDependencies () const
 Every parameter the expression read during this evaluation.
 
void recordTimeDependency () const
 Notes that the expression read the scene time.
 
bool dependsOnTime () const
 Returns whether the expression read the scene time during this evaluation.
 

Detailed Description

The world a script reads during one cook of a node.

Adds the meshes of the node's input to what an expression reads, each looked up by its primitive index in the input.

Note
Every mesh in the input needs to be defragmented.

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