class ILxTool

The ILxTool Interface is accessed via the LXu_TOOL unique ID, or its human-readable alias, LXa_TOOL.

Public Functions

void Reset(LXtObjectID self)

The basic interface for tools is ILxTool. This has a set of methods that manage the state of the tool, and query the fundamental tool properties.

  • Reset The Reset method sets the tool attributes back to their initial/default state.

  • Evaluate This method applys the tool, recursively applying any hierarchy of sub-tools. Naturally, it validates the tool state upon completion.

  • VectorType This method returns the tool vector type, describing the vector packets required for processing.

  • Order Specifies the order in the pipe, by returning an Ordinal string.

  • Task Specifies the type of task performed by the tool.

  • Sequence This method uses the attribute sequence object given to store the tool’s complete state by generating the sequence of attribute changes needed to reproduce that exact state. A tool whose state is expressed entirely by its attributes may return LXe_NOTIMPL from this method, and let the system build the sequence directly from the attribute list.

void Evaluate(LXtObjectID self, LXtObjectID vts)
LXtObjectID VectorType(LXtObjectID self)
const char *Order(LXtObjectID self)
LXtID4 Task(LXtObjectID self)
LxResult Sequence(LXtObjectID self, LXtObjectID seq)
int ShouldBeAttribute(LXtObjectID self, LXtID4 task)

  • ShouldBeAttribute To help overcome the excessive factorization of tools into separated tasks, which confounds user expectations and prevents toolpipe elements from working closely together, This method allows a tool to specify which other tool task types should be considered more like tool attributes, so that changing the tool doesn’t ‘break’ the Tool Preset, but instead, overwrites it with the new pipe contents. This allows paint tool presets to remember their brushes almost as well as as they would have if the brush was an attribute of the tool, rather than a separate element. Users who don’t don’t want their presets automatically destroyed can simply manually rebuild the preset when they need it. While this complicates and undermines the integrity of toolpresets, it also adds mysterious complexity to the toolpipe for users, who will see some presets break when their tool list changes, and others merely accept the changes and destroy the original preset without comment or warning. Numerous other incompletely anticipated consequences are also bound to arise from this new mode of crosstalk between tools and their pipelines. Maybe some of them will not be bugs. The ShouldBeAttribute method returns flags to indicate whether the given task type should be accepted into a preset as a replacement without considering the preset to be different, or whether it should behave in accordance with reason and the system design.

LxResult GetOp(LXtObjectID self, void **ppvObj, unsigned flags)

It is often desirable to perform incremental updates to meshes, rather than simply evaluating a tool from scratch, every time an attribute changes. This is performed using a tool operation. A tool operation is spawned for every mesh the tool is expected to edit, and is used to perform an initial edit to the mesh. When a tool attribute changes, the tool operation is compared against the current state of the tool. If the tool operation is still valid, it will be updated to use the new tool attributes and re-evaluated to perform an incremental update to the previous evaluation. Tool Operations also are used in a procedural context. When a tool has been auto converted into a procedural tool item, it’s tool operation is evaluated as part of the procedural modeling system to perform initial and incremental edits to a procedural mesh. This set of functions is used to get the tool op, compare it against tool state and update the tool operation if the tool state is still valid.

  • GetOp The GetOp method is used to spawn a Tool Operation interface that can be used for evaluation and re-evaluation of a mesh edit. The tool is expected to spawn and return a new tool operation every time this function is called. The tool should store any user data in the tool operation before returning. The flags argument is used to pass various flags that specify the context in which the tool is being evaluated; as part of the tool pipe, or procedurally. In future, more flags may be supported.

unsigned CompareOp(LXtObjectID self, LXtObjectID vts, LXtObjectID toolop)
LxResult UpdateOp(LXtObjectID self, LXtObjectID toolop)

  • UpdateOp If the CompareOp function specifies that a previous tool operation is compatible with the current state of the tool, then this function will be called to copy updated attributes and user data from the tool, to the previous tool operation. The tool operation will then be re-evaluated using this updated data.


Note that returning this flag from a transform tool for falloffs will quickly annhilate tools like Taper and Twist.






If a tool provides an ILxToolOperation interface, using the GetOp functions. Then it should present the following server tag. This will result in the Tool Operation being used to evaluate the tool. If this server tag is not present, then the standard Evaluate function will be used to evaluate the tool. The value of this tag doesn’t matter, the presence of it is enough to signal that a tool operation will be spawned to handle evaluation.


The standard task codes are for: snapping tools, action center and axis, weight (falloff) modification tools, constraint tools, path and particle generators, and the main action tools (like primitives, transforms or mesh edits).



















It’s helpful to represent the tool tasks as strings for use in contexts such as procedural modeling.



















Default ordinals place these kinds of tools into their canonical order. These shouldn’t be changed without good reason since new ones can be inserted indefinitely.



















class ILxTool1

Public Functions

void Reset(LXtObjectID self)

This interface was retired in modo 901, and was replaced with an updated one that adds a few more methods.

void Evaluate(LXtObjectID self, LXtObjectID vts)
LXtObjectID VectorType(LXtObjectID self)
const char *Order(LXtObjectID self)
LXtID4 Task(LXtObjectID self)
LxResult Sequence(LXtObjectID self, LXtObjectID seq)
int ShouldBeAttribute(LXtObjectID self, LXtID4 task)


class ILxAttrSequence

The ILxAttrSequence Interface is accessed via the LXu_ATTRSEQUENCE unique ID.

Public Functions

LxResult Integer(LXtObjectID self, const char *name, int value)

The ILxAttrSequence interface is intended to complement attribute lists by capturing the sequence of attribute edits required to create a specific state within an object which implements the ILxAttributes interface. An attribute list is a minimal snapshot of an object’s exposed data, which may not fully describe the internal state of the object. This would be the case if attribute changes had a cumulative effect on the object (e.g. adding elements to a list). Preserving this state is accomplished by using the ILxAttrSequence interface to ‘record’ the necessary attribute changes for some host, which can then regenerate the object state by ‘playing back’ the edits.

  • Integer Use this method to record a change to an integer type attribute by specifying the attribute name and the new value.

  • Float Use this method to record a change to an floating point attribute (a double).

  • String Use this method to record a change to an string attribute.

  • Value Use this method to record a change to an attribute using a generic ILxValue.

LxResult Float(LXtObjectID self, const char *name, double value)
LxResult String(LXtObjectID self, const char *name, const char *value)
LxResult Value(LXtObjectID self, const char *name, LXtObjectID value)


class ILxToolOperation

Public Functions

LxResult Evaluate(LXtObjectID self, LXtObjectID vts)

A Tool Operation is a special interface that allows tools to be incrementally evaluated. The tool spawns and returns a Tool Operation interface. This tool operation interface is then used for evaluation and re-evaluation of the tool.

  • Evaluate Once a tool has spawned a tool operation, this function will be called to perform an initial evaluation.

LxResult ReEvaluate(LXtObjectID self, LXtObjectID vts)

  • ReEvaluate Subsequent evaluations of the tool operation will be performed using the ReEvaluate function. The tool will test the tool operation to see if it is still compatible. If it is, it’s state will be updated and then ReEvaluate will be called to perform an incremental update.

LxResult Blend(LXtObjectID self, LXtObjectID other, LXtObjectID blend)

  • Blend The Blend function is used to map elements generated by one actor tool operation to elements generated by another. A second tool operation is provided with alternate settings, along with an ILxToolOperation object, which can be used for marking two corresponding elements as equivalent.


class ILxToolOperation1

Public Functions

LxResult Evaluate(LXtObjectID self, LXtObjectID vts)
LxResult ReEvaluate(LXtObjectID self, LXtObjectID vts)


struct st_LXpToolSubject

The subject packet as a mesh, a vmap and the selection type to operate on.

Public Members

LXtMeshID mesh
LXtMeshMapID vmap
LXtID4 type
LXtMeshID base


struct st_LXpToolActionCenter

The action center will be mostly used by transform tools like scale and rotate. The packet is set by action center tools, like the mouse (Auto) action center tool which converts the 2D position into a 3D position.

Public Members

LXtVector v


struct st_LXpToolAxis

This packet is set by axis tools, like the Auto-Axis tool which sets the axis using a principal axis chosen by the event translation object. The axis is a unit vector which will often be along a principal axis. In this case, the ‘axIndex’ will have the index for that axis. Otherwise, axIndex will be -1. The axIndex should be treated as a hint, so a tool setting this packet should assure that a correct axis vector is set even if a principal axis is selected and the index is set. A tool reading this packet should be prepared to use the axis vector, since the index may be set to -1 even though the vector happens to lie along a principal direction. The axis vector is also the ‘forward’ vector. The ‘up’ vector is a unit vector perpendicular to the axis, which is nominally in the ‘up’ direction. The ‘right’ vector is the last vector to form the basis. The ‘m’ matrix is the matrix formed by the 3 basis vectors and ‘mInv’ is its inverse.

Public Members

LXtVector axis
LXtVector up
LXtVector right
LXtMatrix m
LXtMatrix mInv
int axIndex
int type


struct st_LXpToolXfrm

Tools may be transformed by other tools. For instance, a construction plane tool will apply the plane’s transformation to the following tools in the pipe. The construction plane tool can do that by setting the Xfrm packet matrix and position vector. Tools which set this packet may provide an inverse transform matrix, to save redundant or more difficult inversions downstream.

Public Members

LXtVector v
LXtMatrix m
LXtMatrix mInv
int flags
int handedness
unsigned int marks


The Xfrm packet flags can provide hints to tools about the state of the transform. LXiTVXFMf_OFFSET should be set if the position vector ‘v’ is non-zero. LXiTVXFMf_MATRIX should be set if the matrix is NOT the identity matrix, as an indication to tools that this transformation is necessary. LXiTVXFMf_INVERSE should be set if there is a valid inverse transform matrix in ‘mInv’. Transforms that have no bits from LXiTVXFMf_USEFUL set are identity transformations, and can be skipped.





The public versions are defined in circulardependencykludges.h, and are here for reference only. TVXFMf_OFFSET TVXFMf_MATRIX TVXFMf_INVERSE TVXFMf_USEFUL










class ILxFalloffPacket

Public Functions

double Evaluate(LXtObjectID self, LXtFVector pos, LXtPointID vrx, LXtPolygonID poly)

The falloff packet is set by falloff tools. It is a COM object with the ILxToolFalloff interface.

double Screen(LXtObjectID self, LXtObjectID vts, int x, int y)


class ILxFalloffPacket1

Public Functions

double Evaluate(LXtObjectID self, LXtFVector pos, LXtPointID vrx)
double Screen(LXtObjectID self, LXtObjectID vts, int x, int y)


class ILxSymmetryPacket

Public Functions

int Active(LXtObjectID self)

The symmetry packet provides interfaces to tools about the state of the symmetry.

  • Active This function returns the activity of the symmetry.

  • Axis This function fills the axis vector of the symmetry and the offset value, and it returns the axis number (0-2) for XYZ, otherwise 3 for arbitrary axis.

  • Point This function returns the symmetric vertex for the given vertex. If there is none, null is returned.

  • Polygon This function returns the symmetric polygon for the given polygon. If there is none, null is returned.

  • Edge This function returns the symmetric edge for the given edge. If there is none, null is returned.

  • Position This function takes any position and fills the symmetric position. If the position is on the symmetric plane, it returns zero, otherwise nonzero.

int Axis(LXtObjectID self, LXtFVector axvec, float *offset)
LXtPointID Point(LXtObjectID self, LXtMeshID mesh, LXtPointID vrx)
LXtPolygonID Polygon(LXtObjectID self, LXtMeshID mesh, LXtPolygonID pol)
LXtEdgeID Edge(LXtObjectID self, LXtMeshID mesh, LXtEdgeID edge)
int Position(LXtObjectID self, const LXtFVector pos, LXtFVector sv)
int BaseSide(LXtObjectID self)
void SetBase(LXtObjectID self, const LXtFVector pos)
int TestSide(LXtObjectID self, const LXtFVector pos, int useBase)


class ILxSubject2Packet

Public Functions

LxResult ScanAllocate(LXtObjectID self, unsigned flags, void **ppvObj)

The subject packet provides a wrapper around the layer service, allowing a layer scan object to be allocated for accessing geometry.

  • ScanAllocate This function allocates a layer scan object, which can be used for accessing and enumerating meshes in the scene. The flags passed to the flag argument should be the same as the flags passed to the ScanAllocate function in the Layer Service.

  • Type This function returns the current selection type.

LXtID4 Type(LXtObjectID self)
bool BeginScan(unsigned int flags, CLxLocalizedObject &scan)

User Class Only:


class ILxTexturePacket

Public Functions

LxResult Evaluate(LXtObjectID self, LXtFVector pos, LXtPointID vrx, LXtPolygonID pol, int context, double *res)

The texture packet is similar to the falloff packet. It does essentially the same thing which is to compute a value given a 3D position/mesh elemement. The difference with the falloff packet is that the texture packet may compute different data types: scalar, color or vectors, unlike the falloff function which only returns scalar values.


class ILxElementAxisPacket

Public Functions

LxResult Axis(LXtObjectID self, LXtPointID vrx, LXtFVector axis, LXtMatrix m, LXtMatrix mInv)

Elements are groups of vertices (or polygons) linked by virtue of their interconnections. The element axis packet has one method to compute the local axis given the mesh and one vertex in the element. For faster updates, the method also precomputes the direct and inverse transformation matrices.


class ILxElementCenterPacket

Public Functions

LxResult Center(LXtObjectID self, LXtPointID vrx, LXtFVector center)

Likewise, the element center packet compute the element center given the mesh and a vertex in the element.


class ILxPathGeneratorPacket

  • Bank Returns the bank angle at the given parameter value.

Public Functions

LxResult Value(LXtObjectID self, LXtObjectID vts, double t, LXtVector pos)

A path generator packet delivers access to a continuous path through 3D space defined by a parametric curve. For some paths, the tangents may not be continuous. The curve implementation is not exposed. Instead the position in 3D along the path at a given parameter value is returned by the “Value” method.

double Length(LXtObjectID self, LXtObjectID vts, double t0, double t1)

  • Value Evaluates curve at parameter value ‘t’ (0 <= t <= 1), putting the results in ‘pos’. It is often useful to get things like the path length, or the tangent at a given point. Since some implementations can deliver these quantities without doing annoying numerical derivatives (or integrals?), the path packet will handle these calculations internally, and provide simple access.

LxResult Tangent(LXtObjectID self, LXtObjectID vts, double t, double *tan)
LXtPolygonID Source(LXtObjectID self, LXtObjectID vts)
int Count(LXtObjectID self, LXtObjectID vts)
LxResult Knot(LXtObjectID self, LXtObjectID vts, int index, LXtPathKnot *knot)
int Current(LXtObjectID self, LXtObjectID vts)
LxResult KnotDataSet(LXtObjectID self, LXtObjectID gen)

  • Count Returns the number of nodes in the path. It will return 0 for an uninitialized or empty sequence, or a synthetic, continuous path which happens to have no nodes. A synthetic path with discontuities should have the courtesy to mark them with nodes.

  • Knot Fills in the LXtPathKnot for the knot at ‘index’.

  • Current Returns the index of the ‘current’ knot, or -1 if there is none. This will allow downstream tools to build lists of extra per-knot data, and display/edit the appropriate values in the UI. For many applications, a downstream client tool of the path generator will want to attach some data to the each knot. Because the knots are created and destroyed by undoable actions, maintaining that data would be difficult for a client. Adding an optional client-defined bit of encapsulated data (baggage) should help. The interface for this is the ILxBagGenerator which clients will provide to create, copy and release their custom data.

int Walk(LXtObjectID self, LXtObjectID vts, LXtObjectID pathStep, double angle, double ti, double tf)
double Bank(LXtObjectID self, LXtObjectID vts, double t)


struct st_LXtPathKnot

Most paths are defined by a series of control points (knots). These knots are characterized by a position, a parameter value on the path, some tangents, and flags which tell, among other things, wether the tangents are continuous. It is expected that all discontinuities in a path are represented by knots.

Public Members

LXtFVector position
LXtFVector tanIn
LXtFVector tanOut
int flags
void *clientData
double bank


The flags determine if the tangents are equal or not.


class ILxBagGenerator

  • Generate This method allocates new client data. For convenience some node-specific data may be passed in to the generator. If the cloneMe pointer is non-NULL, it is assumed to point to suitable client data, and it will be copied into the new bag exactly.

  • Dispose This frees the bag and its contents.

Public Functions

void *Generate(LXtObjectID self, void *data, void *cloneMe)

  • KnotDataSet This function sets the optional per-knot data generator. Use it to set the value of the LXtPathKnot clientData element. The Bag generator interface is a simple way for clients to attach data to dynamic objects like path nodes. The ‘bag’ pointer returned by Generate() should be passed to Dispose() when it is no longer needed.

void Dispose(LXtObjectID self, void *data)


class ILxPathStep

Public Functions

void Setup(LXtObjectID self)

In many cases, travelling the along path can also be done more efficiently internally. The Path Generator thus provides a method for scanning the entire curve with a client-supplied ILxPathStep.

int Step(LXtObjectID self, double t, LXtVector pos)

The step function can end the walk at any time by returning a non-zero value.

void CleanUp(LXtObjectID self)




typedef void PathWalkerFunc(void *data, double t, LXtVector pos)

For convenience, a basic implementation of the ILxPathStep interface is provided. It will call a client callback at each step. The callback must be in this not unfamiliar form:


struct st_LXtPGenParticle

A particle generator object manages an ordered sequence of particles, or transforms, each defined by its own position, rotation and scale. While the scale and orientation could be combined in a single matrix, they will be preserved separately for the convenience of working with orthonormal matrices. A

Public Members

LXtFVector position
LXtFVector scale
LXtMatrix orientation
int flags






class ILxParticleGeneratorPacket

  • InitialParticleSet Set the initial state of the particle generator. The state of particle supplied will be copied and used as the 0th particle.

  • HintBoxSet This is an optional method for InitialParticleSet. Set the bounding box and the initial orientation when it defines the initial particle.

  • InitialParticleSetFromMesh Set the initial state of the particle generator. The state of particle supplied will be copied and used as the 0th particle. This version will use the supplied mesh instead of scanning global layers.

Public Functions

int Count(LXtObjectID self, LXtObjectID vts)
LxResult Particle(LXtObjectID self, LXtObjectID vts, int index, LXtPGenParticle *part)
LxResult InitialParticleSet(LXtObjectID self, const LXtPGenParticle *part)

  • Count Returns the number of particles in the sequence. It will return 0 for an uninitialized or empty sequence, or 1 if only the InitialParticleSet method has been used to set initial conditions for the generator.

  • Particle Fills in the LXtPGenParticleID for the particle at ‘index’. The generator has to be responsive to the requirements of the effector. For example, the sweep effector which is the “bit” for the lathe and extrude tool composites has to be able to provide the generator with a start location. This allows the radial generator to put its first particle at the location of the source data, and have the other particles spiral out from there.

LxResult HintBoxSet(LXtObjectID self, const LXtBBox *box, const LXtVector orient, const LXtPGenParticle *part)


class ILxParticleGeneratorPacket1

Public Functions

int Count(LXtObjectID self, LXtObjectID vts)

This packet interface has been deprecated and replaced by ILxParticleGeneratorPacket.

LxResult Particle(LXtObjectID self, LXtObjectID vts, int index, LXtPGenParticle *part)
LxResult InitialParticleSet(LXtObjectID self, const LXtPGenParticle *part)
LxResult HintBoxSet(LXtObjectID self, const LXtBBox *box, const LXtPGenParticle *part)


struct st_LXpToolContent

The Preset Content Packet holds the name, type and commonly used attributes for content preset files. It should be written to be TASK_CONT type tools, and read-only for tools downstream. The flags are used for boolean attributes, and may be interpreted differently for each type of content.

Public Members

const char *path
const char *type
double scale
LXtVector axis
LXtVector offset
int axIndex
int flags
void *data
char pathBuffer[1024]
char typeBuffer[64]


struct st_LXpToolStyle

This packet holds common style attributes for vector composition elements.

Public Members

float lineWidth
LXtFVector lineColor
float lineAlpha
int lineDashType
unsigned lineDashPattern
int lineFlags
int lineCap
int lineJoin
float lineMiterLimit
LXtFVector fillColor
float fillAlpha
float fillHeight
const char *fillType
const char *fillParams
int fillFlags


Tool flags are used for the enable, visibility and hauling states. Additional bits describe a tool which will be automatically activated.