Editable_Poly: GeometryClass

Editable_Poly is the general editable version of all the editable poly objects, in the same way that Editable meshes relate to geometry objects. They are the class of node objects that are the result of collapsing a modifier stack to an editable mesh object.

Constructor

Properties

Methods

Editable Poly Modify Panel Command Modes and Operations

A suite of methods provide the ability for a script to invoke Editable Poly Modify panel modes and operations, corresponding to buttons available at various sub-object levels. These methods reside in the polyOp and polyOps global structures. These methods effectively "push the button" in the Modify panel. In order to use these methods, the node must be selected and the Modify panel open. In the description of these methods, the first argument <editable_poly_node_or_modifier> should be interpreted as either an Editable Poly node where the modifier stack level is at the base object, or an Edit Poly modifier where the modifier stack level is at the Edit Poly. In all cases, the following methods work at the current sub-object level, but only if that level is appropriate for the invoked operation.

The follow methods invoke one of the 'user-interaction' button operations in the Editable Poly Modify panel, acting on the currently selected sub-objects. These methods highlight the corresponding button in the Geometry rollout and start the operation, at which point the user interactively completes the operation. These methods return after starting the operation, and before the user completes the operation, so care should be taken to ensure that your script does not interfere with the operation. Invoking any of these methods is the same as clicking on the associated button in the Modify panel. Calling a method when the operation is already in effect (either due to a user action or a MAXScript command) causes the operation to be terminated and the highlight is removed from the button.

Many of the polyOp methods take as an argument <vertlist>, <facelist>, or <edgelist>. These arguments specify the sub object (SO) elements to operate on. These arguments can be specified as:

#all - all SO elements of that type

#selection - the current SO selection of that type

#none - none of the SO elements of that type

An array of integers, where each integer value specifies a SO element index

A bitarray, where each bit specifies a SO element index

A value convertable to an integer that specifies a SO element index

A VertexSelection, EdgeSelection, or FaceSelection value. The value type must match the specified SO type.

All polyOp methods take as an argument <poly>, the poly to operate on. This argument can be either a node value where the base object of the node is an Editable Poly, or the Editable Poly base object.

Editable polys can have "dead" vertices, edges, and faces. These are SO elements that have been deleted from the poly, but have not yet been removed from the corresponding lists of SO elements. SO elements may be marked as dead in the process of performing certain operations on the poly, but the SO element lists are normally collapsed (that is, all dead SO elements removed) at the end of the operation. Thus, normally there should not be any dead SO elements present in the poly. If you flag a SO element as dead using one of the polyOp methods, you should also call collapseDeadStructs to collapse the SO element lists.

Other than methods that get/set SO element flags, dead SO elements are normally ignored by the polyOp methods. If a method returns a value other than OK, takes a single SO element index, and that SO element is dead, a value of UNDEFINED is normally returned.

polyOp.getVertSelection <Poly poly>

Returns the current vertex selection as a bitarray

polyOp.setVertSelection <Poly poly> <vertlist>

Sets the current vertex selection based on <vertlist>

polyOp.getEdgeSelection <Poly poly>

Returns the current edge selection as a bitarray

polyOp.setEdgeSelection <Poly poly> <edgelist>

Sets the current edge selection based on <vertlist>

polyOp.getFaceSelection <Poly poly>

Returns the current face selection as a bitarray

polyOp.setFaceSelection <Poly poly> <facelist>

Sets the current face selection based on <facelist>

polyOp.getDeadVerts <Poly poly>

Returns the current dead vertices selection as a bitarray. Normally this will return an empty bitarray.

polyOp.getDeadEdges <Poly poly>

Returns the current dead edges selection as a bitarray. Normally this will return an empty bitarray.

polyOp.getDeadFaces <Poly poly>

Returns the current dead faces selection as a bitarray. Normally this will return an empty bitarray.

polyOp.getVertsByFlag <Poly poly> <int flag> mask:<int maskflag>

Each vertex in a poly contains a 32 bit flag variable. This method returns a bitarray of the vertices that have all the bits specified in <flag> also set in the flag variable. If mask: is specified, any vertices where any of the bits specified in the <maskflag> are also set in the flag variable are not included in the resulting bitarray. If bit 2 of <flag> is not set, signifying the vertex is dead, dead vertices are not included in the resulting bitarray. The vertex level flags are:

bit 1: vertex is selected

bit 2: vertex is dead

bit 3: reserved

bit 4: indicates the vertex faces "backwards" in the current viewport

bit 5-24: reserved

bit 25-32: available for general use

polyOp.getVertFlags <Poly poly> <int vert>

Returns the flags bits for the vertex as an integer.

polyOp.setVertFlags <Poly poly> <vertlist> <int flag> mask:<int=0> undoable:<boolean=false>

Sets the flag bits on the specified vertices to the bits in <flag>. If mask is specified, the bits set in the mask value are cleared for all vertices in the poly prior to setting flag bits on the specified vertices. If undoable:true is specified, this operation is undoable. If bits 1 or 2 of <flag> are set (selected and dead flag bits), this operation is always undoable.

Example:

p=convertToPoly (plane())

p.selectedVerts = #{10..20}

i=1 -- selected bit

j=bit.set 0 30 true -- bit 30 set

oldflags = for k = 1 to p.numverts collect polyop.getVertFlags p k

theSet=#{5..15}

polyop.setvertflags p theSet j mask:i

for k = 1 to p.numverts do

(

nf=polyop.getVertFlags p k

format "% : % : %\n" k nf oldflags[k]

oldflags[k]=nf

)

j=bit.set 0 1 true -- bit 1 set

polyop.setvertflags p theSet j

for k = 1 to p.numverts do

(

nf=polyop.getVertFlags p k

format "% : % : %\n" k nf oldflags[k]

)

polyOp.getEdgesByFlag <Poly poly> <int flag> mask:<int maskflag>

Each edge in a poly contains a 32 bit flag variable. This method returns a bitarray of the edges that have all the bits specified in <flag> also set in the flag variable. If mask: is specified, any edges where any of the bits specified in the <maskflag> are also set in the flag variable are not included in the resulting bitarray. If bit 2 of <flag> is not set, signifying the edge is dead, dead edges are not included in the resulting bitarray. The edge level flags are:

bit 1: edge is selected

bit 2: edge is dead

bit 3: reserved

bit 4: indicates the vertex faces "backwards" in the current viewport

bit 5-24: reserved

bit 25-32: available for general use

polyOp.getEdgeFlags <Poly poly> <int edge>

Returns the flags bits for the edge as an integer.

polyOp.setEdgeFlags <Poly poly> <edgelist> <int flag> mask:<int=0> undoable:<boolean=false>

Sets the flag bits on the specified edges to the bits in <flag>. If mask is specified, the bits set in the mask value are cleared for all edges in the poly prior to setting flag bits on the specified edges. If undoable:true is specified, this operation is undoable. If bits 1 or 2 of <flag> are set (selected and dead flag bits), this operation is always undoable.

polyOp.getFacesByFlag <Poly poly> <int flag> mask:<int maskflag>

Each face in a poly contains a 32 bit flag variable. This method returns a bitarray of the faces that have all the bits specified in <flag> also set in the flag variable. If mask: is specified, any faces where any of the bits specified in the <maskflag> are also set in the flag variable are not included in the resulting bitarray. If bit 2 of <flag> is not set, signifying the face is dead, dead faces are not included in the resulting bitarray. The face level flags are:

bit 1: face is selected

bit 2: face is dead

bit 3: reserved

bit 4: indicates the vertex faces "backwards" in the current viewport

bit 5-24: reserved

bit 25-32: available for general use

polyOp.getFaceFlags <Poly poly> <int face>

Returns the flags bits for the face as an integer.

polyOp.setFaceFlags <Poly poly> <facelist> <int flag> mask:<int=0> undoable:<boolean=false>

Sets the flag bits on the specified faces to the bits in <flag>. If mask is specified, the bits set in the mask value are cleared for all faces in the poly prior to setting flag bits on the specified faces. If undoable:true is specified, this operation is undoable. If bits 1 or 2 of <flag> are set (selected and dead flag bits), this operation is always undoable.

polyOp.getNumVerts <Poly poly>

Returns the number of vertices in the poly. Includes any dead vertices.

polyOp.getNumEdges <Poly poly>

Returns the number of edges in the poly. Includes any dead edges.

polyOp.getNumFaces <Poly poly>

Returns the number of faces in the poly. Includes any dead faces.

polyOp.GetHasDeadStructs <Poly poly

Bit 1 in the return value is set if the poly has any dead vertices, bit 2 if any dead edges, and bit 3 if any dead faces.

polyOp.getHiddenVerts <Poly poly>

Bits in the result bitarray are set if the corresponding vertex is hidden.

polyOp.setHiddenVerts <Poly poly> <vertlist>

Hides the corresponding vertices in the poly

polyOp.getHiddenFaces <Poly poly>

Bits in the result bitarray are set if the corresponding face is hidden.

polyOp.setHiddenFaces <Poly poly> <facelist>

Hides the corresponding faces in the poly

polyOp.unHideAllFaces <Poly poly>

Unhides all faces in the poly.

polyOp.unHideAllVerts <Poly poly>

Unhides all vertices in the poly.

polyOp.getEdgeVis <Poly poly> <int edge>

Returns true if the specified edge is visible, false otherwise.

polyOp.setEdgeVis <Poly poly> <edgelist> <boolean>

Sets the visibility of the specified edges.

polyOp.getOpenEdges <Poly poly>

Bits in the result bitarray are set if the corresponding edge is open (used by only 1 ace).

polyOp.getBorderFromEdge <Poly poly> <int edge>

Bits in the result bitarray are set for open edges in the poly that are connected via open edges to the specified edge.

All one-sided edges in polys can be grouped into chains, end to end, that represent boundaries of the poly. For instance, in a box with one side deleted, all the one-sided edges are part of the chain that goes around the hole. If the specified edge isn't open, the resulting bitarray is empty.

polyOp.getFaceVerts <Poly poly> <int face>

Returns the face's vertices as an array. The order of the vertices in the array corresponds to the order of the vertices in the face.

polyOp.getFaceEdges <Poly poly> <int face>

Returns the face's edges as an array. The order of the edges in the array corresponds to the order of the edges in the face.

polyOp.getEdgeVerts <Poly poly> <int edge>

Returns the edge's vertices as a 2 element array.

polyOp.isFaceDead <Poly poly> <int face>

Returns true if the specified face is dead.

polyOp.isEdgeDead <Poly poly> <int edge>

Returns true if the specified edge is dead.

polyOp.isVertDead <Poly poly> <int vert>

Returns true if the specified vertex is dead.

polyOp.getEdgeFaces <Poly poly> <int edge>

Returns the faces using the specified edge. Normally a 1 element (open edge) or 2 element array.

polyOp.getFaceDeg <Poly poly> <int face>

Returns the number of vertices in the specified face.

polyOp.getFaceMatID <Poly poly> <int face>

Returns the material ID assigned to the face

polyOp.setFaceMatID <Poly poly> <facelist> <int MatID>

Assigns the material ID to the face

polyOp.CollapseDeadStructs <Poly poly>

Removes all dead SO elements from the poly.

polyOp.getVert <Poly poly> <int vertex> node:<node=unsupplied>

Returns the position of the specified vertex. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position returned is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the return value is in the poly's local coordinate system.

polyOp.setVert <Poly poly> <vertlist> <point3 pos> node:<node=unsupplied>

Sets the position of the specified vertices. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the position is in the poly's local coordinate system.

polyOp.moveVert <Poly poly> <vertlist> <point3 offset> node:<node=unsupplied>

Moves the specified vertices by <offset>. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the offset is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the offset is in the poly's local coordinate system.

polyOp.isMeshFilledIn <Poly poly>

Returns true if all topological links, such as the list of edges, are complete for the poly.

polyOp.getEdgesUsingVert <Poly poly> <vertlist>

Bits in the result bitarray are set if the corresponding edge uses one of the vertices in <vertlist>.

polyOp.getFacesUsingVert <Poly poly> <vertlist>

Bits in the result bitarray are set if the corresponding face uses one of the vertices in <vertlist>.

polyOp.getVertsUsingEdge <Poly poly> <edgelist>

Bits in the result bitarray are set if the corresponding vertex uses one of the edges in <edgelist>.

polyOp.getFacesUsingEdge <Poly poly> <edgelist>

Bits in the result bitarray are set if the corresponding face uses one of the edges in <edgelist>.

polyOp.getVertsUsingFace <Poly poly> <facelist>

Bits in the result bitarray are set if the corresponding vertex uses one of the faces in <facelist>.

polyOp.getEdgesUsingFace <Poly poly> <facelist>

Bits in the result bitarray are set if the corresponding edge uses one of the faces in <facelist>.

polyOp.getElementsUsingFace <Poly poly> <facelist> fence:<fence_facelist>

Bits in the result bitarray are set for all faces in the same "element", or connected component, with faces in <facelist>.

If <fence_facelist> is specified, those faces will be considered "walls" for this processing and will not be evaluated. That is, if face i is specified in <facelist>, and a ring of faces around it is specified in <fence_facelist>, the algorithm will stop at that ring.

polyOp.getVertsUsedOnlyByFaces <Poly poly> <facelist>

Bits in the result bitarray are set if the corresponding vertex is only used by faces in <edgelist>.

polyOp.getFaceCenter <Poly poly> <int face> node:<node=unsupplied>

Returns the center of the face by taking the average of all its vertices. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position returned is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the return value is in the poly's local coordinate system.

polyOp.getSafeFaceCenter <Poly poly> <int face> node:<node=unsupplied>

Returns the "safe" center of the face, if possible. For non-convex faces, the average point found using getFaceCenter is unsuitable for some applications because it can lie outside the face completely, or in a region where it cannot see all the face's vertices (i.e., line segments from the center to the corner pass outside of the face.). If a safe center cannot be found, a value of UNDEFINED is returned.

This routine provides a better solution in some cases by finding the center of the convex hull of the face. The convex hull is defined as the region in a face with a clear line-of-sight to all the corners. Some faces, such as the top face in an extruded letter M, have an empty convex hull, in which case this routine fails and merely provides the regular center given by ComputeCenter.

If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position returned is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the return value is in the poly's local coordinate system.

polyOp.getFaceNormal <Poly poly> <int face> node:<node=unsupplied>

Returns the face normal of the face. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the direction vector returned is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the return value is in the poly's local coordinate system.

polyOp.getFaceArea <Poly poly> <int face>

Returns the area of the specified face.

polyOp.attach <Poly poly> <source> targetNode:<node=unsupplied> sourceNode:<node=unsupplied>

Attaches <source>, converted to a polymesh if necessary, to <poly>. If <source> or <poly> is not a node value, the corresponding targetNode or sourceNode must be specified. The source node is deleted after the attach is performed.

polyOp.deleteVerts <Poly poly> <vertlist>

Deletes the specified vertices.

polyOp.deleteFaces <Poly poly> <facelist> delIsoVerts:<boolean=true>

Deletes the specified faces. If <delIsoVerts> is true, any vertices that are no longer used by faces are also deleted.

polyOp.deleteEdges <Poly poly> <edgelist> delIsoVerts:<boolean=true>

Deletes the specified edges. If <delIsoVerts> is true, any vertices that are no longer used by edges are also deleted.

polyOp.weldVertsByThreshold <Poly poly> <vertlist>

Welds the specified vertices that are within the threshold distance. The threshold distance is a property (weldThreshold) of the editable poly. Only vertices on a border can be welded.

polyOp.weldVerts <Poly poly> <int vert1> <int vert2> <point3 location> node:<node=unsupplied>

Welds the two specified vertices, with the resulting vertex positioned at the specified location. Only vertices on a border can be welded.

If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the location is in the current coordinate system context.

If <poly> is an Editable Poly and <node> is not specified, the location is in the poly's local coordinate system.

polyOp.weldEdgesByThreshold <Poly poly> <edgelist>

Welds the vertices associated with the specified edges that are within the threshold distance. The threshold distance is a property (weldThreshold) of the editable poly. Only vertices on a border can be welded.

polyOp.weldEdges <Poly poly> <int edge1> <int edge2>

Welds the vertices associated with the specified edges. Only vertices on a border can be welded.

polyOp.createVert <Poly poly> <point3 pos> node:<node=unsupplied>

Creates a vertex as the specified position. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the position is in the poly's local coordinate system. Returns the index of the created vertex or undefined if no vertex was created.

polyOp.createEdge <Poly poly> <int vert1> <int vert2>

Creates an edge using the two specified vertices. The vertices must be used by a common face. Returns the index of the created edge or undefined if no edge was created.

polyOp.createPolygon <Poly poly> <vertex array>

Creates a face using the specified vertices. The order of the vertices in the face is the order in the vertex array. For each successive vertex pair, at most 1 edge may exist between the vertices, and that edge must not go from the first to second vertex. The default triangulation for a face with the specified number of vertices is used; if the face is not convex, this triangulation may be inappropriate.

If this is the case, call retriangulate() on this face after it's created. This returns the index of the created face or undefined if no face was created.

polyOp.deleteIsoVerts <Poly poly>

Deletes any vertices not used by any faces.

polyOp.autoSmooth <Poly poly>

Performs an auto smooth of the poly. The face smoothing threshold angle is a property (autoSmoothThreshold) of the editable poly.

polyOp.flipNormals <Poly poly> <facelist>

Flips the normal of the specified faces.

polyOp.retriangulate <Poly poly> <facelist>

Retriangulates the specified faces.

polyOp.setDiagonal <Poly poly> <int face> <int face_vert1> <int face_vert2>

Sets a diagonal of the face between the two vertices. The face must have a degree greater than 3 and the two vertices must not be connected by an edge.

polyOp.forceSubdivision <Poly poly>

Forces an update of the surface subdivision at the next viewport redraw. Use when NURMS Subdivision is on and Update Options is Manually.

polyOp.meshSmoothByVert <Poly poly> <vertlist>

Smooths the faces associated with the specified vertices. Uses the smoothness, separateBySmoothing, and separateByMaterial properties of the editable poly.

polyOp.meshSmoothByFace <Poly poly> <facelist>

Smooths the specified faces. Uses the smoothness, separateBySmoothing, and separateByMaterial properties of the editable poly.

polyOp.meshSmoothByEdge <Poly poly> <edgelist>

Smooths the faces associated with the specified edges. Uses the smoothness, separateBySmoothing, and separateByMaterial properties of the editable poly.

polyOp.setFaceSmoothGroup <Poly poly> <facelist> <int smoothing_group> add:<boolean=false>

Sets the smoothing groups for the specified faces. The state of each bit in <smoothing_group> specifies whether the face belongs to the corresponding smoothing group. If <add> is true, <smoothing_group> is added to the existing smoothing group data specified for each face. If false, the existing smoothing group data is overwritten.

polyOp.getFaceSmoothGroup <Poly poly> <int face>

Returns the smoothing group data for the specified face as an integer. The state of each bit in the result specifies whether the face belongs to the corresponding smoothing group.

polyOp.breakVerts <Poly poly> <vertlist>

For each vertex in <vertlist>, N-1 new vertices are created at the same location, where N is the number of faces using that vertex. Each of these faces will use one of these vertices.

polyOp.divideEdge <Poly poly> <int edge> <float fraction>

Divides the specified edge at the specified fractional distance along the edge. The return value is the index of the new vertex or undefined if no vertex was created.

polyOp.divideFace <Poly poly> <int face> <point3 pos> node:<node=unsupplied>

Divides the specified face, with the new vertex being created at the closest point on the face to the specified position. If the specified position is outside the face, the vertex will be created at the center of the face. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the position is in the poly's local coordinate system. Returns the index of the created vertex.

polyOp.collapseVerts <Poly poly> <vertlist>

Collapses each cluster of vertices in the specificed vertices to a single vertex. A vertex cluster is a set of vertices that are directly connected to one another.

polyOp.collapseFaces <Poly poly> <facelist>

Collapses the vertices associated with each cluster of faces in the specificed faces to a single vertex. A face cluster is a set of faces that are directly connected to one another.

polyOp.collapseEdges <Poly poly> <edgelist>

Collapses the vertices associated with each cluster of edges in the specificed edges to a single vertex. An edge cluster is a set of edges that are directly connected to one another.

polyOp.splitEdges <Poly poly> <edgelist>

Splits the specified edges at their middle.

polyOp.propagateFlags <Poly poly> <toSOLevel> <toFlag_int> <fromSOLevel> <fromFlag_int> ampersand:<boolean=false> set:<boolean=true> undoable:<boolean=true>

where toSOLevel/fromSOLevel = {#object | #vertex | #edge | #face}

Propogates component flags. For each <fromSOLevel> element that has flag <fromFlag_int> set, the <toSOLevel> elements that use or are used by the element will have their internal flag variable bits set based on <toFlag_int>. Only the bits corresponding to the bits that are set in <toFlag_int> are affected. If <ampersand> is false, and <fromFlag_int> has more than one bit set, the <fromSOLevel> elements will be tested to see if they have any of the corresponding bits set. If true, the <fromSOLevel> components elements be tested to see if they have all the corresponding bits set. If <set> is true, the <toSOLevel> elements have flags <toFlag_int> set. If false, these flags will be cleared instead.

If <undoable> is true, the operation in undoable, otherwise it is not. If bits 1 or 2 of <toFlag_int> are set (selected and dead flag bits), this operation is always undoable. Returns the number of <fromSOLevel> elements that tested positive for the <fromFlag_int> flags.

polyOp.tessellateByVert <Poly poly> <vertlist>

Tessellates the faces used by the specified vertices. Uses the tesselateBy and tessTension properties of the editable poly.

polyOp.tessellateByFace <Poly poly> <facelist>

Tessellates the specified faces. Uses the tesselateBy and tessTension properties of the editable poly.

polyOp.tessellateByEdge <Poly poly> <edgelist>

Tessellates the faces used by the specified edges. Uses the tesselateBy and tessTension properties of the editable poly.

polyOp.detachFaces <Poly poly> <facelist> delete:<boolean=true> asNode:<boolean=false> name:<string="Object01"> node:<node=unsupplied>

Detaches the specified faces. If <delete> is true, the faces are deleted after being detached. If <delete> is false, the faces are not deleted. If <asNode> is true, the faces are detached as a separate node. If <asNode> is false, the faces are detached as an element in the poly. If <asNode> is true, <name> specifies the name of the new node. If <asNode> is true and <poly> is an Editable Poly (not a node), <node> must be specified. Returns true if the operation was successful.

polyOp.detachEdges <Poly poly> <edgelist> delete:<boolean=true> asNode:<boolean=false> name:<string="Object01"> node:<node=unsupplied>

Detaches the faces used by the specified edges. If <delete> is true, the faces are deleted after being detached. If <delete> is false, the faces are not deleted. If <asNode> is true, the faces are detached as a separate node. If <asNode> is false, the faces are detached as an element in the poly. If <asNode> is true, <name> specifies the name of the new node. If <asNode> is true and <poly> is an Editable Poly (not a node), <node> must be specified. Returns true if the operation was successful.

polyOp.detachVerts <Poly poly> <vertlist> delete:<boolean=true> asNode:<boolean=false> name:<string="Object01"> node:<node=unsupplied>

Detaches the faces used by the specified vertices. If <delete> is true, the faces are deleted after being detached. If <delete> is false, the faces are not deleted. If <asNode> is true, the faces are detached as a separate node. If <asNode> is false, the faces are detached as an element in the poly. If <asNode> is true, <name> specifies the name of the new node. If <asNode> is true and <poly> is an Editable Poly (not a node), <node> must be specified. Returns true if the operation was successful.

polyOp.fillInMesh <Poly poly>

Recomputes the internal MNEdges and MNFace::edg, MNVert::edg, and MNVert::fac lists based on the information in the MNFace::vtx lists.

polyOp.resetSlicePlane <Poly poly>

Resets the slice plane.

polyOp.getSlicePlane <Poly poly> size:<&size_float_var> node:<node=unsupplied>

Returns the location and direction of the slice plane as a Ray value. If <size> is specified, the size of the slice plane is returned in the referenced variable. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the ray returned is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the return value is in the poly's local coordinate system.

polyOp.setSlicePlane <Poly poly> <ray plane_and_dir> <float size> node:<node=unsupplied>

Sets the slice plane to the location and direction as specified by <plane_and_dir>, and the size as specified by <size>. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the ray is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the ray is in the poly's local coordinate system.

polyOp.slice <Poly poly> <facelist> <ray plane_and_dir> node:<node=unsupplied>

Slices the poly based on the plane and direction as specified by <plane_and_dir>. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the ray is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the ray is in the poly's local coordinate system. Uses the split property of the editable poly. Returns true if the slice was successful.

polyOp.inSlicePlaneMode <Poly poly>

Returns true if the editable poly is in slice mode, false otherwise.

polyOp.cutVert <Poly poly> <int start_vert> <point3 destination> <point3 projdir> node:<node=unsupplied>

If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, destination and projdir are in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, destination and projdir are in the poly's local coordinate system.

Returns the index of the new vertex if created, or undefined if no vertex was created.

polyOp.cutFace <Poly poly> <int face> <point3 start> <point3 destination> <point3 projdir> node:<node=unsupplied>

If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, start, destination, and projdir are in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, start, destination, and projdir are in the poly's local coordinate system.

Returns the index of the new vertex if created, or undefined if no vertex was created.

polyOp.cutEdge <Poly poly> <int edge1> <float prop1> <int edge2> <float prop2> <point3 projdir> node:<node=unsupplied>

If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, projdir is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, projdir is in the poly's local coordinate system.

Returns the index of the new vertex if created, or undefined if no vertex was created.

polyOp.capHolesByVert <Poly poly> <vertlist>

Finds any borders that use one or more of the specified vertices, and builds faces to cap the holes. Returns true if one or more holes were capped.

polyOp.capHolesByFace <Poly poly> <facelist>

Finds any borders that use one or more of the vertices associated with the specified faces, and builds faces to cap the holes. Returns true if one or more holes were capped.

polyOp.capHolesByEdge <Poly poly> <edgelist>

Finds any borders that use one or more of the vertices associated with the specified edges, and builds faces to cap the holes. Returns true if one or more holes were capped.

polyOp.makeVertsPlanar <Poly poly> <vertlist>

Moves the specified vertices so that they are planar.

polyOp.moveVertsToPlane <Poly poly> <vertlist> <Point3 planeNormal> <float planeOffset> node:<node>

Moves the specified vertices into the specified plane. The target plane is defined as all points which, when DotProducted with N, return offset. All vertices are moved along the normal vector N.

polyOp.makeEdgesPlanar <Poly poly> <edgelist>

Moves the vertices associated with the specified edges so that they are planar.

polyOp.moveEdgesToPlane <Poly poly> <edgelist> <Point3 planeNormal> <float planeOffset> node:<node=unsupplied>

Moves the vertices associated with the specified edges into the specified plane. The target plane is defined as all points which, when DotProd'd with N, return offset. All vertices are moved along the normal vector N.

polyOp.makeFacesPlanar <Poly poly> <facelist>

Moves the vertices associated with the specified faces so that they are planar.

polyOp.moveFacesToPlane <Poly poly> <facelist> <Point3 planeNormal> <float planeOffset> node:<node=unsupplied>

Moves the vertices associated with the specified faces into the specified plane. The target plane is defined as all points which, when DotProd'd with N, return offset. All vertices are moved along the normal vector N.

polyOp.createShape <Poly poly> <edgelist> smooth:<boolean=false> name:<string="Shape01"> node:<node=unsupplied>

Creates a shape node from the specified edges. If <smooth> is true, the shape is created as a smooth curve. The name of the new node is specified by <name>. If <poly> is an Editable Poly (not a node), <node> must be specified.

polyOp.extrudeFaces <Poly poly> <facelist> <float amount>

Extrudes the specified faces by the specified amount. Uses the extrustionType property of the Editable Poly.

polyOp.bevelFaces <Poly poly> <facelist> <float height> <float outline>

Bevels the specified faces. Extrudes the specified faces the specified height, and then scales the new top faces by <outline>. Uses the extrustionType property of the Editable Poly.

polyOp.chamferVerts <Poly poly> <vertlist> <float amount>

Chamfers the specified vertices by the specified amount.

polyOp.chamferEdges <Poly poly> <edgelist> <float amount>

Chamfers the specified edges by the specified amount.

The following methods are specific to mapping. All channels are 0-based.

polyOp.setNumMaps <Poly poly> <int count> keep:<boolean=true>

Sets the number of map channels available. The number of map channels can be set from 0 to 100. Map channels 1 and 2 are the Vertex Color and default Texture Map channels. If <keep> is false, the old mapping information is discarded. If true, the old mapping information is retained after the resize.

polyOp.getNumMaps <Poly poly>

Returns the number of map channels available as an <integer>.

polyOp.setMapSupport <Poly poly> <int mapChannel> <Boolean support>

Sets whether the specified mapping channel is supported or not. If <support> is true, and the channel support state is currently false, a new map face array of the same size as the number of faces in the mesh is allocated, but no map vertex array is allocated. If <support> is false, and the channel support state is currently true, existing map channel face and vertex arrays are deallocated. If <support> and the current channel support state are both the same, no action is performed. SetNumMaps() is automatically called if the specified map channel is not available. <mapChannel> index values are 0-based, with Map channels 0 and 1 being the Vertex Color and default Texture Map channels.

polyOp.getMapSupport <Poly poly> <int mapChannel>

Returns whether the specified map channel is supported. This signifies that a map face array is present, but not necessarily a map vertex array.

polyOp.setNumMapVerts <Poly poly> <int mapChannel> <int count> keep:<boolean=false>

Sets the number of vertices for the map channel, initializing the map vertex array. If <keep> is false, the old map vertex information is discarded. If true, the old map vertex information is retained after the resize.

polyOp.getNumMapVerts <Poly poly> <int mapChannel>

Returns the number of vertices for the map channel as an <integer>.

polyOp.setNumMapFaces <Poly poly> <int mapChannel> <int count> keep:<boolean=false>

Sets the number of faces for the map channel. If keep is false, the old map face information is discarded. If true, the old map face information is retained after the resize. Dangerous to use with map channels 0 and 1.

polyOp.getNumMapFaces <Poly poly> <int mapChannel>

Returns the number of faces for the map channel as an <integer>.

polyOp.setMapVert <Poly poly> <int mapChannel> <int index> <Point3 uvw>

Sets the coordinates of the specified map vertex.

polyOp.getMapVert <Poly poly> <int mapChannel> <int index>

Returns the coordinates of the specified map vertex as a <point3>.

polyOp.setMapFace <Poly poly> <int mapChannel> <int map face index> <map vertex array>

Sets the map vertices for the specified map face.

polyOp.getMapFace <Poly poly> <int mapChannel> <int index>

Returns the vertex indices of the specified map face as an array.

polyOp.defaultMapFaces <Poly poly> <int mapChannel>

Allocates and initializes a basic planar map, or a white map for the vertex color hannel.

polyOp.applyUVWMap <Poly poly>

<#planar | #cylindrical | #spherical | #ball | #box> | <#face>

utile:<float=1.0> vtile:<float=1.0> wtile:<float=1.0>

uflip:<boolean=false> vflip:<boolean=false> wflip:<boolean=false>

cap:<boolean=true> tm:<Matrix3=identity matrix> channel:<integer=1>

Applies the specified mapping type to the mapping channel.

utile/vtile/wtile - Number of tiles in the U/V/W directions.

uflip/vflip/wflip - U/V/W are mirrored if true.

cap - used with #cylindrical. If true, then any face normal that is pointing more vertically than horizontally will be mapped using planar coordinates.

tm - defines the mapping space. As each point is mapped, it is multiplied by this matrix, and then it is mapped.

channel - the mapping channel the mapping is applied to, defaults to channel 1.

polyOp.getVertsByColor <Poly poly> <Color color> <Float red_thresh> <Float green_thresh> <Float blue_thresh>  channel:<int=0>

Returns the vertices whose vertex color is within the color range as a <bitarray>. The range values should be in the range of 0 to 255.

polyOp.getVertsByColor <Poly poly> <Point3 uvw> <Float u_thresh> <Float v_thresh> <Float w_thresh>  channel:<int=0>

Returns the vertices whose UVW is within the UVW range as a <bitarray>. The range values should be in the range of 0 to 1.

polyOp.setVertColor <Poly poly> <int mapChannel> <vertlist> <Color color>

Sets the vertex color for the specified vertices in the specified <mapChannel>.

polyOp.SetFaceColor <Poly poly> <int mapChannel> <facelist> <Color color>

Sets the vertex color for the vertices used by the specified faces in the specified <mapChannel>.

polyOp.setNumVDataChannels <Poly poly> <int count> keep:<boolean=true>

Sets the number of vertex data channels available. The number of vertex data channels can be set from 0 to 100.

If <keep> is false, the old channel data is discarded. If true, the old channel data is retained after the resize. The first ten channels for Discreet's use only.

channel 1: Soft Selection

channel 2: Vertex weights (for NURMS MeshSmooth)

channel 3: Vertex Alpha values

channel 4: Cornering values for subdivision use

polyOp.getNumVDataChannels <Poly poly>

Returns the number of vertex data channels available as an <integer>.

polyOp.setVDataChannelSupport <Poly poly> <int vdChannel> <boolean support>

Sets whether the specified vertex data channel is supported or not. <vdChannel> index values are 1-based, The first ten channels for Discreet's use only.

channel 1: Soft Selection

channel 2: Vertex weights (for NURMS MeshSmooth)

channel 3: Vertex Alpha values

channel 4: Cornering values for subdivision use

polyOp.getVDataChannelSupport <Poly poly> <int vdChannel>

Returns whether the specified vertex data channel is supported.

polyOp.getVDataValue <Poly poly> <int vdChannel> <int vertex_index>

Returns the floating point data value associated with vertex vertex_index in vertex data channel <vdChannel> as a <float>.

polyOp.setVDataValue <Poly poly> <int vdChannel> <vertlist> <float>

Sets the floating point data value associated with the specified vertices in vertex data channel <vdChannel>.

polyOp.freeVData <Poly poly> <int vdChannel>

polyOp.resetVData <Poly poly> <int vdChannel>

Deallocates the existing vertex data channel and turns off the vertex data channel support state. These methods do the exact same thing.

polyOp.setNumEDataChannels <Poly poly> <int count> keep:<boolean=true>

Sets the number of edge data channels available. The number of edge data channels can be set from 0 to 100.

If <keep> is false, the old channel data is discarded. If true, the old channel data is retained after the resize. The first two channels for Discreet's use only.

channel 1: edge knot data

channel 2: edge crease data

polyOp.getNumEDataChannels <Poly poly>

Returns the number of edge data channels available as an <integer>.

polyOp.setEDataChannelSupport <Poly poly> <int edChannel> <Boolean support>

Sets whether the specified edge data channel is supported or not. <edChannel> index values are 1-based, the first two channels for Discreet's use only.

channel 1: edge knot data

channel 2: edge crease data

polyOp.getEDataChannelSupport <Poly poly> <int edChannel>

Returns whether the specified edge data channel is supported.

polyOp.getEDataValue <Poly poly> <int edChannel> <int edge_index>

Returns the floating point data value associated with edge edge_index in edge data channel <edChannel> as a <float>.

polyOp.setEDataValue <Poly poly> <int edChannel> <edgelist> <float>

Sets the floating point data value associated with the specified edges in edge data channel <edChannel>.

polyOp.freeEData <Poly poly> <int edChannel>

resetEData <Poly poly> <int edChannel>

Deallocates the existing edge data channel and turns off the edge data channel support state. These methods do the exact same thing.