Action

ILxActionListener

class ILxActionListener

Public Functions

void ActionChannelSignal(LXtObjectID self, LXtObjectID item, unsigned channel)

An action listener can be registered to watch for changes to action values.

void ActionChannelConstantChange(LXtObjectID self, LXtObjectID item, unsigned channel)
void ActionChannelConstantPreChange(LXtObjectID self, LXtObjectID item, unsigned channel)

ILxChannelRead

class ILxChannelRead

Public Functions

LxResult ValueObj(LXtObjectID self, LXtObjectID item, unsigned int channel, void **ppvObj)

The channel-read interface can be presented by anything that contains values for item channels. This includes actions and scene evaluation, both channel-read objects allocated through the scene interface. The envelope method returns an envelope only if one exists for the channel.

LxResult Integer(LXtObjectID self, LXtObjectID item, unsigned int channel, int *value)
LxResult Double(LXtObjectID self, LXtObjectID item, unsigned int channel, double *value)
LxResult String(LXtObjectID self, LXtObjectID item, unsigned int channel, const char **value)
LxResult Envelope(LXtObjectID self, LXtObjectID item, unsigned int channel, void **ppvObj)
double Time(LXtObjectID self)
int IsAnimated(LXtObjectID self, LXtObjectID item, int index)

Test to see if a channel is animated. If this is an evaluated channel-read (specified by any time), IsAnimated() tests whether the evaluation for the channel changes at any time during the animation. If this an action channel-read, IsAnimated() tests whether a channel contains animation, by looking at the whole action hierarchy and instances, and also takes animated gradients into account.

LxResult IsBaked(LXtObjectID self, LXtObjectID item, unsigned int channel)

Some channels may be baked that is they have samples cached over a range of time. These methods test if a channel is baked and return the samples as a ValueArray object.

LxResult BakedSamples(LXtObjectID self, LXtObjectID item, unsigned int channel, double *firstSample, double *spsRate, void **ppvObj)
LxResult SetTime(LXtObjectID self, double time)

The time at which values are read can be changed.

LxResult Type(LXtObjectID self, LXtObjectID item, unsigned int channel, unsigned *type)

801 methods for type, and getting encoded int values directly.

LxResult TypeName(LXtObjectID self, LXtObjectID item, unsigned int channel, const char **typeName)
LxResult EncodedInt(LXtObjectID self, LXtObjectID item, unsigned int channel, char *buf, unsigned len)
int IValue(ILxUnknownID item, unsigned channel)

User Class Only:

bool Encoded(CLxUser_Item &item, unsigned channel, std::string &result)
double FValue(ILxUnknownID item, unsigned channel)
bool GetString(ILxUnknownID item, unsigned channel, std::string &result)
bool Object(ILxUnknownID item, unsigned channel, CLxLocalizedObject &loc)
bool GetEnv(ILxUnknownID item, unsigned channel, CLxUser_Envelope &env)
bool GetBake(ILxUnknownID item, unsigned channel, double *firstSample, double *spsRate, CLxUser_ValueArray &array)
int IValue(CLxUser_Item &item, const char *channel)

User Class Only: Same again, this time taking the channel name instead of the index.

bool Encoded(CLxUser_Item &item, const char *channel, std::string &result)
double FValue(CLxUser_Item &item, const char *channel)
bool GetString(CLxUser_Item &item, const char *channel, std::string &result)
bool Object(const CLxUser_Item &item, const char *channel, CLxLocalizedObject &loc)
bool GetEnv(CLxUser_Item &item, const char *channel, CLxUser_Envelope &env)
LxResult GetRef(ILxUnknownID item, unsigned channel, void **ppvObj)

User Class Only: If the channel is of the OBJREF type then it’s actually a container for some other object. These methods allow direct access to the contents.

LxResult GetRef(CLxUser_Item &item, const char *channel, void **ppvObj)
template<class T>
bool GetRef(CLxUser_Item &item, T channel, CLxLocalizedObject &loc)
bool Get(ILxUnknownID item, unsigned channel, int *value)

User Class Only: The general Get() method takes the value as writable argument.

bool Get(ILxUnknownID item, unsigned channel, unsigned *value)
bool Get(ILxUnknownID item, unsigned channel, double *value)
bool Get(ILxUnknownID item, unsigned channel, float *value)
bool Get(ILxUnknownID item, unsigned channel, const char **value)
bool Get(ILxUnknownID item, unsigned channel, std::string &value)
bool Get(CLxUser_Item &item, const char *channel, std::string &value)
template<class T>
bool Get(CLxUser_Item &item, const char *channel, T value)
bool from(CLxUser_Scene &scene)

User Class Only: Some additional ways to init the wrapper. Commonly clients have a scene or an item and they want to read channel values.

bool from(CLxUser_Scene &scene, double time)
bool from(CLxUser_Item &item)
bool from(CLxUser_Item &item, double time)

ILxChannelWrite

class ILxChannelWrite

Public Functions

LxResult ValueObj(LXtObjectID self, LXtObjectID item, unsigned int channel, void **ppvObj)

In some cases we can write values to channels. Values written to actions are written as constants when using the Double and Integer methods, note that any animation on the channel will be overwritten. The DoubleKey and IntegerKey methods will create keys on channels that are already animated, otherwise the constant value for the channel will be set. Passing a value of one to the ‘create’ argument can be used to always create a key. The envelope method creates an envelope for the channel if it does not exist. If an envelope is created it will have a key created at the time chosen when the interface was obtained. The key will be created with the value of the constant channel.

LxResult Integer(LXtObjectID self, LXtObjectID item, unsigned int channel, int value)
LxResult Double(LXtObjectID self, LXtObjectID item, unsigned int channel, double value)
LxResult String(LXtObjectID self, LXtObjectID item, unsigned int channel, const char *value)
LxResult Envelope(LXtObjectID self, LXtObjectID item, unsigned int channel, void **ppvObj)
LxResult IntegerKey(LXtObjectID self, LXtObjectID item, unsigned int channel, int value, int create)
LxResult DoubleKey(LXtObjectID self, LXtObjectID item, unsigned int channel, double value, int create)
LxResult SetState(LXtObjectID self, LXtObjectID item, unsigned int channel, unsigned int state)
LxResult BakeSamples(LXtObjectID self, LXtObjectID item, unsigned int channel, double firstSample, double spsRate, void **ppvObj)

To cache baked values on a channel this method is called to set the start time and samples per second. The returned ValueArray should be filled with the samples.

LxResult Type(LXtObjectID self, LXtObjectID item, unsigned int channel, unsigned *type)

801 methods for type and encoded ints. For writing we have a choice of setting the int as a constant or a keyframe.

LxResult TypeName(LXtObjectID self, LXtObjectID item, unsigned int channel, const char **typeName)
LxResult EncodedInt(LXtObjectID self, LXtObjectID item, unsigned int channel, const char *value)
LxResult EncodedIntKey(LXtObjectID self, LXtObjectID item, unsigned int channel, const char *value)
bool Set(ILxUnknownID item, unsigned channel, int value)

User Class Only: Nicer methods allow us to use localized objects and use argument types to handle the different intrinsic type cases.

bool Set(ILxUnknownID item, unsigned channel, unsigned value)
bool Set(ILxUnknownID item, unsigned channel, double value)
bool Set(ILxUnknownID item, unsigned channel, const char *value)
bool Set(ILxUnknownID item, unsigned channel, std::string &value)
bool SetEncoded(CLxUser_Item &item, unsigned channel, const char *encoded)

User Class Only: Setting an encoded int takes a string as argument and converts that to an int. Requires the item wrapper.

bool Object(ILxUnknownID item, unsigned channel, CLxLocalizedObject &loc)

User Class Only:

bool AddEnv(ILxUnknownID item, unsigned channel, CLxUser_Envelope &env)
bool WriteBake(ILxUnknownID item, unsigned channel, double firstSample, double spsRate, CLxUser_ValueArray &array)
template<class T>
bool Set(CLxUser_Item &item, const char *channel, T value)

User Class Only: These classes permit access using a channel string rather than index, although they require an item wrapper.

bool SetEncoded(CLxUser_Item &item, const char *channel, const char *encoded)
bool Object(CLxUser_Item &item, const char *channel, CLxLocalizedObject &loc)
bool AddEnv(CLxUser_Item &item, const char *channel, CLxUser_Envelope &env)
bool SetRef(ILxUnknownID item, unsigned channel, ILxUnknownID obj)

User Class Only: Directly set the contents of an OBJREF channel.

bool SetRef(CLxUser_Item &item, const char *channel, ILxUnknownID obj)
bool from(CLxUser_Scene &scene, double time = 0.0)

User Class Only: User class methods to initialize a write context from scene or item.

bool from(CLxUser_Item &item, double time = 0.0)
bool setupFrom(CLxUser_Scene &scene)
bool setupFrom(CLxUser_Item &item)
  • LXs_ACTIONLAYER_SETUP

  • LXs_ACTIONLAYER_ANIM

  • LXs_ACTIONLAYER_EDIT

ILxEvalModifier

class ILxEvalModifier

The modifier class can describe itself with server tags.

  • TYPELIST A whitespace-delimited list of item types. The modifier will only be made active if one of these types is present in the cinema. Also if items of this type are added or removed the modifier will be re-validated.

  • GRAPHLIST A whitespace-delimited list of graph names. The modifier will be re-validated any time links in these graphs change.

Public Functions

LxResult Reset(LXtObjectID self, LXtObjectID scene)

Modifiers have two forms. The modifier class is a plug-in server of type ILxEvalModifier. This provides methods for creating modifier instances which operate on specific channels. The instance is an object that caches specific references to input and output channels and can perform computations over them. For example there is only one “IK” ILxEvalModifier server, but it will create instances to evaluate IK for all locators with parents. Each instance is identified by a key channel. The class interface provides methods for enumerating through key channels and creating and testing instances.

  • Reset Set the modifier class to the given scene, and reset the count of key channels for the Next() method.

  • Next Returns the item and index for the next key channel for this modifier in the current scene. If the last one has already been read, this method returns null.

  • Alloc Create a new instance for the given key channel. The eval object allows the instance to create references to the channels it wants to be able to read and write, and to cache the attributes interface needed to read their values during evaluation.

LXtObjectID Next(LXtObjectID self, unsigned *index)
LxResult Alloc(LXtObjectID self, LXtObjectID item, unsigned index, LXtObjectID eval, void **ppvObj)
  • LXsMOD_TYPELIST

  • LXsMOD_GRAPHLIST

  • LXsMOD_GUIDLIST

  • LXsMOD_REQUIREDTYPE


LXeEVAL_IDENTICAL

The modifier instance, allocated for a specific key channel in the scene, is given by an ILxModifier interface.

  • Evaluate Evaluate a modifier instance given an attribute interfaces for reading and writing channel values. The result code for the evaluation can be read using the ILxEvaluation interface, and can contain information about changes since the last invalidation. General codes allow for identical result, and the default is totally different.

  • LXeEVAL_DIFFERENT

ILxModifier

class ILxModifier

Public Functions

LxResult Evaluate(LXtObjectID self)

  • Test Test an instance to see if its still valid for the given key channel. If it returns LXe_FALSE or an error the instance will be removed.

  • Invalidate Check to see if a change to the given input channel should invalidate the current state of the modifier. LXe_OK should be returned in most cases, but LXe_FALSE can be returned if the given channel has no effect on the modifier.

  • RequiredCount, Required Enumerates the required channels for this modifier, getting the key item for an input channel.

  • Free Free cache data for this modifier.

LxResult Test(LXtObjectID self, LXtObjectID item, unsigned index)
LxResult Invalidate(LXtObjectID self, LXtObjectID item, unsigned index)
LxResult Validate(LXtObjectID self, LXtObjectID item, unsigned index, LxResult rc)
unsigned RequiredCount(LXtObjectID self)
LxResult Required(LXtObjectID self, unsigned index, unsigned *attr, void **ppvObj)
void Free(LXtObjectID self, void *cache)

LXs_MODIFIER_OPTIONS

There is a special case where some modifiers can have read-write channels, where the modifier takes their inputs and modifies them for output. For these channels to be recognized as intenally modifier, a special tag can be placed on these packages. For now, the mere presence of the tag is enough to flag these channels as potentially modified.

ILxSimulationModifier

class ILxSimulationModifier

Public Functions

LxResult Enabled(LXtObjectID self, LXtObjectID chanRead)

The modifier instance can also present a simulation interface. If this is present then the modifier’s Evaluate() method will never be called. Instead it will only be evaluated in the context of a simulation, and the results cached by the eval system.

  • Enabled Returns LXe_TRUE if the simulation should be computed.

  • Initialize Called to start the simulation. Initial conditions can be read from the attributes. Start time of the simulation is also passed.

  • Cleanup End the simulation.

  • StepSize Allows the modifier to request the general size of its time step. The exact step size will vary, but as a rule a simulation can vary its step size based on the conditions of the simulation.

  • Step Advance the simulation. This is passed the delta for this step, and it should read any inputs required from the attributes and write the state of the simulation to its output channels.

  • Bake The sim is given the chance to bake its own channel value.

LxResult Initialize(LXtObjectID self, double time, double sample)
void Cleanup(LXtObjectID self)
LxResult StepSize(LXtObjectID self, double *stepSize)
LxResult Step(LXtObjectID self, double dt)
LxResult Bake(LXtObjectID self, double time)

ILxEvaluation

class ILxEvaluation

The channel type can be READ, WRITE, or both. The modifier should also set the SETUP flag if a channel will be read in setup mode. The FORCE flag is used in conjunction with the READ flag, and specifies an input channel that may not always be read by the modifier. If the FORCE flag is set, the modifier will always be invalidated when the channel changes, even if the modifier doesn’t explicitly read the the input channel.

Public Functions

LxResult AddChannel(LXtObjectID self, LXtObjectID item, unsigned index, unsigned type, unsigned *attr)

The ILxEvaluation interface is passed to the ILxEvalModifier::Alloc() method as the way for instances to declare their inputs and outputs. It is also passed to any other subsystems that need to be able to register their own inputs, although they are generally not allowed to specify outputs. Clients should not read channel values at this point. This setup assumes that the inputs can have any possible value, so all contingencies should be considered. During actual evaluation the client will be passed an ILxAttributes interface from which to read their inputs.

  • AddChannel This adds a channel by item and index for input, output or both. The returned index in ‘attr’ is the index in the attributes interface provided during evaluation.

  • AddChannelName Same as above but takes the channel name instead of the index.

  • ReadTime Adds the time of the evaluation as an input attribute for those modifier nodes that need it.

LxResult AddChannelName(LXtObjectID self, LXtObjectID item, const char *name, unsigned type, unsigned *attr)
LxResult ReadTime(LXtObjectID self, unsigned *attr)
LxResult SetAlternateTime(LXtObjectID self, double time)

Modifiers can also perform alternate evaluation. The “set” methods are called during modifier evaluation to set all inputs to the modifier to come from an alternate evaluation essentially an alternate reality. The modifier can set an alternate time, or they can set alternate channel values. The latter is done by calling SetAlternate() and writing alternate values using the ILxChannelWrite interface that is returned. Alternate evaluation can also be cleared so that inputs come from the reality being altered.

LxResult SetAlternate(LXtObjectID self, void **ppvObj)
LxResult ClearAlternate(LXtObjectID self)
LxResult SetCache(LXtObjectID self, void *cache)

Modifiers can set and get cache data objects to remember their last evaluation state. These are freed by ILxModifier::Free().

void *GetCache(LXtObjectID self)
LxResult SetAlternateSetup(LXtObjectID self)

One more useful alternate is the setup action.

LxResult GetBakedSample(LXtObjectID self, unsigned index, unsigned bracket, double *fraction, void **ppvObj)

For baked channels, this method allows the client to read the baked sample before and after the current evaluation time. For ‘bracket’ of zero the sample is returned at or just after the current time. The returned ‘fraction’ is a value from 0 to 1 indicating how close this sample is to the next one. If the fraction is non-zero then calling this again with ‘bracket’ of 1 returns the sample just after the current time. This allows values from baked samples to be exactly interpolated.

double GetDT(LXtObjectID self)

Get an approximate timestep for evaluating nearby values. During a simulation this is the stepsize of the sim which may be less than a frame. In normal circumstances this is just the frame interval.

LxResult SimulationState(LXtObjectID self, unsigned *flags)

Get information about simulation. The LXfSIM_ state flags indicate if the simulation is just a fake preview and if so, if it’s advancing over time. The range is only valid for simulations that are being cached.

LxResult SimulationRange(LXtObjectID self, double *start, double *end)
unsigned AddChan(ILxUnknownID item, unsigned index, unsigned type = LXfECHAN_READ)

User Class Only:

unsigned AddChan(ILxUnknownID item, const char *name, unsigned type = LXfECHAN_READ)
unsigned AddTime()
bool Alternate(CLxUser_ChannelWrite &cw)

User Class Only: User method returns a channel write object.

double GetBaked(unsigned index, bool after, CLxLocalizedObject &loc)

User Class Only: The user method returns the fraction directly or -1 for errors.


LXfECHAN_READ

The channel type can be READ, WRITE, or both. The modifier should also set the SETUP flag if a channel will be read in setup mode. The FORCE flag is used in conjunction with the READ flag, and specifies an input channel that may not always be read by the modifier. If the FORCE flag is set, the modifier will always be invalidated when the channel changes, even if the modifier doesn’t explicitly read the the input channel.

  • LXfECHAN_WRITE

  • LXfECHAN_SETUP

  • LXfECHAN_FORCE

  • LXfSIM_NOCACHE

  • LXfSIM_CONTINUOUS

ILxModifier1

class ILxModifier1

Public Functions

LxResult Evaluate(LXtObjectID self)

The ILxModifier1 interface was used in some 501 plug-ins, specifically Recoil and its relatives. This translation can probably be retred post-601. 601

LxResult Test(LXtObjectID self, LXtObjectID item, unsigned index)
LxResult Invalidate(LXtObjectID self, LXtObjectID item, unsigned index)
unsigned RequiredCount(LXtObjectID self)
LxResult Required(LXtObjectID self, unsigned index, unsigned *attr, void **ppvObj)
void Free(LXtObjectID self, void *cache)