|
Enzo
|
A compiled script that runs once per point and edits the point's attributes. More...
#include <PointScript.h>
Public Member Functions | |
| const std::vector< AttributeBinding > & | getBindings () const |
| Returns every attribute the code binds, in the order they first appear. | |
| std::shared_ptr< PointScript > | clone () const |
| Returns a copy that runs in its own context. | |
| bool | addWrittenAttributes (geo::Primitive &output, String &error) const |
| Adds every attribute the script writes to the output, filled with the default value. | |
| bool | run (const ScriptContext &context, size_t primitiveIndex, geo::Primitive &output, Offset begin, Offset end, String &error) |
| Runs the script on the points in an offset range. | |
Static Public Member Functions | |
| static std::shared_ptr< PointScript > | compile (const String &code, String &error) |
| Returns the compiled script for the user's code. | |
A compiled script that runs once per point and edits the point's attributes.
The user's code is the body of a function that reads and writes the point's attributes as @name. curPt() returns the point's index among the live points and ptCount() returns how many live points there are. Functions like pointAttr() read any element of the input by index.
| bool enzo::script::PointScript::addWrittenAttributes | ( | geo::Primitive & | output, |
| String & | error ) const |
Adds every attribute the script writes to the output, filled with the default value.
| std::shared_ptr< PointScript > enzo::script::PointScript::clone | ( | ) | const |
Returns a copy that runs in its own context.
|
static |
Returns the compiled script for the user's code.
| bool enzo::script::PointScript::run | ( | const ScriptContext & | context, |
| size_t | primitiveIndex, | ||
| geo::Primitive & | output, | ||
| Offset | begin, | ||
| Offset | end, | ||
| String & | error ) |
Runs the script on the points in an offset range.
Reads bindings from the context's input mesh at primitiveIndex and stores written ones to the output.