Cortex
10.0.0-a4
|
A context object intended for use with python's "with" syntax. More...
#include <MotionBlock.h>
Inherits noncopyable.
Public Member Functions | |
MotionBlock (RendererPtr renderer, const std::set< float > ×, bool active=true) | |
~MotionBlock () | |
def | __init__ (self, renderer, times) |
def | __enter__ (self) |
def | __exit__ (self, type, value, traceBack) |
A context object intended for use with python's "with" syntax.
The MotionBlock class provides a simple means of ensuring that renderer->motionBegin() calls are matched by renderer->motionEnd() calls, even in the face of exceptions and multiple return statements from a function.
It calls renderer.motionBegin() in enter and renderer.motionEnd() in exit.
IECore::MotionBlock::MotionBlock | ( | RendererPtr | renderer, |
const std::set< float > & | times, | ||
bool | active = true |
||
) |
Starts a new motion block, calling renderer->motionBegin(). If active is false or times.size() < 2 then nothing is done.
IECore::MotionBlock::~MotionBlock | ( | ) |
Closes the motion block by calling renderer->motionEnd(), unless no block was created in the constructor for any reason.