Mesh

ILxMeshService

class ILxMeshService

The mesh service provides high-level mesh system access. These methods are provided as general services that could be useful on any mesh.

Public Functions

LxResult ScriptQuery(LXtObjectID self, void **ppvObj)
LxResult ModeCompose(LXtObjectID self, const char *set, const char *clear, LXtMarkMode *mode)

This method allows multiple mode bits to be marked as “must be set” or “must be cleared”. The two arguments take a space-delimited list of modes to set or clear, failing with LXe_NOTFOUND if the mode is unknown. Either argument can be NULL.

LxResult VMapLookupType(LXtObjectID self, const char *name, LXtID4 *type)

Vertex map types have names and codes which can be translated with these functions.

LxResult VMapLookupName(LXtObjectID self, LXtID4 type, const char **name)
LxResult VMapDimension(LXtObjectID self, LXtID4 type, unsigned int *dimension)

It can also be useful to find the features of a vertex map type without requiring an actual instance. These functions are equivalent to the same-named functions in the mesh map interface.

LxResult VMapIsEdgeMap(LXtObjectID self, LXtID4 type)
LxResult VMapIsContinuous(LXtObjectID self, LXtID4 type)
LxResult VMapZeroDefault(LXtObjectID self, LXtID4 type)
LxResult CreateMesh(LXtObjectID self, void **ppvObj)

Clients can create their own private mesh objects, not affiliated with any item.

LxResult ConvertMesh(LXtObjectID self, LXtObjectID triGroupObj, LXtObjectID meshObj)

This converts a private mesh to a static mesh.

LxResult MeshFromMeshID(LXtObjectID self, LXtMeshID meshID, void **ppvObj)

Some of the tool packets still use the obsolete LXtMeshID type. These functions allow you to convert between mesh IDs and mesh objects. These functions should be used carefully since they’re not very safe. That’s why the LXtMeshID was retired in the first place.

LXtMeshID MeshToMeshID(LXtObjectID self, LXtObjectID mesh)
LxResult SurfaceToTriGroup(LXtObjectID self, LXtObjectID triGroupObj, LXtObjectID surfObj)

This converts any surface to a static mesh.

LxResult MeshFromTriGroup(LXtObjectID self, LXtObjectID meshObj, LXtObjectID triGroupObj)

This converts a static mesh to an editable mesh.

LxResult TriGroupTransform(LXtObjectID self, LXtObjectID triGroupObj, LXtMatrix4 xfrm)

Static meshes can be rigidly transformed.

LxResult CreateSlice(LXtObjectID self, void **ppvObj)

Creates a ILxPolygonSlice object which slices polygons.

LxResult CreateSolidDrill(LXtObjectID self, void **ppvObj)

Creates a ILxSolidDrill object which slices polygons.

LxResult IsMeshProcedural(LXtObjectID self, LXtObjectID item)

This returns LXe_TRUE if the specified mesh item is procedural and LXe_FALSE if it isn’t.

LxResult ItemFromMesh(LXtObjectID self, LXtObjectID mesh, void **ppvObj)

Returns an Item object that a mesh belongs to. For private meshes, the function fails.

LxResult CurveGroupFromMesh(LXtObjectID self, LXtObjectID mesh, const LXtMatrix4 xfrm, void **ppvObj)

Returns a curve group for the provided mesh, allowing the polygonal curves to be enumerated and evaluated.

LxResult MeshFromSurface(LXtObjectID self, LXtObjectID meshObj, LXtObjectID surfItem, LXtObjectID surfObj)

Returns a mesh from a surface interface.

LxResult SurfaceFromMesh(LXtObjectID self, LXtObjectID mesh, LXtObjectID meshItem, void **ppvObj)

Returns a surface from a mesh. In the majority of cases, the mesh item can be evaluated directly for a surface. However if you have a private mesh, this function can be used.

LxResult ValidateMetaData(LXtObjectID self, LXtObjectID mesh, const char *name, void **ppvObj)

Validates and returns the named mesh meta for the provided mesh.

LxResult Tessellate(LXtObjectID self, LXtObjectID meshTess, LXtObjectID meshSource, const LXtMatrix4 xfrm, unsigned int flags)

Returns a tessellated mesh from source mesh. ‘xfrm’ transform new vertex position as option. if COPYFACE is set then it copies raw face polygons without subdivision, otherwise FACE polygons are tessellated to triangles. Subdivision surface polygons are tessellated to quadrangles. if TRIPLE is set, subdivision surface are tesselated to triangles instead of quadrangles.

LXtMarkMode SetMode(const char *set)

User Class Only: The user class has a couple of methods to get modes that just set and clear.

LXtMarkMode ClearMode(const char *clr)
bool NewMesh(CLxLoc_Mesh &mesh)

User Class Only:

bool NewSolidDrill(CLxLoc_SolidDrill &drill)

User Class Only:

bool GetMeshItem(ILxUnknownID mesh, CLxLoc_Item &item)

User Class Only:

typedef unsigned int LXtMarkMode

Mark modes are collections of bits of two types: the ones required to be set and ones required to be clear. To be specific, this is not simply turning a bit on or off; a bit can be required to be set or can be required to be clear based on the mark mode. The mesh service allows mark mode masks to be created and read via strings. The mode which matches anything (and changes nothing) is always just zero.

  • LXiMARK_ANY

  • LXsMARK_HIDE

  • LXsMARK_HALO

  • LXsMARK_LOCK

  • LXsMARK_SELECT

  • LXsMARK_DELTA

  • LXsMARK_USER_0

  • LXsMARK_USER_1

  • LXsMARK_USER_2

  • LXsMARK_USER_3

  • LXsMARK_USER_4

  • LXsMARK_USER_5

  • LXsMARK_USER_6

  • LXsMARK_USER_7


LX_DEF_LXTMESHID

Defined here and in lxmeshOLD, protected because of gcc whining.

  • LXf_TESS_TRIPLE

  • LXf_TESS_COPYFACE

  • LXsTYPE_MESH

ILxMesh

class ILxMesh

The mesh service provides high-level mesh system access. These methods are provided as general services that could be useful on any mesh.

Public Functions

LxResult PointCount(LXtObjectID self, unsigned int *count)

These methods return the number of elements of their type in the mesh.

LxResult PolygonCount(LXtObjectID self, unsigned int *count)
LxResult EdgeCount(LXtObjectID self, unsigned int *count)
LxResult MapCount(LXtObjectID self, unsigned int *count)
LxResult BoundingBox(LXtObjectID self, LXtMarkMode pick, LXtBBox *bbox)

This method returns the bounding box of the mesh.

LxResult MaxPointPolygons(LXtObjectID self, LXtMarkMode pick, unsigned int *count)

This method returns the maximum number of polygons shared by any point in the mesh.

LxResult MaxPolygonSize(LXtObjectID self, LXtMarkMode pick, unsigned int *count)

This method returns the maximum size of any polygon marked in the mesh.

LxResult PolyTagSetDefault(LXtObjectID self, LXtID4 type, const char *tag)

Sets the the value of the specified tag that will be applied to any newly created polys.

LxResult PointAccessor(LXtObjectID self, void **ppvObj)

Most data about a mesh is obtained through the accessors. These methods return new accessors, which must be released by the client when no longer needed. Multiple accessors can exist at the same time for the same mesh without conflicting. Accessors can be used to walk the list of elements in a mesh or to obtain specific information about a particular element. These methods create and return the various accessors. Each one is unique to the caller can so can be used in parallel with others obtained from these methods.

LxResult PolygonAccessor(LXtObjectID self, void **ppvObj)
LxResult EdgeAccessor(LXtObjectID self, void **ppvObj)
LxResult MeshMapAccessor(LXtObjectID self, void **ppvObj)
LxResult SetMeshEdits(LXtObjectID self, unsigned int edits)

If a mesh is accessed for write, any edits made have to be signalled back to the mesh.

LxResult SUBDGetLevel(LXtObjectID self, int *n)

Polygon types can have overall settings that affect all the polygons of that type in the mesh. Set and get SUBD subdivision level for the mesh.

LxResult SUBDSetLevel(LXtObjectID self, int n)
LxResult SUBDGetLinearUV(LXtObjectID self, int *isLinear)

Set and get SUBD UV interpolation flag.

LxResult SUBDSetLinearUV(LXtObjectID self, int isLinear)
LxResult PSUBGetBoundRule(LXtObjectID self, int *bound)
LxResult PSUBSetBoundRule(LXtObjectID self, int bound)
LxResult TestSameMesh(LXtObjectID self, LXtObjectID other)

Give a mesh interface and another mesh object, this returns true if they refer to the same actual mesh.

unsigned PTagCount(LXtObjectID self, LXtID4 type)

These methods separate contents of a PICK ptag into component selection sets, presenting a list of the distinct selection sets, rather than the large and redundant list of all distinct PICK poly tag values.

LxResult PTagByIndex(LXtObjectID self, LXtID4 type, unsigned index, const char **tag)
LxResult PSUBGetLevel(LXtObjectID self, int *n)

Set and get PSUB subdivision level for the mesh.

LxResult PSUBSetLevel(LXtObjectID self, int n)
LxResult PSUBGetCurrentLevel(LXtObjectID self, int *n)

Set and get PSUB subdivision level for the mesh.

LxResult PSUBSetCurrentLevel(LXtObjectID self, int n)
LxResult PSUBSetSubdivObj(LXtObjectID self, LXtObjectID subObj)
LxResult ChangeEvent(LXtObjectID self, unsigned event)
LxResult PSUBDispNumLayer(LXtObjectID self, int *num)

Multi-Resolution layers are new displacement data for 901. Displpacement vectors in layers are composited based on the opacity ratio. This method returns number of multi-resolution layer.

const char *PSUBDispLayerName(LXtObjectID self, int index)

This method returns name of multi-resolution layer for given layer index.

LxResult PSUBDispLayerLookupByName(LXtObjectID self, const char *name, int *index)

This method look up multi-resolution layer by layer name and set the index and retruns OK if it is found.

LxResult PSUBDispLayerCurrent(LXtObjectID self, int *index)

This method returns the current selected multi-resolution layer. index.

LxResult PSUBDispLayerEnable(LXtObjectID self, int index, int *enable)

This method returns the enable state of multi-resolution layer for given layer index.

LxResult PSUBDispLayerOpacity(LXtObjectID self, int index, double *opacity)

This method returns the opacity of multi-resolution layer for given layer index.

LxResult PSUBDispLayerSetOpacity(LXtObjectID self, int index, double opacity)

This method set the opacity of multi-resolution layer for given layer index. This is not undoable action.

LxResult BeginEditBatch(LXtObjectID self)

If multiple operations need to be batched together, this function will start and end a mesh edit batch on the specified mesh.

LxResult EndEditBatch(LXtObjectID self)
LxResult Merge(LXtObjectID self, LXtObjectID other, unsigned int flags)
LxResult Clear(LXtObjectID self)

This removes all data in the current mesh.

LxResult TrackChanges(LXtObjectID self, void **ppvObj)

Often, it can be useful to track multiple changes to a mesh within a particular time period. The TrackChanges function returns an ILxMeshTracker interface. The MeshTracker will collect a series of changes to a base mesh, along with a list of modified points and polygons. Multiple trackers can be created per mesh, each with their own lifetime, independent of the mesh.

LxResult MergeWithTransform(LXtObjectID self, LXtObjectID other, const LXtMatrix4 xfrm, unsigned int flags)

This merges the provided mesh with the current mesh, copying all the data from other. The flags argument controls which elements are copied from the source mesh to the target mesh. A matrix can also be provided to apply as transform to all merged elements.

int NPoints() const

User Class Only: User class variants gets the counts directly, with minimal checking.

int NPolygons() const
int NEdges() const
int NMaps() const
bool GetPoints(CLxLoc_Point &acc)

User Class Only: User class methods allocate directly into the user classes for the accessors.

bool GetPolygons(CLxLoc_Polygon &acc)
bool GetEdges(CLxLoc_Edge &acc)
bool GetMaps(CLxLoc_MeshMap &acc)
bool IsSame(ILxUnknownID other)

User Class Only:

  • LXf_MESHEDIT_POSITION

  • LXf_MESHEDIT_POINTS

  • LXf_MESHEDIT_POLYGONS

  • LXf_MESHEDIT_GEOMETRY

  • LXf_MESHEDIT_POL_TAGS

  • LXf_MESHEDIT_POL_TYPE

  • LXf_MESHEDIT_MAP_CONTINUITY

  • LXf_MESHEDIT_MAP_UV

  • LXf_MESHEDIT_MAP_MORPH

  • LXf_MESHEDIT_MAP_OTHER

  • LXf_MESHEDIT_UPDATE

  • LXf_MESHEDIT_DELTA


LXiPSUB_BOUND_SMOOTH

Set and get PSUB boundary rules. They are mapped to “smooth”, “crease all” and “crease edges” in definitions of prman.

  • LXiPSUB_BOUND_CREASE

  • LXiPSUB_BOUND_CREASEEDGES


LXf_MESHMERGE_PTAG

This merges the provided mesh with the current mesh, copying all the data from other. The flags argument controls which elements are copied from the source mesh to the target mesh.

  • LXf_MESHMERGE_VMAP_MORPH

  • LXf_MESHMERGE_VMAP_NORMAL

  • LXf_MESHMERGE_VMAP_UV

  • LXf_MESHMERGE_VMAP_WEIGHT

  • LXf_MESHMERGE_VMAP_COLOR

  • LXf_MESHMERGE_MARK

  • LXf_MESHMERGE_TRANSFORM

  • LXf_MESHMERGE_SELECTIONSET

  • LXf_MESHMERGE_VMAP_OTHERS

  • LXf_MESHMERGE_VMAP

  • LXf_MESHMERGE_POLY_FACE

  • LXf_MESHMERGE_POLY_CURVE

  • LXf_MESHMERGE_POLY_BEZIER

  • LXf_MESHMERGE_POLY_SUBD

  • LXf_MESHMERGE_POLY_SPCH

  • LXf_MESHMERGE_POLY_TEXT

  • LXf_MESHMERGE_POLY_PSUB

  • LXf_MESHMERGE_POLY_LINE

  • LXf_MESHMERGE_POLY_CRVFIL

  • LXf_MESHMERGE_POLY_BSPLINE

  • LXf_MESHMERGE_POLY_OPNT

  • LXm_MESHMERGE_POLY

  • LXm_MESHMERGE_POLY_ALL

  • LXf_MESHMERGE_ALL

ILxMesh1

class ILxMesh1

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

Public Functions

LxResult PointCount(LXtObjectID self, unsigned int *count)
LxResult PolygonCount(LXtObjectID self, unsigned int *count)
LxResult EdgeCount(LXtObjectID self, unsigned int *count)
LxResult MapCount(LXtObjectID self, unsigned int *count)
LxResult BoundingBox(LXtObjectID self, LXtMarkMode pick, LXtBBox *bbox)
LxResult MaxPointPolygons(LXtObjectID self, LXtMarkMode pick, unsigned int *count)
LxResult MaxPolygonSize(LXtObjectID self, LXtMarkMode pick, unsigned int *count)
LxResult PolyTagSetDefault(LXtObjectID self, LXtID4 type, const char *tag)
LxResult PointAccessor(LXtObjectID self, void **ppvObj)
LxResult PolygonAccessor(LXtObjectID self, void **ppvObj)
LxResult EdgeAccessor(LXtObjectID self, void **ppvObj)
LxResult MeshMapAccessor(LXtObjectID self, void **ppvObj)
LxResult SetMeshEdits(LXtObjectID self, unsigned int edits)
LxResult SUBDGetLevel(LXtObjectID self, int *n)
LxResult SUBDSetLevel(LXtObjectID self, int n)
LxResult SUBDGetLinearUV(LXtObjectID self, int *isLinear)
LxResult SUBDSetLinearUV(LXtObjectID self, int isLinear)
LxResult PSUBGetBoundRule(LXtObjectID self, int *bound)
LxResult PSUBSetBoundRule(LXtObjectID self, int bound)
LxResult TestSameMesh(LXtObjectID self, LXtObjectID other)
unsigned PTagCount(LXtObjectID self, LXtID4 type)
LxResult PTagByIndex(LXtObjectID self, LXtID4 type, unsigned index, const char **tag)
LxResult PSUBGetLevel(LXtObjectID self, int *n)
LxResult PSUBSetLevel(LXtObjectID self, int n)
LxResult PSUBGetCurrentLevel(LXtObjectID self, int *n)
LxResult PSUBSetCurrentLevel(LXtObjectID self, int n)
LxResult PSUBSetSubdivObj(LXtObjectID self, LXtObjectID subObj)
LxResult ChangeEvent(LXtObjectID self, unsigned event)
LxResult PSUBDispNumLayer(LXtObjectID self, int *num)
const char *PSUBDispLayerName(LXtObjectID self, int index)
LxResult PSUBDispLayerLookupByName(LXtObjectID self, const char *name, int *index)
LxResult PSUBDispLayerCurrent(LXtObjectID self, int *index)
LxResult PSUBDispLayerEnable(LXtObjectID self, int index, int *enable)
LxResult PSUBDispLayerOpacity(LXtObjectID self, int index, double *opacity)
LxResult PSUBDispLayerSetOpacity(LXtObjectID self, int index, double opacity)
LxResult BeginEditBatch(LXtObjectID self)
LxResult EndEditBatch(LXtObjectID self)
LxResult Merge(LXtObjectID self, LXtObjectID other)
LxResult Clear(LXtObjectID self)

ILxMesh2

class ILxMesh2

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

Public Functions

LxResult PointCount(LXtObjectID self, unsigned int *count)
LxResult PolygonCount(LXtObjectID self, unsigned int *count)
LxResult EdgeCount(LXtObjectID self, unsigned int *count)
LxResult MapCount(LXtObjectID self, unsigned int *count)
LxResult BoundingBox(LXtObjectID self, LXtMarkMode pick, LXtBBox *bbox)
LxResult MaxPointPolygons(LXtObjectID self, LXtMarkMode pick, unsigned int *count)
LxResult MaxPolygonSize(LXtObjectID self, LXtMarkMode pick, unsigned int *count)
LxResult PolyTagSetDefault(LXtObjectID self, LXtID4 type, const char *tag)
LxResult PointAccessor(LXtObjectID self, void **ppvObj)
LxResult PolygonAccessor(LXtObjectID self, void **ppvObj)
LxResult EdgeAccessor(LXtObjectID self, void **ppvObj)
LxResult MeshMapAccessor(LXtObjectID self, void **ppvObj)
LxResult SetMeshEdits(LXtObjectID self, unsigned int edits)
LxResult SUBDGetLevel(LXtObjectID self, int *n)
LxResult SUBDSetLevel(LXtObjectID self, int n)
LxResult SUBDGetLinearUV(LXtObjectID self, int *isLinear)
LxResult SUBDSetLinearUV(LXtObjectID self, int isLinear)
LxResult PSUBGetBoundRule(LXtObjectID self, int *bound)
LxResult PSUBSetBoundRule(LXtObjectID self, int bound)
LxResult TestSameMesh(LXtObjectID self, LXtObjectID other)
unsigned PTagCount(LXtObjectID self, LXtID4 type)
LxResult PTagByIndex(LXtObjectID self, LXtID4 type, unsigned index, const char **tag)
LxResult PSUBGetLevel(LXtObjectID self, int *n)
LxResult PSUBSetLevel(LXtObjectID self, int n)
LxResult PSUBGetCurrentLevel(LXtObjectID self, int *n)
LxResult PSUBSetCurrentLevel(LXtObjectID self, int n)
LxResult BeginEditBatch(LXtObjectID self)
LxResult EndEditBatch(LXtObjectID self)

ILxPoint

class ILxPoint

The ILxPoint is a combination of an accessor for specific points, as well as providing a mechanism to walk the mesh’s point list.

Public Functions

LxResult Spawn(LXtObjectID self, void **ppvObj)

As mentioned previously, all accessors share common interface methods for walking their respective lists.

LxResult Enumerate(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, LXtObjectID monitor)
LxResult TestMarks(LXtObjectID self, LXtMarkMode mode)
LxResult SetMarks(LXtObjectID self, LXtMarkMode set)
LxResult Select(LXtObjectID self, LXtPointID point)

This method sets the accessor to the given point. Only points that are known to be in the mesh should be passed to this method.

LxResult SelectByIndex(LXtObjectID self, unsigned int index)

A point can be selected by its index in the mesh.

LxResult SelectPolygonVertex(LXtObjectID self, LXtPolygonID polygon, unsigned int index)

A point can also be selected by its index within a polygon.

LXtPointID ID(LXtObjectID self)

This methods returns the ID of the curent point or null if none.

LxResult Index(LXtObjectID self, unsigned int *index)

This methods returns the index of the curent point.

LxResult Pos(LXtObjectID self, LXtFVector pos)

This returns the position of the point.

LxResult Normal(LXtObjectID self, LXtPolygonID pol, LXtVector normal)

This method returns the geometric normal of this point for the given polygon. This is the average of the connected polyon normals if the polygon is null.

LxResult MapValue(LXtObjectID self, LXtMeshMapID map, float *value)

This returns the value of the current point in the given map. This returns LXe_FALSE for points with no value set in the map.

LxResult MapEvaluate(LXtObjectID self, LXtMeshMapID map, float *value)

This method is the same as MapValue(), except that if the point is not in the map it will return zero for maps that allow that.

LxResult PolygonCount(LXtObjectID self, unsigned int *count)

These methods return the number of polygons sharing this point as a vertex, and get the polygon ID for a specific index.

LxResult PolygonByIndex(LXtObjectID self, unsigned int index, LXtPolygonID *polygonID)
LxResult New(LXtObjectID self, const LXtVector pos, LXtPointID *pointID)

This creates a new point in the mesh. It sets the current point to the new point.

LxResult Copy(LXtObjectID self, LXtPointID *pointID)

This creates a new point in the mesh duplicating the current point. If this point has already been copied this function returns the same pointer.

LxResult Remove(LXtObjectID self)

This removes a point from the mesh. Any polygons that use this point should already have been altered to remove the point from their vertex list. Maps are automatically updated to reflect the removed point.

LxResult SetPos(LXtObjectID self, const LXtVector pos)

This sets a point’s position.

LxResult SetMapValue(LXtObjectID self, LXtMeshMapID map, const float *value)

This sets the value for the point in the given map.

LxResult ClearMapValue(LXtObjectID self, LXtMeshMapID map)

This removes any value for the point in the given map.

LxResult Corner(LXtObjectID self, LXtFVector pos)

The corner control point for a vertex can also be accessed. This is the location of the actual intersection of the patch mesh.

LxResult PointCount(LXtObjectID self, unsigned int *count)

These methods return the number of points connecting this point as a point, and get the point ID for a specific index.

LxResult PointByIndex(LXtObjectID self, unsigned int index, LXtPointID *pointID)
LxResult EdgeCount(LXtObjectID self, unsigned int *count)

These methods return the number of edges connecting this point as a point, and get the edge ID for a specific index.

LxResult EdgeByIndex(LXtObjectID self, unsigned int index, LXtEdgeID *edgeID)
LxResult Symmetry(LXtObjectID self, LXtPointID *pointID)

This sets the symmetric point corresponding to the current point when the symmetry mode is enabled. This returns LXe_OK when the symmetric point is found, otherwise it returns LXe_FAILED. When the current point is on the symmetry center plane, it returns LXe_FAILED.

LxResult OnSymmetryCenter(LXtObjectID self)

This returns LXe_TRUE if the symmetry state is enabled and the current point is on the symmetry center plane, otherwise it returns LXe_FALSE.

LxResult Mesh(LXtObjectID self, void **ppvObj)

This function returns the ILxMesh object associated with the point accessor.

LxResult Part(LXtObjectID self, unsigned int *part)

This function returns the part number for the current point. All connected points share the same part number.

CLxUser_Point(CLxLoc_Mesh &mesh)

User Class Only:

bool fromMesh(CLxLoc_Mesh &mesh)
bool fromMeshObj(ILxUnknownID obj)
bool duplicate(CLxLoc_Point &acc)
bool Test(LXtMarkMode mode)
LxResult Enum(CLxImpl_AbstractVisitor *visitor, LXtMarkMode mode = LXiMARK_ANY, ILxUnknownID mon = 0)

ILxPolygon

class ILxPolygon

The ILxPolygon is used to obtain information about specific polygons, as well as allowing the list of polygons to be walked.

Public Functions

LxResult Spawn(LXtObjectID self, void **ppvObj)

As mentioned previously, all accessors share common interface methods for walking their respective lists.

LxResult Enumerate(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, LXtObjectID monitor)
LxResult TestMarks(LXtObjectID self, LXtMarkMode mode)
LxResult SetMarks(LXtObjectID self, LXtMarkMode set)
LxResult Select(LXtObjectID self, LXtPolygonID polygon)

This method sets the accessor to the given polygon.

LxResult SelectByIndex(LXtObjectID self, unsigned int index)
LXtPolygonID ID(LXtObjectID self)

This method returns the ID of the current polygon.

LxResult Index(LXtObjectID self, int *index)

This methods returns the index of the curent polygon.

LxResult Type(LXtObjectID self, LXtID4 *type)

This returns the type of the polygon.

LxResult VertexCount(LXtObjectID self, unsigned int *count)

These return the number of vertices in the polygon, and get the point ID’s by index.

LxResult VertexByIndex(LXtObjectID self, unsigned int index, LXtPointID *point)
LxResult FirstIsControlEndpoint(LXtObjectID self)

There are two special polygon flags, which are used by curves. The first method returns LXe_TRUE if the first point on is an extended control point, while the second returns true if the last point is a control point. If the polygon is not a curve, this method fails.

LxResult LastIsControlEndpoint(LXtObjectID self)
LxResult Normal(LXtObjectID self, LXtVector normal)

This method returns the geometric normal of this polygon. This fails if there is no normal or the polygon has only one or two points. The normal is the same as the normal for the triangle containing the first point.

LxResult MapValue(LXtObjectID self, LXtMeshMapID map, LXtPointID point, float *value)

This method gets the map value of a specific point in this polygon given a map. It returns LXe_FALSE if the specific is unmapped.

LxResult MapEvaluate(LXtObjectID self, LXtMeshMapID map, LXtPointID point, float *value)

Evaluating the map first tries to find a discontinuous value specific to this polygon. If there is none it falls back on the continuous value for the point itself. Failing that it may return zero for a map that allows that.

LxResult Area(LXtObjectID self, double *area)

This function returns the approximate surface area of the current polygon.

LxResult New(LXtObjectID self, LXtID4 type, const LXtPointID *vertices, unsigned int numVert, unsigned int rev, LXtPolygonID *polygonID)

This method creates a new polygon of the given type from a prepared list of point IDs. If ‘rev’ is true, the point list will be used in reverse.

LxResult NewProto(LXtObjectID self, LXtID4 type, const LXtPointID *vertices, unsigned int numVert, unsigned int rev, LXtPolygonID *polygonID)

This method is the same as New(), but it copies the tags from the current polygon which is used as a prototype. Type can also be zero to copy the polygon type from the prototype.

LxResult Remove(LXtObjectID self)

This removes a polygon from the mesh.

LxResult SetFirstIsControlEndpoint(LXtObjectID self, int state)

These set if the first or last endpoints of a curve are control points, failing if this is not a curve-type polygon.

LxResult SetLastIsControlEndpoint(LXtObjectID self, int state)
LxResult SetVertexList(LXtObjectID self, const LXtPointID *vertices, unsigned int numVert, unsigned int rev)

This method allows the vertex list of a polygon to be changed.

LxResult SetMapValue(LXtObjectID self, LXtPointID point, LXtMeshMapID map, const float *value)

This sets the value in the given point map for a point/polygon pair. The number of elements in the ‘value’ array should match the dimension of the map.

LxResult ClearMapValue(LXtObjectID self, LXtPointID point, LXtMeshMapID map)

This removes any value for the point/polygon pair in the given map.

LxResult StartContour(LXtObjectID self)

Polygons can also be created from a contour. A contour defines a path that can consist of multiple closed loops with reversed loops inside that act as holes. this call starts a contour.

LxResult AddContourEdge(LXtObjectID self, LXtPointID startPt, LXtPointID endPt)

This call adds an edge to the contour. Edges must form a set of closed loops.

LxResult GenerateContour(LXtObjectID self, LXtID4 type, LXtPolygonID *polygonID)

When all the contour edges are added, this adds a set of polygons describing the same surface as the closed contour. Since multiple polygons may be added this only returns the new polygon ID if there was only one. Multiple polygons must be inferred some other way.

LxResult GenerateContourProto(LXtObjectID self, LXtPolygonID *polygonID)

This is the same but uses the current polygon as prototype for all the new polygons to be created from the contour.

LxResult IntersectRay(LXtObjectID self, const LXtVector pos, const LXtVector dir, LXtVector hitNorm, double *hitDist)

This method traces a ray with a given start position and direction (normalized). If the ray intersects a polygon it sets the current polygon, sets the distance to the hit point and the surface normal, and returns LXe_TRUE. It returns LXe_FALSE if there are no polygons in the path of the ray.

LxResult Closest(LXtObjectID self, double maxDist, const LXtVector pos, LXtVector hitPos, LXtVector hitNorm, double *hitDist)

This method finds the closest polygon from the given position. If it finds a polygon, it sets the current polygon, the hit position, the distance to the hit position and the surface normal, and returns LXe_TRUE. It returns LXe_FALSE if there are no polygons. If ‘maxDist’ is set, the method finds polygons in the radius given by ‘maxDist’ from the given position.

LxResult PointIndex(LXtObjectID self, LXtPointID pointID, unsigned int *index)

This returns the index of the point on the polygon. It return -1 if the given point is not belong to the polygon.

LxResult EdgeIndex(LXtObjectID self, LXtEdgeID edgeID, unsigned int *index)

This returns the index of the edge on the polygon. It return -1 if the given edge is not belong to the polygon.

LxResult SharedEdge(LXtObjectID self, LXtPolygonID polygonID, LXtEdgeID *edgeID)

Returns the edge that is shared by both edges.

LxResult IsBorder(LXtObjectID self)

This returns LXe_TRUE if the polygon is on border or the polygon type is not surface.

LxResult RepresentativePosition(LXtObjectID self, LXtVector pos)

Find a representative position for a polygon. This returns a position that is on the interior or the polygon but not on an edge.

LxResult GoodPoint(LXtObjectID self, const LXtPointID *points, unsigned int nPoints, unsigned int *index)

Find a representative position for point list. This returns an index that is on the interior or the point list but not on an edge.

LxResult GenerateTriangles(LXtObjectID self, unsigned int *count)

These functions provide a way to triagulate surface type polygons. ‘GenerateTriangles’ generates triangle lists and it returns the number of triangle to ‘count’. If the current polygon is not a surface type, it returns FAILED.

LxResult TriangleByIndex(LXtObjectID self, unsigned index, LXtPointID *point0, LXtPointID *point1, LXtPointID *point2)

This function returns three points consist of the triangle given by the index. ‘GenerateTriangles’ must be called to generate triangle list before calling this function.

LxResult ClearTriangles(LXtObjectID self)

This clears the internal triangle list.

LxResult EnumerateBBox(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, const LXtVector min, const LXtVector max)

Enumerate polygons using test conditions. The mode selects which subset of elements to traverse. The visitor will be called with the accessor set to each successive element. This function enumerates the polygons conatined in the given bounding box.

LxResult EnumerateRay(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, const LXtVector org, const LXtVector ray)

This function enumerates the polygons along the ray given by its origin and direction vectors.

LxResult EnumerateLine(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, const LXtVector org, const LXtVector dir)

This function enumerates the polygons along the line given by its origin and direction vectors.

LxResult NewCurveFill(LXtObjectID self, const LXtPolygonID *polygons, unsigned int numPols, LXtPolygonID *polygonID)

Create curve fill polygon from continuous linear type polygons.

LxResult Symmetry(LXtObjectID self, LXtPolygonID *polygonID)

This sets the symmetric point corresponding to the current polygon when the symmetry mode is enabled. This returns LXe_OK when the symmetric polygon is found, otherwise it returns LXe_FAILED.

LxResult UVLookup(LXtObjectID self, const char *vMapName, const LXtVector2 uv, LXtVector surfacePosition, LXtVector surfaceNormal, LXtVector surfaceDPDU, LXtVector surfaceDPDV)

This returns surface point, normal, DPDU and DPDV for a given UV position on the polygon. The normal and the DPDU/DPDV can be null, if not interested in those values.

LxResult EnumerateByUV(LXtObjectID self, LXtMarkMode mode, const char *vMapName, int quality, const LXtVector2 uv, LXtObjectID visitor)

This function enumerates the polygons that contain the given texture coordinate position.

LxResult EnumerateBin(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, LXtObjectID bin)

This function enumerates all the polygons with a given surface bin.

LxResult Mesh(LXtObjectID self, void **ppvObj)

This function returns the ILxMesh object associated with the polygon accessor.

LxResult EnumerateByPTag(LXtObjectID self, LXtMarkMode mode, LXtID4 type, const char *tag, LXtObjectID visitor)

Clients can also enumerate over all polygons that have the same tags. The type of tag must be specified, along with the value to match.

LxResult Part(LXtObjectID self, unsigned int *part)

This function returns the part number for the current polygon. All connected polygons share the same part number.

LxResult UVPart(LXtObjectID self, LXtMeshMapID map, unsigned int *part)

This function returns the uv part number for the current polygon. All polygons connected on the given UV map share the same part number.

LxResult Tessellate(LXtObjectID self, unsigned int flags, LXtPolyMeshInfo *info)

Polygons are converted to a surface mesh using the ‘Tessellate’ function. The ‘Tessellate’ function returns its data in a struct with the following fields.

CLxUser_Polygon(CLxLoc_Mesh &mesh)

User Class Only:

bool fromMesh(CLxLoc_Mesh &mesh)
bool fromMeshObj(ILxUnknownID obj)
bool duplicate(CLxLoc_Polygon &acc)
bool Test(LXtMarkMode mode)
LxResult Enum(CLxImpl_AbstractVisitor *visitor, LXtMarkMode mode = LXiMARK_ANY, ILxUnknownID mon = 0)

LXi_POLY_MAXVERT

A polygon has 16 bits for its point count, so it can have a large but limited number of vertices. Zero is never really valid but is nonetheless possible.


LXsPQ_POLY

The quality of the UV tracking depends on this enum.

  • LXsPQ_SUBD


LXsPTYP_FACE

The polygon type is given by a character string identifier which allows for extensible polygon types. A “face” polygon is just the facet defined by the vertices. A “curve” polygon is a Modeler-style spline curve.

  • LXsPTYP_CURVE

  • LXsPTYP_BEZIER

  • LXsPTYP_SUBD

  • LXsPTYP_SPCH

  • LXsPTYP_TEXT

  • LXsPTYP_PSUB

  • LXsPTYP_LINE

  • LXsPTYP_CRVFIL

  • LXsPTYP_BSPLINE

  • LXsPTYP_OPNT


LXiPTYP_FACE

The second method is as a numeric ID code which is much faster when the type is known. There are ways to look up the one from the other.

  • LXiPTYP_CURVE

  • LXiPTYP_BEZIER

  • LXiPTYP_SUBD

  • LXiPTYP_SPCH

  • LXiPTYP_TEXT

  • LXiPTYP_PSUB

  • LXiPTYP_LINE

  • LXiPTYP_CRVFIL

  • LXiPTYP_BSPLINE

  • LXiPTYP_OPNT

  • LXiPTYP_BEZR

  • LXiPTYP_CURV

  • LXiPTYP_BSPL


LXi_POLYTAG_MATERIAL

Polygons have tags which can be accessed using the ILxStringTag interface on the polygon accessor. Polygon tag types can be arbitrary, so clients and even plugins are free to invent any type with any meaning they need for a specific application. However, having some predefined common types makes some of the basic applications more obvious.

  • MATR The material name for a polygon is stored in a tag of this type. If the polygon has no material, some suitable default should be used.

  • PART This tag is the name of the abstract element to which this polygon belongs. It is used primarily for selection during modeling.

  • PICK This tag indicates the selection sets that this polygon belongs to. The name of the sets are separated by semicolons, for example if a polygon belongs to A and B its pick tag will be: “A;B”

These three polygon tags are for text polygon type.

  • FONT This tag indicates the font name for this text polygon.

  • TEXT This tag includes the text string for this text polygon.

  • JUST This tag indicates the justification for this text polygon.The first character takes ‘T’(Top), ‘M’(Middle) and ‘B’(Bottom). The second character takes ‘L’(Left), ‘C’(Center), and ‘R’(Right). For example, ‘BL’ indicates the justification is bottom-left.

  • LXi_POLYTAG_PART

  • LXi_POLYTAG_SMOOTHING_GROUP

  • LXi_POLYTAG_PICK

  • LXi_POLYTAG_FONT

  • LXi_POLYTAG_TEXT

  • LXi_POLYTAG_JUST

  • LXi_PTAG_MATR

  • LXi_PTAG_PART

  • LXi_PTAG_PICK

  • LXi_PTAG_FONT

  • LXi_PTAG_TEXT

  • LXi_PTAG_JUST

  • LXf_PMI_NORMALS

  • LXf_PMI_TEXTURE

  • LXf_PMI_DYNAMIC

  • LXf_PMI_FREEZE

  • LXm_PMI_ALL

LXtPolyMeshInfo

struct st_LXtPolyMeshInfo

  • type The type is 3 or 4, where 3 indicates that this is a triangle mesh and 4 indicates that it is a quad mesh. A type of zero indicates no mesh.

  • nvrt, vrts, norm The vertices of the polygon mesh are given by an array of floats organized into ‘nvrt’ triples. The normals for each vertex, if requested, are accessed in the same manner as the vertex coordinates, unless the normals vmap is available.

  • npol, pols The polygons in the mesh are specified by indices into the vertex array. There are ‘npol’ polygons and the indices are grouped into triples or quads based on the mesh type.

  • ntex, itex, wtex Texture information is organized into a set of tuples. Each point in the mesh is associated with an n-tuple of polygon vertices and weights, with the tuple size specified by ‘ntex.’ The ‘itex’ array holds the indices of the polygon vertices, with ‘wtex’ giving the weight for each.

Public Members

unsigned int flag
unsigned int type
unsigned int nvrt
unsigned int npol
unsigned int ntex
const unsigned int *pols
const float *vrts
const float *norm
const unsigned int *itex
const float *wtex

ILxPolygon1

class ILxPolygon1

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

Public Functions

LxResult Spawn(LXtObjectID self, void **ppvObj)
LxResult Enumerate(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, LXtObjectID monitor)
LxResult TestMarks(LXtObjectID self, LXtMarkMode mode)
LxResult SetMarks(LXtObjectID self, LXtMarkMode set)
LxResult Select(LXtObjectID self, LXtPolygonID polygon)
LxResult SelectByIndex(LXtObjectID self, unsigned int index)
LXtPolygonID ID(LXtObjectID self)
LxResult Index(LXtObjectID self, int *index)
LxResult Type(LXtObjectID self, LXtID4 *type)
LxResult VertexCount(LXtObjectID self, unsigned int *count)
LxResult VertexByIndex(LXtObjectID self, unsigned int index, LXtPointID *point)
LxResult FirstIsControlEndpoint(LXtObjectID self)
LxResult LastIsControlEndpoint(LXtObjectID self)
LxResult Normal(LXtObjectID self, LXtVector normal)
LxResult MapValue(LXtObjectID self, LXtMeshMapID map, LXtPointID point, float *value)
LxResult MapEvaluate(LXtObjectID self, LXtMeshMapID map, LXtPointID point, float *value)
LxResult New(LXtObjectID self, LXtID4 type, const LXtPointID *vertices, unsigned int numVert, unsigned int rev, LXtPolygonID *polygonID)
LxResult NewProto(LXtObjectID self, LXtID4 type, const LXtPointID *vertices, unsigned int numVert, unsigned int rev, LXtPolygonID *polygonID)
LxResult Remove(LXtObjectID self)
LxResult SetFirstIsControlEndpoint(LXtObjectID self, int state)
LxResult SetLastIsControlEndpoint(LXtObjectID self, int state)
LxResult SetVertexList(LXtObjectID self, const LXtPointID *vertices, unsigned int numVert, unsigned int rev)
LxResult SetMapValue(LXtObjectID self, LXtPointID point, LXtMeshMapID map, const float *value)
LxResult ClearMapValue(LXtObjectID self, LXtPointID point, LXtMeshMapID map)
LxResult StartContour(LXtObjectID self)
LxResult AddContourEdge(LXtObjectID self, LXtPointID startPt, LXtPointID endPt)
LxResult GenerateContour(LXtObjectID self, LXtID4 type, LXtPolygonID *polygonID)
LxResult GenerateContourProto(LXtObjectID self, LXtPolygonID *polygonID)
LxResult IntersectRay(LXtObjectID self, const LXtVector pos, const LXtVector dir, LXtVector hitNorm, double *hitDist)
LxResult Closest(LXtObjectID self, double maxDist, const LXtVector pos, LXtVector hitPos, LXtVector hitNorm, double *hitDist)
LxResult PointIndex(LXtObjectID self, LXtPointID pointID, unsigned int *index)
LxResult EdgeIndex(LXtObjectID self, LXtEdgeID edgeID, unsigned int *index)
LxResult SharedEdge(LXtObjectID self, LXtPolygonID polygonID, LXtEdgeID *edgeID)
LxResult IsBorder(LXtObjectID self)
LxResult RepresentativePosition(LXtObjectID self, LXtVector pos)
LxResult GoodPoint(LXtObjectID self, const LXtPointID *points, unsigned int nPoints, unsigned int *index)
LxResult GenerateTriangles(LXtObjectID self, unsigned int *count)
LxResult TriangleByIndex(LXtObjectID self, unsigned index, LXtPointID *point0, LXtPointID *point1, LXtPointID *point2)
LxResult ClearTriangles(LXtObjectID self)
LxResult EnumerateBBox(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, const LXtVector min, const LXtVector max)
LxResult EnumerateRay(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, const LXtVector org, const LXtVector ray)
LxResult EnumerateLine(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, const LXtVector org, const LXtVector dir)

ILxEdge

class ILxEdge

The ILxEdge is used to obtain information about specific edges, as well as allowing the list of edges to be walked.

Public Functions

LxResult Spawn(LXtObjectID self, void **ppvObj)

As mentioned previously, all accessors share common interface methods for walking their respective lists.

LxResult Enumerate(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, LXtObjectID monitor)
LxResult TestMarks(LXtObjectID self, LXtMarkMode mode)
LxResult SetMarks(LXtObjectID self, LXtMarkMode set)
LxResult Select(LXtObjectID self, LXtEdgeID edge)

This method sets the accessor to the given edge. Edge IDs are somewhat dynamic based on the points and polygons in the mesh, so an old edge ID should not be assumed valid if the mesh has been edited.

LxResult SelectEndpoints(LXtObjectID self, LXtPointID v0, LXtPointID v1)

This selects the edge by its endpoints.

LXtEdgeID ID(LXtObjectID self)

These methods returns the current edge ID.

LxResult Endpoints(LXtObjectID self, LXtPointID *point0, LXtPointID *point1)

This method returns the points that make up the edge. Either argument can be NULL if you only want one or the other.

LxResult MapValue(LXtObjectID self, LXtMeshMapID map, float *value)

This method returns the value of the edge in the map provided, returning LXe_FALSE if the edge is unmapped.

LxResult MapEvaluate(LXtObjectID self, LXtMeshMapID map, float *value)
LxResult SetMapValue(LXtObjectID self, LXtMeshMapID map, const float *value)

This sets the edge’s value in the given point map.

LxResult ClearMapValue(LXtObjectID self, LXtMeshMapID map)

This removes any value for the edge pair in the given map.

LxResult PolygonCount(LXtObjectID self, unsigned int *count)

These methods return the number of polygons sharing this edge.

LxResult PolygonByIndex(LXtObjectID self, unsigned int index, LXtPolygonID *polygonID)

This returns the polygon given by its index.

LxResult RepresentativePolygon(LXtObjectID self, LXtPolygonID *polygonID, unsigned int *index)

This returns a polygon that is visible and surface. It also return the index of the polygon in the polygon list of the edge.

LxResult SharedPolygon(LXtObjectID self, LXtEdgeID edgeID, LXtPolygonID *polygonID)

This returns a shared polygon between two edges.

LxResult IsBorder(LXtObjectID self)

This returns LXe_TRUE if the edge is on border and it is belong to one polygon.

LxResult Symmetry(LXtObjectID self, LXtEdgeID *edgeID)

This sets the symmetric point corresponding to the current edge when the symmetry mode is enabled. This returns LXe_OK when the symmetric edge is found, otherwise it returns LXe_FAILED. When the current edge is on the symmetry center plane, it returns LXe_FAILED.

LxResult OnSymmetryCenter(LXtObjectID self)

This returns LXe_TRUE if the symmetry state is enabled and the current edge is on the symmetry center plane, otherwise it returns LXe_FALSE.

LxResult Index(LXtObjectID self, unsigned int *index)

This methods returns the index of the curent edge.

LxResult SelectByIndex(LXtObjectID self, unsigned int index)

An edge can be selected by it’s index. As edges don’t have a deterministic index, this is calculated by iterating through the mesh polygon’s edges and returning the index of the first occurance.

LxResult Mesh(LXtObjectID self, void **ppvObj)

This function returns the ILxMesh object associated with the edge accessor.

CLxUser_Edge(CLxLoc_Mesh &mesh)

User Class Only:

bool fromMesh(CLxLoc_Mesh &mesh)
bool fromMeshObj(ILxUnknownID obj)
bool duplicate(CLxLoc_Edge &acc)
bool Test(LXtMarkMode mode)
LxResult Enum(CLxImpl_AbstractVisitor *visitor, LXtMarkMode mode = LXiMARK_ANY, ILxUnknownID mon = 0)

ILxMeshMap

class ILxMeshMap

The ILxMeshMap is used to obtain information about specific point maps, as well as allowing the list of maps to be walked.

Public Functions

LxResult Spawn(LXtObjectID self, void **ppvObj)

As mentioned previously, all accessors share common interface methods for walking their respective lists.

LxResult Enumerate(LXtObjectID self, LXtMarkMode mode, LXtObjectID visitor, LXtObjectID monitor)
LxResult Select(LXtObjectID self, LXtMeshMapID map)

This method sets the accessor to the given point map.

LxResult SelectByName(LXtObjectID self, LXtID4 type, const char *name)

This can be used to select a map by type and name.

LxResult FilterByType(LXtObjectID self, LXtID4 type)

Maps can also be filtered by type which affects their enumeration. Passing a type of zero clears the filter.

LXtMeshMapID ID(LXtObjectID self)

This method returns the ID of the current map.

LxResult Name(LXtObjectID self, const char **name)

These return the map’s name and type.

LxResult Type(LXtObjectID self, LXtID4 *type)
LxResult Dimension(LXtObjectID self, unsigned int *dimension)

This method returns the dimension of the current map.

LxResult IsEdgeMap(LXtObjectID self)

This returns LXe_TRUE if this is an edge map.

LxResult IsContinuous(LXtObjectID self)

This returns LXe_TRUE if it is a continuous (vs. a discontinuous) map.

LxResult ZeroDefault(LXtObjectID self)

This returns LXe_TRUE if the default value of elements not in the map should be zero.

LxResult New(LXtObjectID self, LXtID4 type, const char *name, LXtMeshMapID *mapID)
LxResult Remove(LXtObjectID self)
LxResult Clear(LXtObjectID self)
LxResult EnumerateContinuous(LXtObjectID self, LXtObjectID visitor, LXtObjectID point)

It’s possible for the client to enumerate just the elements that are members of the map. This function enumerates continuous values, calling the visitor with the point accessor set to each point.

LxResult EnumerateDiscontinuous(LXtObjectID self, LXtObjectID visitor, LXtObjectID point, LXtObjectID poly)

Discontinuous values are the same but require a point and a polygon.

LxResult EnumerateEdges(LXtObjectID self, LXtObjectID visitor, LXtObjectID edge)

Likewise edge map can also be enumerated with an associated edge accessor.

LxResult SetName(LXtObjectID self, const char *name)

This sets the map’s name

LxResult EnumerateUVSeamEdges(LXtObjectID self, LXtObjectID visitor, LXtObjectID edge, LXtObjectID poly)

Enumerates UV seam edges.

LxResult UVSeamOppositeEdge(LXtObjectID self, LXtEdgeID originalEdge, LXtPolygonID originalPoly, LXtPolygonID *opppositePoly, int *isReverse)

Returns with the opposite edge. Call only from the Evaluate of a the EnumerateUVSeamEdges()!

LxResult UVBoundingBox(LXtObjectID self, LXtBBox *bbox)

This method returns the bounding box for the MeshMapAccessor’s current VMap.

CLxUser_MeshMap(CLxLoc_Mesh &mesh)

User Class Only:

bool fromMesh(CLxLoc_Mesh &mesh)
bool fromMeshObj(ILxUnknownID obj)
bool duplicate(CLxLoc_MeshMap &acc)
LxResult Enum(CLxImpl_AbstractVisitor *visitor, LXtMarkMode mode = LXiMARK_ANY, ILxUnknownID mon = 0)
LxResult EnumContents(CLxImpl_AbstractVisitor *visitor, CLxLoc_Point &point)

User Class Only: User methods all have the same name but different arguments. They also wrap the native C++ visitor in a layer of chocolatey COM goodness.

LxResult EnumContents(CLxImpl_AbstractVisitor *visitor, CLxLoc_Point &point, CLxLoc_Polygon &poly)
LxResult EnumContents(CLxImpl_AbstractVisitor *visitor, CLxLoc_Edge &edge)

LXi_VMAP_OBJECTPOS

Map types can be arbitrary, so clients and even plugins are free to invent any type with any meaning they need for a specific application. However, having some predefined common types makes some of the basic applications more obvious. The dimension of the map is given in parenthesis.

  • OPOS(3) Object-space position vectors. This is a required singleton map and must be defined for all points. If the map is undefined then the point has no base location in object space.

  • MORF(3) Morph target displacement vectors. The position of a point in the morph target is the base position of the point plus the offset stored in the map. Unassigned points have an implicit displacement of zero.

  • SPOT(3) Morph target position vectors. The position of a point in the morph target is given by an absolute vector in the map. Unassigned points have their position given by the base position.

  • NORM(3) Surface normals. These can be continuous at each point for smooth meshes or discontinuous for angular shapes.

  • TXUV(2) Texture coordinates with an implicit range of 0.0 to 1.0. Values outside that range are folded back into the unit range when used. Unassigned points have no coordinates and no texturing is done for them.

  • WGHT(1) General point weights. Although these can have any value, they should map into the nominal range of 0.0 to 1.0, or -1.0 to 1.0. Typically unassigned points are treated as if they have a weight of zero, so the zero value should be considered the default. These weights can also have any meaning, and may be applied to modulate shading, deformation or animation.

  • PICK(0) Point selection sets. Since they have dimension zero, there is no actual data associated with the points. If the point has a value in the map that indicates membership in the selection set.

  • EPCK(0) Edge selection sets. Since they have dimension zero, there is no actual data associated with the edges. If the edge has a value in the map that indicates membership in the selection set.

  • RGB (3) Point color information, stored as red, green and blue in the range of 0.0 to 1.0.

  • RGBA(4) Point color with transparency, stored as red, green, blue and alpha.

  • SUBV(1) SubPatch point weights in the range of -1.0 to 1.0. Unassigned points have the default zero weight.

  • VECT(3) Vector expressed in the local space defined by the normal and the base vector.

  • TBASIS(6) Tangent and bitangent (binormal) packed together forming a tangent basis with the normal vector, usualy used for deforming mesh (ie. rigged character) normal mapping for real-time 3D engines.

  • HARD(0) Hard edge map. Since they have dimension zero, there is no actual data associated with the edges. If the edge has a value in the map that indicates it should be hard.

  • INDX(1) Integer index to specify 1D profile to vertex.

  • LXi_VMAP_MORPH

  • LXi_VMAP_SPOT

  • LXi_VMAP_NORMAL

  • LXi_VMAP_TEXTUREUV

  • LXi_VMAP_WEIGHT

  • LXi_VMAP_PICK

  • LXi_VMAP_EPCK

  • LXi_VMAP_RGB

  • LXi_VMAP_RGBA

  • LXi_VMAP_SUBDIV

  • LXi_VMAP_VECTOR

  • LXi_VMAP_TBASIS

  • LXi_VMAP_BSPLINE

  • LXi_VMAP_HARDEDGE

  • LXi_VMAP_SEAM

  • LXi_VMAP_PITM


LXsVMAP_ITEMPREFIX

Sometimes it’s nice to have maps that are linked to specific items, especially for weights. This is done by setting a special prefix on the map name that is recognized as belonging to an item. The rest of the name is the internal item ident.

ILxMeshListener

class ILxMeshListener

Public Functions

void Destroy(LXtObjectID self)

A mesh listener can be attached to a mesh to be informed of changes. NOTE: Needs to be fleshed out!

void Changes(LXtObjectID self, unsigned event)

This is called for mesh edit changes with event codes defined as LXf_MESHEDIT.

ILxMeshListener1

class ILxMeshListener1

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

Public Functions

void Destroy(LXtObjectID self)

ILxMeshTracker

class ILxMeshTracker

Public Functions

LxResult Start(LXtObjectID self)

Often, it can be useful to track multiple changes to a mesh within a particular time period. The MeshTracker interface will record a series of mesh changes, and maintain a list of modified points and polygons. The list of changes can be queried, enumerated and cleared at any point. This provides a efficient way to be kept informed of multiple changes, without reacting to every mesh change event. The Start function starts tracking mesh changes. If this tracker is already running, this function does nothing. The tracker can be started and stopped multiple times, however, it will only record changes when it’s active.

LxResult Stop(LXtObjectID self)

The Stop function stops tracking mesh changes. If this tracker is already stopped, this function does nothing. The tracker can be started and stopped multiple times, however, it will only record changes when it’s active.

LxResult Active(LXtObjectID self)

This returns if the mesh tracker is active or not. The function will return either LXe_TRUE or LXe_FALSE.

LxResult Reset(LXtObjectID self)

After the changes have been queried and enumerated by the client, the list of changes should be cleared. The Reset function will clear the list of changes, ready to start tracking new change events.

LxResult Changes(LXtObjectID self, unsigned int *edit)

This function returns a flag describing the edits that have been performed on the mesh. The flag will be a combination of the LXf_MESHEDIT flags.

LxResult Mesh(LXtObjectID self, void **ppvObj)

Returns the ILxMesh object that the tracker is watching. If the mesh no longer exists, the function will return a failure code.

LxResult EnumeratePoints(LXtObjectID self, unsigned int change, LXtObjectID visitor, LXtObjectID point)

This function allows the modified points on the mesh to be enumerated. A change flag argument will be used as a mask for enumeration, for example if the LXf_ELTEDIT_POINT_POS flag is provided, only points that have had their position modified will be enumerated. A change flag of 0 will enumerate all points.

LxResult EnumeratePolygons(LXtObjectID self, unsigned int change, LXtObjectID visitor, LXtObjectID poly)

This function allows the modified polygons on the mesh to be enumerated. A change flag argument will be used as a mask for enumeration, for example if the LXf_ELTEDIT_POLTAGS flag is provided, only polygons that have had their tags modified will be enumerated. A change flag of 0 will enumerate all polygons.

LxResult SetChange(LXtObjectID self, unsigned int change)

The SetChange function is used to describe the overall change performed by the filter. It should be one of the LXf_MESHEDIT flags.

LxResult AddPoint(LXtObjectID self, LXtPointID point, unsigned int change)

The AddPoint function is used to store a point that has been edited. An edit flag allows the type of change to be recorded. The flag should be one of the LXf_ELTEDIT flags.

LxResult AddPolygon(LXtObjectID self, LXtPolygonID poly, unsigned int change)

The AddPolygon function is used to store a polygon that has been edited. An edit flag allows the type of change to be recorded. The flag should be one of the LXf_ELTEDIT flags.

LxResult SetFilter(LXtObjectID self, unsigned int filter)

Clients can provide a combination of change flags to filter the tracker to tracker matching change types. For example, if the client only cares about position changes, they can specify LXf_ELTEDIT_POINT_POS. Other kinds of changes may be tracked, but this can provide a performance improvement if clients are going to ignore certain change types. By default, all types of changes will be tracked.

LxResult Filter(LXtObjectID self, unsigned int *filter)

The filter state can also be queried.

LxResult EnumPoints(unsigned int change, CLxImpl_AbstractVisitor *visitor, CLxLoc_Point &point)

User Class Only:

LxResult EnumPolygons(unsigned int change, CLxImpl_AbstractVisitor *visitor, CLxLoc_Polygon &poly)

LXf_ELTEDIT_ADD

The MeshTracker can also be used by clients to register individual changes to specific elements. Changes are passed using the LXf_ELTEDIT flags. These describe a single operation that has been performed to an element.

  • ADD An element has been added to the mesh.

  • DELETE An element has been removed from the mesh.

  • POINT_POS The position of a point has changed.

  • VMAP_VAL The value of a vertex map for a point or polygon has changed.

  • POLY_VLIST The vertex list for a polygon has been modified.

  • POLY_TAGS The tags assigned to a polygon have changed.

  • POLY_TYPE The type of the polygon has changed.

  • LXf_ELTEDIT_DELETE

  • LXf_ELTEDIT_POINT_POS

  • LXf_ELTEDIT_VMAP_VAL

  • LXf_ELTEDIT_POLY_VLIST

  • LXf_ELTEDIT_POLY_TAGS

  • LXf_ELTEDIT_POLY_TYPE

  • LXf_ELTEDIT_ALL

ILxMeshOperation

class ILxMeshOperation

A mesh operation is a container for a modeling operating on a target mesh. It is a simple interface that takes a writeable mesh, and modifies the mesh in any way that it wants. This could be as simple as simply offsetting geometry positions, or it could be more complex, such as creating new geometry or editing mesh properties.

Public Functions

LxResult Evaluate(LXtObjectID self, LXtObjectID mesh, LXtID4 type, LXtMarkMode mode)

The Evaluate function is used to perform the main evaluation. It is given an editable mesh, which should be edited in place, to perform the modeling operation. A selection mark mode and selection type is provided, to limit the operation to a particular subset of components.

int Compare(LXtObjectID self, LXtObjectID other)
LxResult Convert(LXtObjectID self, LXtObjectID other)

If the previous mesh operation is compatible, then Convert will be called to transfer variables and user data from the old mesh operation to the new mesh operation. The function will be passed the old operation and any variables should be transferred.

LxResult ReEvaluate(LXtObjectID self, LXtObjectID mesh, LXtID4 type)

The ReEvaluate function is called to perform a fast update to a previous mesh. The mesh from the previous evaluation result is passed to the function, and the mesh operation is expected to simply update the mesh in place.

LxResult SetTransform(LXtObjectID self, const LXtMatrix4 matrix)

The SetTransform function is used to provide the Mesh Operation with a transform matrix to use for evaluation.

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

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

LxResult Clone(LXtObjectID self, LXtObjectID target, void **ppvObj)

The Clone function is expected to return a clone of this mesh operation and it’s internal state. A target item is provided to use as a key, allowing the mesh operation to return an existing cloned mesh operation, if one has already been created for this target item.


LXiMESHOP_DIFFERENT

When a mesh operation creates new geometry, it can be inefficient to recreate the geometry for every evaluation. This set of optional functions allow the previous evaluation result to be used as a starting point for the current evaluation. For example, a bevel tool may use the initial evaluation to create the beveled polygons, and any further evaluation calls may simply offset the position of the beveled geometry. The Compare function is used to compare one mesh operation with another. The old mesh operation is passed to the new mesh operation and the attributes should be compared, to see if they are compatible. If the function returns DIFFERENT, then the operation will be discarded and evaluated from scratch. If the function returns COMPATIBLE, then the previous result will be used as a starting point for the next evaluation. If the function returns IDENTICAL, then re-evaluation of the mesh operation will be skipped altogether, and the previous result will be used, as is.

  • LXiMESHOP_COMPATIBLE

  • LXiMESHOP_IDENTICAL

ILxMeshOperation1

class ILxMeshOperation1

Public Functions

LxResult Evaluate(LXtObjectID self, LXtObjectID mesh, LXtID4 type, LXtMarkMode mode)
int Compare(LXtObjectID self, LXtObjectID other)
LxResult Convert(LXtObjectID self, LXtObjectID other)
LxResult ReEvaluate(LXtObjectID self, LXtObjectID mesh, LXtID4 type)
LxResult SetTransform(LXtObjectID self, const LXtMatrix4 matrix)

ILxMeshFilter

class ILxMeshFilter

Public Functions

unsigned Type(LXtObjectID self)

Mesh filters are added to evaluation stacks in order to perform mesh operations during evaluation. They can also be read during evaluation to get deforming meshes. The Type() method returns the type of filter, given by one of the codes below. These select which operational method is called and how its results are interpreted.

LxResult Evaluate(LXtObjectID self, LXtObjectID mesh, LXtObjectID tracker)

If the type of filter is MODIFY, then the Evaluate() method is used to transform a mesh. A writable mesh is passed as input and should be modified in placed based on the settings of the filter. An ILxMeshTracker object is provided, allowing it to return a list of modified elements.

LxResult Generate(LXtObjectID self, void **ppvObj)

For GENERATE and SOURCE type filters the Generate() function is called and it returns a new mesh to replace the input mesh. For GENERATE filters the mesh is instanced while with SOURCE filters the result is used directly.

bool GetMesh(CLxLoc_Mesh &mesh)

User Class Only:

  • LXiFILT_MODIFY

  • LXiFILT_GENERATE

  • LXiFILT_SOURCE

ILxMeshFilter1

class ILxMeshFilter1

Public Functions

unsigned Type(LXtObjectID self)
LxResult Evaluate(LXtObjectID self, LXtObjectID mesh)
LxResult Generate(LXtObjectID self, void **ppvObj)

ILxMeshFilterBBox

class ILxMeshFilterBBox

Public Functions

LxResult Evaluate(LXtObjectID self, LXtBBox *box)

The bounding box interface only computes the mesh bounding box.


LXs_MESHFILTER_BASE

The ident interface returns a mesh in the mesh stack that has a matching ident. The ident is usually defined as the item ident of the Mesh Operation or Deformer that generated the filter in the mesh stack. If no mesh can be found with the provided ident, the function will return LXe_NOTFOUND. A BASE identifier will return the non-editable base mesh. And obviously top will return the topmost mesh in the stack. The identifier for the currently selected deformer can be obtained through the layer service’s “CurrentDeformer” function.

  • LXs_MESHFILTER_TOP

ILxMeshFilterIdent

class ILxMeshFilterIdent

Public Functions

LxResult Generate(LXtObjectID self, const char *ident, void **ppvObj)
bool GetMesh(std::string ident, CLxLoc_Mesh &mesh)

User Class Only:

ILxMeshFilterBlend

class ILxMeshFilterBlend

Public Functions

LxResult Generate(LXtObjectID self, LXtObjectID other, void **ppvObj)

The MeshFilterBlend interface allows the result of one mesh filter to be blended with another. The Generate method is provided with a second mesh filter storing alternate state for the mesh filter. The function is expected to return an ILxMeshBlend object that maps elements generated by one filter to elements generated by another.

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

The Evaluate method is provided with a second mesh filter storing alternate state for the mesh filter, as well as an ILxMeshBlend object. The function is expected to populate the ILxMeshBlend object, mapping elements generated by one filter to elements generated by another.

ILxMeshBlend

class ILxMeshBlend

Public Functions

LxResult BlendMesh(LXtObjectID self, double t, void **ppvObj)

It can be useful to be able to compare the result of one mesh stack with the result of another. The MeshBlend object provides methods for finding equivalent elements on two mesh stack results, as well as a blending the topology of one mesh stack, into the positions of another. The BlendMesh method returns a new mesh that contains the source mesh stack topology, in the positions of the target mesh stack. The t argument determines how the mesh is blended, with a value of 0.0 representing the original source mesh positions, and a value of 1.0 representing the target mesh positions.

LxResult SourceMesh(LXtObjectID self, void **ppvObj)

The SourceMesh method returns the source mesh.

LxResult TargetMesh(LXtObjectID self, void **ppvObj)

The TargetMesh method returns the target mesh.

LxResult GetPoint(LXtObjectID self, LXtPointID source, LXtPointID *target)

Provided with a point on the source mesh, the GetPoint method will return the equivalent point on the target mesh.

LxResult GetPolygon(LXtObjectID self, LXtPolygonID source, LXtPolygonID *target)

Provided with a polygon on the source mesh, the GetPolygon method will return the equivalent polygon on the target mesh.

LxResult SetPoint(LXtObjectID self, LXtPointID source, LXtPointID target)

Equivalent points can be updated by providing a point on the source mesh, and a point on the target mesh. If the list of equivalent elements cannot be edited, NOACCESS will be returned.

LxResult SetPolygon(LXtObjectID self, LXtPolygonID source, LXtPolygonID target)

Equivalent polygons can be updated by providing a polygon on the source mesh, and a polygon on the target mesh. If the list of equivalent elements cannot be edited, NOACCESS will be returned.

LxResult EnumeratePoints(LXtObjectID self, LXtObjectID source, LXtObjectID target, LXtObjectID visitor)

Points can be enumerated by providing a source point accessor, a target point accessor and a visitor. For each source point, the accessor for the source and target will be set, and the visitor will be called.

LxResult EnumeratePolygons(LXtObjectID self, LXtObjectID source, LXtObjectID target, LXtObjectID visitor)

Polygons can be enumerated by providing a source polygon accessor, a target polygon accessor and a visitor. For each source polygon, the accessor for the source and target will be set, and the visitor will be called.

ILxMeshMetaData

class ILxMeshMetaData

Public Functions

LxResult Validate(LXtObjectID self, LXtObjectID mesh, LXtObjectID xtra, unsigned int change)

Meshes are constructed from user editable elements, such as points, polygons, vertex maps and polygon tags; however, meshes can also have evaluated meta data that is created on demand, and invalidated whenever the mesh is modified. Clients can implement new meta data through the SDK using ILxMeshMetaData. The Validate method is used to update the meta data. The function is provided with a mesh, an mesh xtra data interface to manipulate mesh xtra data, and a change flag describing the type of change that has been performed. The xtra data interface will only be valid if the server specifies xtra data support in the server tags.

void FreePointData(LXtObjectID self, void *data)

It can be useful to store additonal data per point or per polygon. The Mesh Xtra Data mechanism allows either a memory pointer or a COM object to be stored per element. If arbitrary data is being stored, the Free methods will be called per element to release any allocated memory.

void FreePolygonData(LXtObjectID self, void *data)

LXsMESHXTRADATA_POINT

If clients want to store xtra data with the polygons and points on the mesh, they can do so by providing the following server tags - the value of the tags does not matter.

  • LXsMESHXTRADATA_POLYGON


LXsMESHMETADATA_FLAGS

Metadata is invalidated when the mesh changes. Rather than invalidating on any mesh change, this can be filtered using a mesh edit flag. The LXsMESHMETADATA_FLAGS server tag allows a comma seperated list of change types to be specified. If the mesh changes in any of these ways, the meta data is invalidated.

  • LXs_MESHEDIT_POSITION

  • LXs_MESHEDIT_POINTS

  • LXs_MESHEDIT_POLYGONS

  • LXs_MESHEDIT_POL_TAGS

  • LXs_MESHEDIT_POL_TYPE

  • LXs_MESHEDIT_MAP_CONTINUITY

  • LXs_MESHEDIT_MAP_UV

  • LXs_MESHEDIT_MAP_MORPH

  • LXs_MESHEDIT_MAP_OTHER

  • LXs_MESHEDIT_MAP_LIST


LXs_MESHEDIT_DELTA

Meta data can also be incrementally updated if the change is limited to position, or vertex map changes. The Validate will be called with the LXf_MESHEDIT_DELTA change flag. Any modified elements are marked with the LXsMARK_DELTA mark mode, and can be enumerated to perform an incremental update to those elements.

ILxMeshXtraData

class ILxMeshXtraData

Points and Polygons accessed during mesh meta data validation can have xtra data associated with them. This data persists for the lifetime of the meta data, can be accessed extremely quickly and is destroyed when the mesh element is deleted. The data can store either a pointer to some memory, or an reference counted COM object.

Public Functions

LxResult SetPointData(LXtObjectID self, LXtPointID point, void *data)

This method sets the xtra data for a point to some arbitrary data. It must be free’d by the ILxMeshMetaData::FreePointData method when it’s no longer needed.

LxResult SetPointObject(LXtObjectID self, LXtPointID point, LXtObjectID obj)

Points can also have reference counted COM objects associated with them. This object is automatically released when no longer needed.

LxResult GetPointData(LXtObjectID self, LXtPointID point, void **data)

Once set, the xtra data for a point can easily be read. If it hasn’t been set, this method will return a failure code.

LxResult GetPointObject(LXtObjectID self, LXtPointID point, void **ppvObj)
LxResult ClearPoint(LXtObjectID self, LXtPointID point)

If the data associated with a point is no longer needed, the ClearPoint function will remove it. The ILxMeshMetaData::FreePointData method will be called to release the memory as necessary.

LxResult SetPolygonData(LXtObjectID self, LXtPolygonID poly, void *data)

This method sets the xtra data for a polygon to some arbitrary data. It must be free’d by the ILxMeshMetaData::FreePolygonData method when it’s no longer needed.

LxResult SetPolygonObject(LXtObjectID self, LXtPolygonID poly, LXtObjectID obj)

Polygons can also have reference counted COM objects associated with them. This object is automatically released when no longer needed.

LxResult GetPolygonData(LXtObjectID self, LXtPolygonID poly, void **data)

Once set, the xtra data for a polygon can easily be read. If it hasn’t been set, this method will return a failure code.

LxResult GetPolygonObject(LXtObjectID self, LXtPolygonID poly, void **ppvObj)
LxResult ClearPolygon(LXtObjectID self, LXtPolygonID poly)

If the data associated with a polygon is no longer needed, the ClearPolygon function will remove it. The ILxMeshMetaData::FreePolygonData method will be called to release the memory as necessary.