Interface: EditablePoly

The EditablePoly Interface has been added to the Editable_Poly class in 3ds Max 5

Editable_Poly interfaces:

Interface: EditablePoly

Methods:

Hide/Unhide

 

<bool>Hide <enum>mnSelLevel [flags:<DWORD>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Hide the sub-objects defined by flags in the specified sub-object level. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

 

<bool>unhideAll <enum>mnSelLevel

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

Unhide the specified sub-object level. The modify panel does not have to be in the same sub-object level for this method to have effect. Returns true on success.

Example:

p = convertToPoly(Plane()) --create a plane, convert to EPoly

polyop.setFaceSelection p #{1,2} --select the first two polygons

p.Hide #Face --hide the two polygons

sleep 1 --wait a second

p.UnHideAll #Face  --unhide all hidden faces again

Copy/Paste Named Selection Sets

<void>namedSelCopy <string>Name

Copy selection to the given name.

<void>namedSelPaste <bool>useRenameDialog

Paste named selection. When useRenameDialog is supplied as true, enables the Rename Dialog.

Create

<index>createVertex <point3>point [pointInLocalCoords:<bool>] [select:<bool>]

pointInLocalCoords default value: true

select default value: false

Create a new vertex with the specified coordinates. If the optional pointInLocalCoords argument is true, the coordinates are taken in local space. If the optional select argument is true, the new vertex will be selected after creation. Returns the index of the new vertex.

 

<index>createEdge <index>vertex1 <index>vertex2 [select:<bool>]

select default value: false

Create a new edge between the two specified vertices. If the optional select argument is true, the new edge will be selected after creation. Returns the index of the new edge.

Example:

p = convertToPoly(Plane()) --create a plane, convert to EPoly

p.createEdge 1 7 --create edge between vertices 1 and 7

EPoly_CreateEdge.gif

 

<index>createFace <index array>vertexArray [select:<bool>]

select default value: false

Creates a new face using the specified array of vertices. If the optional select argument is true, the new face will be selected after creation. Returns the index of the new face.

Example:

p = convertToPoly(Plane())    --create a plane, convert to EPoly

polyop.DeleteFaces p #(1)    --delete the first polygon

p.createFace #(1,6,5)  --create a new polygon on its place

 

EPoly_PolyOp_DeleteFaces.gif EPoly_CreateFace.gif

 

<bool>capHoles <enum>mnSelLevel [flags:<DWORD>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Create new faces to cap open edge loops. Acquire open edge loop defining the hole using the msSelLevel enums. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane()) --create a plane, convert to EPoly

polyop.DeleteFaces p #(6) --delete a polygon

--select all polygons surrounding the deleted one

polyop.SetFaceSelection p #(1,2,3,5,6,8,9,10)

select p --select the plane

max modify mode --switch to Modify panel

subObjectLevel = 4 --go to Face level to see the selection

p.capHoles #Face --cap the hole using the selection

 

EPoly_PolyOp_DeleteFaces_CapHoles.gif EPoly_PolyOp_SetFaceSelection_CapHoles.gif EPoly_CapHoles.gif

Delete

<bool>delete <enum>mnSelLevel [flags:<DWORD>] [deleteIsoVerts:<bool>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

deleteIsoVerts default value: true

Delete the sub-objects in the specified sub-object level. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

 

<bool>deleteIsoVerts()

Delete isolated vertices. Returns true on success.

Attach/Detach

 

<void>attach <node>nodeToAttach <node>myNode

Attach a node to the Editable_Poly object. The additional node provides the transformation of the node to be attached. You can use the nodeToAttach as myNode to use its own transforms.

Examples:

p = convertToPoly(Plane()) --create a plane, convert to EPoly

s = sphere radius:5 --create a sphere primitive

p.attach s s --attach sphere to EPoly

 

p = convertToPoly(Plane()) --create a plane, convert to EPoly

b = Box() --create a box primitive

b.rotation = eulerangles 45 45 0 --rotate the box

t = teapot radius:5 --create a teapot primitive

p.attach t b --attach teapot to EPoly using the box's transformation

 

<bool>detachToElement <enum>mnSelLevel [flags:<DWORD>] [keepOriginal:<bool>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

keepOriginal default value: false

Detach the sub-objects defined by flags in the specified sub-object level to element. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane()) --create a plane, convert to EPoly

polyop.SetFaceSelection p #(6) --select polygon 6

--Detach the selected polygon to element, keeping the original:

p.detachToElement #Face keepOriginal:true

Break/Split/Divide

<bool>splitEdges edgeFlags:<DWORD>

edgeFlags default value: 1

Split the edges defined by edgeFlags.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

 

<bool>breakVerts <DWORD>vertFlags

Break the vertices defined by edgeFlags.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

 

<index>divideFace <index>faceID <&float array>vertexCoefficients [select:<bool>]

vertexCoefficients is In and Out parameter

select default value: false

Divides the specified polygon using the vertexCoefficients to place the new edges. Returns the index of the new vertex. If select is true, the new vertex will be selected.

 

<index>insertVertexInFace <index>faceID <&float array>vertexCoefficients [select:<bool>]

vertexCoefficients is In and Out parameter

select default value: false

Insert a vertex inside the specified polygon. Returns the index of the new vertex.

Example:

p = convertToPoly(Plane()) --create a plane, convert to Epoly

--Insert new vertex in the middle of polygon 6.

--new_vert will contain the index of the newly created vertex:

new_vert = p.insertVertexInFace 6 #(0.5,0.0,0.5)

 

EPoly_InsertVertexInFace.gif

 

<index>divideEdge <index>edgeID <float>proportion [select:<bool>]

select default value: false

Divides the specified edge using the proportions for placement control. Returns the index of the new vertex. If select is true, the new vertex will be selected.

 

<index>insertVertexInEdge <index>edgeID <float>proportion [select:<bool>]

select default value: false

Inserts a vertex in the specified edge using the proportions for placement control. Returns the index of the new vertex. If select is true, the new vertex will be selected.

Example:

p = convertToPoly(Plane())    --create a plane, convert to Epoly

--Insert new vertex and split edge 17 at 1/3 of its edge.

--new_vert will contain the index of the newly created vertex:

new_vert = p.insertVertexInEdge 17 0.3

polyOp.setVertSelection #{new_vert} --select the new vertex

select p --select the plane

max modify mode --switch to modify panel

subObjectLevel = 1 --go to Vertex level and check it out

 

EPoly_InsertVertexInEdge.gif

Collapse

<bool>collapse <enum>mnSelLevel [flags:<DWORD>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Collapses the sub-objects defined by flags in the specified sub-object level. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane()) --create a plane, convert to Epoly

polyop.setVertSelection p #{7,8,12,13} --select some vertices

p.EditablePoly.collapse #Vertex --collapse the selected vertices

EPoly_SelectVertices_Collapse.gif EPoly_Collapse.gif

Extrude Faces

<void>extrudeFaces <float>amount [faceFlags:<DWORD>]

faceFlags default value: 1

Extrudes the polygons defined by faceFlags by the specified amount. By default uses flag 1 which means selected polygons.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

Sample Script:

--create a skyscraper-like structure through random extrusions

p = convertToPoly(Plane()) --create a plane, convert to Epoly

for i = 1 to 50 do --repeat 50 times

(

polyop.setFaceSelection p #{(random 1 16)} --select a random polygon

p.extrudeFaces 5.0 --extrude the selection

)

EPoly_ExtrudeFaces.gif

<bool>ExtrudeAlongSpline faceFlag:<DWORD>

faceFlag default value: 1

Extrude along spline the polygons defined by the flags. Returns true on success.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

 

<bool>HingeFromEdge faceFlag:<DWORD>

faceFlag default value: 1

Hinge from edge the polygons defined by the flags. Returns true on success.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

Bevel

<void>bevelFaces <float>height <float>outline [faceFlags:<DWORD>]

faceFlags default value: 1

Bevels the polygons defined by faceFlags using the specified amount and outline values. By default uses flag 1 which means selected polygons.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

--create a futuristic skyline through random bevels

p = convertToPoly(Plane()) --create a plane, convert to Epoly

for i = 1 to 50 do --repeat 50 times

(

polyop.setFaceSelection p #{(random 1 16)} --select a random polygon

p.bevelFaces 5.0 (random 0.0 -1.0) --randomly bevel the selection

)

EPoly_BevelFaces.gif

Chamfer

<void>chamferVertices <float>amount open:<bool>

open default value: false

Chamfer the selected vertices using the specified amount.

If the optional open: keyword is supplied and set to true, the new faces generated by the chamfer operation will be removed, leaving an opening. Available in 3ds Max 8 and higher.

Example:

p = convertToPoly(Plane()) --create a plane, convert to Epoly

polyop.setVertSelection p #{1,5,21,25} --select the corner vertices

p.EditablePoly.chamferVertices 5.0 --chamfer the selection

 

<void>chamferEdges <float>amount open:<bool>

open default value: false

Chamfers the selected edges using the specified amount.

If the optional open: keyword is supplied and set to true, the new faces generated by the chamfer operation will be removed, leaving an opening. Available in 3ds Max 8 and higher.

Example:

p = convertToPoly(Plane()) --create a plane, convert to Epoly

polyop.setEdgeSelection p #{7,10} --select two side edges

p.EditablePoly.chamferEdges 5.0 --chamfer the selection

 

EPoly_SelectCorners_ChamferVertices.gif EPoly_ChamferVertices.gif

Bridge

<bool>Bridge selLevel:<enum> flag:<DWORD>

selLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

selLevel default value: #CurrentLevel

flag default value: 1

Creates a bridge using the specified selection level and flags. Returns true on success, false otherwise.

Note:

There are a number of Properties controlling the result of the the Bridge method. See Editable_Poly New Properties in 3ds Max 7 for details.

example:

b = box() --create a box

b.heightsegs = b.widthsegs = b.lengthsegs = 5 --set segments to 5

convertToPoly(b) --convert to Editable Poly

--select the central faces on both sides of the box:

polyOp.setFaceSelection b #{57..59, 62..64, 67..69, 107..109, 112..114, 117..119}

b.bridgeSegments = 5 --set the bridge segments property to 5

b.bridge selLevel:#Face --bridge the selected polygons

 

EPoly_Bridge_FaceSelection.gif EPoly_Bridge.gif

 

<bool>ReadyToBridgeFlagged selLevel:<enum> flag:<DWORD>

selLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

selLevel default value: #CurrentLevel

flag default value: 1

Returns true if the specified selection level and flags are ready to be bridged, false otherwise.

 

Relax

<bool>Relax selLevel:<enum> flag:<DWORD>

selLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

selLevel default value: #CurrentLevel

flag default value: 1

Relaxes the vertices using the specified selection level and flags. Returns true on success, false otherwise.

Note:

There are a number of Properties controlling the result of the the Relax method. See Editable_Poly New Properties in 3ds Max 7 for details.

Example:

b = box() --create a box

b.heightsegs = b.widthsegs = b.lengthsegs = 5 --set segments to 5

convertToPoly(b) --convert to Editable Poly

b.relaxAmount = 1.5 --set the relax amount property to 1.5

b.relax selLevel:#Object --relax the whole mesh

b2 = box() --create another box

b2.heightsegs = b2.widthsegs = b2.lengthsegs = 5 --set segments to 5

convertToPoly(b2) --convert to Editable Poly

b2.relaxAmount = -1.5 --set the relax amount property to -1.5

b2.pos = [40,0,0] --place the box 40 units from the first one

b2.relax selLevel:#Object --relax the whole mesh

 

EPoly_Relax.gif

 

Slice

<bool>slice <point3>slicePlaneNormal <point3>slicePlaneCenter [flaggedFacesOnly:<bool>] [faceFlags:<DWORD>]

flaggedFacesOnly default value: false

faceFlags default value: 1

Slices using a slice plane defined by the normal vector and center. Both values are specified in local coordinates.

When flaggedFacesOnly is set to true, only polygons specified by faceFlags will be affected (by default flag is 1, in other words, selected polygons). Operates by default on the whole EditablePoly object. Returns true on success.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

--create a box, convert to Epoly

p = convertToPoly(Box())

--slice using a diagonal plane at height 10

p.slice [0,1,1] [0,0,10]

--select a side polygon

polyop.setFaceSelection p #{3}

--slice the selected polygon only using a horizontal plane at height 15

p.slice [0,0,1] [0,0,15] flaggedFacesOnly:true

EPoly_Slice_All.gif EPoly_Slice_Selection.gif EPoly_Slice_SelectedOnly.gif

 

<bool>inSlicePlaneMode()

Returns true if the EditablePoly is in slice plane mode.

Cut

<index>cutVertices <index>startVertex <point3>endPosition <point3>viewDirection

Cut using a plane defined by the start vertex, the specified point and the view direction.

 

<index>cutEdges <index>startEdge <float>startProportion <index>endEdge <float>endProportion <point3>viewDirection

Cut using a plane defined by the point specified by the two edges and proportions and the view direction.

 

<index>cutFaces <index>startFace <point3>startPosition <point3>endPosition <point3>viewDirection

Cut using a plane defined by the point specified by the two face positions and the view direction.

Weld

<bool>weldVerts <index>vertex1 <index>vertex2 <point3>destinationPoint

Weld the two specified vertices and move the resulting vertex to the specified position. Returns true on success.

 

<bool>weldEdges <index>edge1 <index>edge2

Weld the two specified edges. Returns true on success.

 

<bool>weldFlaggedVertices [vertexFlags:<DWORD>]

vertexFlags default value: 1

Weld the vertices defined by the supplied flags. Returns true on success.

Note:

See polyOp.getVertsByFlag for descriptions of the flag bits.

 

<bool>weldFlaggedEdges [edgeFlags:<DWORD>]

edgeFlags default value: 1

Weld the edges defined by the supplied flags. Returns true on success.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

Create Shape from edges

<bool>createShape <string>shapeName <bool>curved <node>myNode edgeFlags:<DWORD>

edgeFlags default value: 1

Create a shape from the edges defined by the supplied flags. Returns true on success.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

 

Make Planar

 

<bool>makePlanar <enum>mnSelLevel [flags:<DWORD>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Make the sub-objects defined by flags in the specified sub-object level planar. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

 

<bool>moveToPlane <point3>planeNormal <float>planeOffset <enum>mnSelLevel flags:<DWORD>

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Move the sub-objects defined by flags in the specified sub-object level to the specified plane. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane()) --create a plane, convert to Epoly

polyop.setVertSelection p #{7,8,12,13} --select some vertices

p.movetoplane [0,0,1] 5.0 #Vertex --move 5.0 units along +Z

EPoly_SelectVertices_Collapse.gif EPoly_MoveToPlane.gif

 

<bool>alignToGrid <enum>mnSelLevel [flags:<DWORD>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Align the sub-objects defined by flags in the specified sub-object level to the active grid. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Box()) --create a Box, convert to Epoly

polyop.setVertSelection p #{5,6} --select two top vertices

select p --select the EPoly

p.AlignToGrid #Vertex --align vertices to current grid

 EPoly_AlignToGrid_Selection.gif EPoly_AlignToGrid.gif

 

<bool>alignToView <enum>mnSelLevel [flags:<DWORD>]

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Align the sub-objects defined by flags in the specified sub-object level to the active view. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane()) --create a plane, convert to Epoly

polyop.setVertSelection p #{7,8,12,13} --select some vertices

p.EditablePoly.alignToView #Vertex --align to current view

 

<bool>MakePlanarIn <enum>axis selLevel:<enum> flag:<DWORD>

axis enums: {#X|#Y|#Z}

selLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

selLevel default value: #CurrentLevel

flag default value: 1

Makes the elements in the given sub-level specified by the flag bits planar relatively to the specified axis.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

 

Subdivide

<bool>meshSmooth <enum>mnSelLevel flags:<DWORD>

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Apply MeshSmooth the sub-objects defined by flags in the specified sub-object level. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Box()) --create a Box, convert to Epoly

polyop.setVertSelection p #{1} --select a vertex

--apply meshSmooth 3 times to the selected vertex:

for i = 1 to 3 do p.meshSmooth #Vertex

EPoly_MeshSmooth_Selection.gif EPoly_MeshSmooth_Vertex_1.gif EPoly_MeshSmooth_Vertex_2.gif EPoly_MeshSmooth_Vertex.gif

 

<bool>tessellate <enum>mnSelLevel flags:<DWORD>

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

flags default value: 1

Tessellate the sub-objects defined by flags in the specified sub-object level. Returns true on success.

Example:

p = convertToPoly(Box()) --create a Box, convert to Epoly

polyop.setVertSelection p #{1} --select a vertex

--apply tessellate 3 times to the selected vertex:

for i = 1 to 3 do p.tessellate #Vertex

EPoly_MeshSmooth_Selection.gif EPoly_Tessellate_Vertex_1.gif EPoly_Tessellate_Vertex_2.gif EPoly_Tessellate_Vertex_3.gif

 

<void>forceSubdivision()

Force subdivision.

Triangulation

<void>setDiagonal <index>face <index>corner1 <index>corner2

Set a diagonal in the specided face from corner1 to corner2.

 

<bool>retriangulate <DWORD>faceFlags

Retriangulate the faces defined by faceFlags. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

 

<bool>TurnDiagonal <index>face <index>diagonal

Turn the indexed diagonal of the indexed face.

 

<bool>flipNormals <DWORD>faceFlags

Flip the normals of the faces defined by faceFlags. Returns true on success.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

 

Select Faces By...

<void>selectByMaterial <index>materialID [clearCurrentSelection:<bool>]

clearCurrentSelection default value: true

Select the faces with the specified materialID. If the optional clearCurrentSelection is set to false, the existing selection will be kept.

 

<void>selectBySmoothGroup <DWORD>smoothingGroups [clearCurrentSelection:<bool>]

clearCurrentSelection default value: true

Select the faces with the specified smoothing groups. If the optional clearCurrentSelection is set to false, the existing selection will be kept.

 

<void>autosmooth()

Generate smoothing groups automatically based on face angles.

UI Commands

<void>buttonOp <enum>buttonOpID

buttonOpID enums: {

#GrowSelection | #ShrinkSelection | #SelectEdgeLoop

| #SelectEdgeRing | #HideSelection | #HideUnselected

| #UnhideAll | #NamedSelectionCopy | #NamedSelectionPaste

| #Cap | #Delete | #Remove

| #Detach | #AttachList | #SplitEdges

| #BreakVertex | #Collapse | #ResetSlicePlane

| #Slice | #WeldSelected | #CreateShape

| #MakePlanar | #AlignGrid | #AlignView

| #RemoveIsoVerts | #MeshSmooth | #Tessellate

| #Update | #SelectByVertexColor | #Retriangulate

| #FlipNormals | #SelectByMatID | #SelectBySmoothingGroups

| #Autosmooth | #ClearSmoothingGroups| #Extrude

| #Bevel | #Inset | #Outline

| #ExtrudeAlongSpline | #HingeFromEdge | #ConnectEdges

| #ConnectVertices | #Chamfer | #Cut

| #RemoveIsoMapVerts | #ToggleShadedFaces

| #MakePlanarInX | #MakePlanarInY |#MakePlanarInZ }

Presses the specified Editable_Poly UI button.

Example:

p = convertToPoly(Plane()) --create a Box, convert to Epoly

polyop.setFaceSelection p #{6} --select a single polygon

select p --select the object

max modify mode --go to modify panel

subobjectlevel = 4 --go to polygon sub-object level

p.ButtonOp #GrowSelection --grow the selection

 

<void>toggleCommandMode <enum>commandModeID

commandModeID enums: {

#CreateVertex | #CreateEdge | #CreateFace

| #DivideEdge | #DivideFace | #ExtrudeVertex

| #ExtrudeEdge | #ExtrudeFace | #ChamferVertex

| #ChamferEdge | #Bevel | #SlicePlane

| #CutVertex | #CutEdge | #CutFace

| #Weld | #EditTriangulation | #InsetFace

| #QuickSlice | #HingeFromEdge | #PickLiftEdge

| #OutlineFace }

 

Presses the specified Editable_Poly UI button to enter a command mode.

 

<void>enterPickMode <enum>pickModeID

pickModeID enums: {#Attach|#PickShape}

Presses the button to enter the specified pick mode.

 

<void>exitCommandModes()

Exits any active command mode.

 

Get/Set By Flag

<bool>getVerticesByFlag <&bitArray>vertexSet <DWORD>flagsRequested [flagMask:<DWORD>]

vertexSet is In and Out parameter

flagMask default value: 0

Returns true on success.

Each vertex in a poly contains a 32 bit flag variable. This method returns a by-reference bitarray of the vertices that have specific bits in this flag variable set, where the bits being tested are based on a combination of <flagsRequested> and <flagMask>.

Internally, if <flagMask> is 0 then <flagMask> is set to the <flagsRequested> value, otherwise <flagsRequested> is set to the bitwise-AND of <flagsRequested> and <flagMask>. Bit 2 of <flagMask> is then set, which prevents dead vertices from being included in the resulting bitarray unless this bit was set in <flagMask>. Each bit in the resulting bitarray is set if the bitwise-AND of the flag variable and <flagMask> is equal to the bitwise-AND of <flagsRequested> and <flagMask>.

Note:

See polyOp.getVertsByFlag for descriptions of the flag bits.

Example:

my_array= #{} --define an empty bitarray

b = bit.Set 0 1 true --set the first bit to true

--now call the function and supply the empty array as

--In parameter by reference and the flag bit to filter out

$.getVerticesByFlag &my_array b

--Now look at the content of the bitarray -

--it will contain the vertices that have their first flag bit set

--(bit 1 stands for selected, so it will contain the vertex selection)

print my_array 

 

<bool>getEdgesByFlag <&bitArray>edgeSet <DWORD>flagsRequested [flagMask:<DWORD>]

edgeSet is In and Out parameter

flagMask default value: 0

Get all edges whose flag bits are set to the ones supplied by flagsRequested. Returns true on success.

Each edge contains a 32 bit flag variable. This method returns a by-reference bitarray of the edges that have specific bits in this flag variable set, where the bits being tested are based on a combination of <flagsRequested> and <flagMask>.

Internally, if <flagMask> is 0 then <flagMask> is set to the <flagsRequested> value, otherwise <flagsRequested> is set to the bitwise-AND of <flagsRequested> and <flagMask>. Bit 2 of <flagMask> is then set, which prevents dead edges from being included in the resulting bitarray unless this bit was set in <flagMask>. Each bit in the resulting bitarray is set if the bitwise-AND of the flag variable and <flagMask> is equal to the bitwise-AND of <flagsRequested> and <flagMask>.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

Example:

my_array= #{}    --define an empty bitarray

b = bit.Set 0 1 true  --set the first bit to true

--now call the function and supply the empty array as

--In parameter by reference and the flag bit to filter out

$.getEdgesByFlag &my_array b

--Now look at the content of the bitarray:

--it will contain the edges that have their first flag bit set

--(bit 1 stands for selected, so it will contain the edge selection)

print my_array 

 

<bool>getFacesByFlag <&bitArray>faceSet <DWORD>flagsRequested [flagMask:<DWORD>]

faceSet is In and Out parameter

flagMask default value: 0

Returns true on success.

Each face contains a 32 bit flag variable. This method returns a by-reference bitarray of the faces that have specific bits in this flag variable set, where the bits being tested are based on a combination of <flagsRequested> and <flagMask>.

Internally, if <flagMask> is 0 then <flagMask> is set to the <flagsRequested> value, otherwise <flagsRequested> is set to the bitwise-AND of <flagsRequested> and <flagMask>. Bit 2 of <flagMask> is then set, which prevents dead faces from being included in the resulting bitarray unless this bit was set in <flagMask>. Each bit in the resulting bitarray is set if the bitwise-AND of the flag variable and <flagMask> is equal to the bitwise-AND of <flagsRequested> and <flagMask>.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

my_array= #{}    --define an empty bitarray

b = bit.Set 0 1 true  --set the first bit to true

--now call the function and supply the empty array as

--In parameter by reference and the flag bit to filter out

$.getFacesByFlag &my_array b

--Now look at the content of the bitarray:

--it will contain the faces that have their first flag bit set

--(bit 1 stands for selected, so it will contain the face selection)

print my_array 

 

<void>setVertexFlags <&bitArray>vertexSet <DWORD>flagsToSet [flagMask:<DWORD>] generateUndoRecord:<bool>

vertexSet is In and Out parameter

flagMask default value: 0

Set the flag bits of the vertices supplied by the vertexSet bitarray to the bits supplied by flagsToSet.

Note:

See polyOp.getVertsByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane())  --create a plane, convert to Epoly

my_array= #{1,2,3,4}    --define an bitarray with some bits set

b = bit.Set 0 1 true    --set the first bit to true

--now call the function and supply the array as

--In parameter by reference and the flag bit to get

p.setVertexFlags &my_array b

--Since flag bit 1 stands for selected, the above will basically select

--the first 4 vertices in the EditablePoly by setting the

--corresponding flag bits. So let's take a look:

select p       --select the plane

max modify mode     --go to modify panel

subObjectLevel = 1   --set sub-object level to vertex -

--the first 4 vertices should be selected

 

 

<void>setEdgeFlags <&bitArray>edgeSet <DWORD>flagsToSet [flagMask:<DWORD>] generateUndoRecord:<bool>

edgeSet is In and Out parameter

flagMask default value: 0

Set the flag bits of the edges supplied by the edgeSet bitarray to the bits supplied by flagsToSet.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane())  --create a plane, convert to Epoly

my_array= #{1,2,3,4}    --define an bitarray with some bits set

b = bit.Set 0 1 true    --set the first bit to true

--now call the function and supply the array as

--In parameter by reference and the flag bit to get

p.setEdgeFlags &my_array b

--Since flag bit 1 stands for selected, the above will basically select

--the first 4 vertices in the EditablePoly by setting the

--corresponding flag bits. So let's take a look:

select p       --select the plane

max modify mode     --go to modify panel

subObjectLevel = 2   --set sub-object level to edge -

--the first 4 edges should be selected

 

<void>setFaceFlags <&bitArray>faceSet <DWORD>flagsToSet [flagMask:<DWORD>] generateUndoRecord:<bool>

faceSet is In and Out parameter

flagMask default value: 0

Set the flag bits of the faces supplied by the faceSet bitarray to the bits supplied by flagsToSet.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

Example:

p = convertToPoly(Plane())  --create a plane, convert to Epoly

my_array= #{1,2,3,4}    --define an bitarray with some bits set

b = bit.Set 0 1 true    --set the first bit to true

--now call the function and supply the array as

--In parameter by reference and the flag bit to get

p.setFaceFlags &my_array b

--Since flag bit 1 stands for selected, the above will basically select

--the first 4 vertices in the EditablePoly by setting the

--corresponding flag bits. So let's take a look:

select p       --select the plane

max modify mode     --go to modify panel

subObjectLevel = 4   --set sub-object level to face -

--the first 4 faces should be selected

 

Slice Plane

<void>resetSlicePlane()

Reset the slice plane transformations to their defaults.

 

<void>getSlicePlane <&point3>planeNormal <&point3>planeCenter <*float>planeSize

planeNormal is In and Out parameter

planeCenter is In and Out parameter

planeSize is In and Out parameter

Get the orientation, center and size of the slice plane.

Example:

--Define variables to hold the Out parameters:

plane_normal = Point3 0 0 0

plane_center = Point3 0 0 0

plane_size = 1.0

--Call the function and supply the variables by reference as In parameters

$.getSlicePlane &plane_normal &plane_center &plane_size

--The variables will now contain the actual values of the slice plane:

plane_normal

plane_center

plane_size

 

<void>setSlicePlane <&point3>planeNormal <&point3>planeCenter <float>planeSize

planeNormal is In and Out parameter

planeCenter is In and Out parameter

Set the orientation, center and size of the slice plane.

Example:

--Define variables to hold the In parameters:

plane_normal = Point3 0 1 0

plane_center = Point3 5 5 6

--Call the function and supply the variables by reference as In parameters

$.setSlicePlane &plane_normal &plane_center 20.0

--The slice plane transforms should have changed

 

Get/Set Data

<float>getVertexData <integer>vertexDataChannel <*integer>numberSelected <*bool>uniformData [vertexFlags:<DWORD>]

numberSelected is In and Out parameter

uniformData is In and Out parameter

vertexFlags default value: 1

Get the vertex data stored in the specified vertexDataChannel. The number of vertices with stored values in this channel will be written to the passed by reference variable numberSelected. If all vertices contain the same value, the passed by reference boolean variable uniformData will contain true, otherwise false. If vertexFlags is specified, only values from the flagged vertices will be read. Returns the value stored in the first vertex encountered (e.g. the vertex with lower index)

Note:

See polyOp.getVertsByFlag for descriptions of the flag bits.

 

<float>getEdgeData <integer>edgeDataChannel <*integer>numberSelected <*bool>uniformData [edgeFlags:<DWORD>]

numberSelected is In and Out parameter

uniformData is In and Out parameter

edgeFlags default value: 1

Get the edge data stored in the specified edgeDataChannel. The number of edges with stored values in this channel will be written to the passed by reference variable numberSelected. If all edges contain the same value, the passed by reference boolean variable uniformData will contain true, otherwise false. If edgeFlags is specified, only values from the flagged edges will be read. Returns the value of the first edge encountered (e.g. the edge with lower index)

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

 

<void>setVertexData <integer>vertexDataChannel <float>value vertexFlags:<DWORD>

vertexFlags default value: 1

Set the vertex data stored in the specified vertexDataChannel to the provided value. If vertexFlags is specified, only flagged vertices will be affected.

Note:

See polyOp.getVertsByFlag for descriptions of the flag bits.

 

<void>setEdgeData <integer>edgeDataChannel <float>value [edgeFlags:<DWORD>]

edgeFlags default value: 1

Set the edge data stored in the specified edgeDataChannel to the provided value. If edgeFlags is specified, only flagged edges will be affected.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

 

Example:

p = convertToPoly(Plane())

$Editable_Poly:Plane01 @ [0.000000,0.000000,0.000000]

polyop.setVertSelection p #{1,2} --select vertices 1 and 2

OK

numsel = 1 --define a variable to pass by reference

1 --it will contain the number of vertices

uniform = false --define a boolean var. for uniformity

false --will be true when values are uniform

p.getVertexData 1 &numsel &uniform --check default values

1.0    --default value returned is 1.0

numsel --look at the selection number again

2 --two vertices were encountered

uniform --check the uniformity

true --both vertices had the same value

p.setVertexData 1 100.0 --now change values to 100.0

OK

p.getVertexData 1 &numsel &uniform --and read it back

100.0 --the value has changed!

numsel --look at the selection number again

2 --still two vertices encountered

uniform --check the uniformity

true --both vertices still have the same value

polyop.setVertSelection p #{3} --select vertex 3 alone

OK

p.setVertexData 1 200.0 --change value to 200.0

OK

p.getVertexData 1 &numsel &uniform --get the value

200.0 --it is 200.0 as desired

polyop.setVertSelection p #{1,2,3} --select all 3 vertices

OK

p.getVertexData 1 &numsel &uniform --get all 3 values

100.0 --result is 100.0 because vert.1 is the first encountered

numsel --check how many vertices have been selected

3 --we selected 3 and there were actually 3

uniform --were the values uniform?

false --we have two 100.0 and one 200.0 value, not uniform

<void>resetVertexData <integer>vertexDataChannel

Reset the vertex data stored in the specified vertexDataChannel.

 

<void>resetEdgeData <integer>edgeDataChannel

Reset the vertex data stored in the specified edgeDataChannel.

 

<void>beginModifyPerData <enum>mnSelLevel <integer>dataChannel

mnSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

Puts the EditablePoly object into ModifyPerData state. This makes all changes to the specified sub-object level and dataChannel conditional. At the end of the data changes, endModifyPerData has to be called with a boolean parameter to commit or discard the changes.

 

<bool>inModifyPerData()

Returns true if the object is currently in ModfyPerData state.

 

<void>endModifyPerData <bool>success

Exits the ModifyPerData state. If true is supplied for success, the changes will be commited. If false is supplied for success, the changes will be discarded. See also beginModifyPerData.

Example:

p = convertToPoly(Plane())

$Editable_Poly:Plane01 @ [0.000000,0.000000,0.000000]

polyop.setVertSelection p #{1,2} --select vertices 1 and 2

OK

numsel = 1 --define a variable to pass by reference

1 --it will contain the number of vertices

uniform = false --define a boolean var. for uniformity

false --will be true when values are uniform

p.getVertexData 1 &numsel &uniform --check default values

1.0    --default value returned is 1.0

p.beginModifyPerData #vertex 1 --begin Modify Data state

OK

p.setVertexData 1 100.0 --change values to 100.0

OK

p.endModifyPerData false --end Modify state, say it failed

OK

p.getVertexData 1 &numsel &uniform --check the value

1.0 --the value has NOT changed!

p.beginModifyPerData #vertex 1 --again Modify Data state

OK

p.setVertexData 1 100.0 --change values to 100.0

OK

p.endModifyPerData true --end Modify state with success!

OK

p.getVertexData 1 &numsel &uniform --check the value

100.0 --the value has changed as we notified success!

 

<index>getMaterialIndex <*bool>determined

determined is In and Out parameter

Returns the material ID.

 

<void>setMaterialIndex <index>index <DWORD>faceFlags

Set the material ID of the faces specified by the supplied flags.

 

<void>getSmoothingGroups <DWORD>faceFlag <*DWORD>anyFaces <*DWORD>allFaces

anyFaces is In and Out parameter

allFaces is In and Out parameter

Get the smoothing groups of the specified faces.

 

<void>setSmoothingGroups <DWORD>bitValues <DWORD>bitMask <DWORD>faceFlags

Set the smoothing groups of the specified faces.

 

<void>collapseDeadStructures()

Collapses all dead structures.

 

<integer>propogateComponentFlags <enum>mnSelLevelTo <DWORD>flagSetTo <enum>mnSelLevelFrom <DWORD>flagTestFrom [allBitsMustMatch:<bool>] [set:<bool>] [undoable:<bool>]

mnSelLevelTo enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

mnSelLevelFrom enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

allBitsMustMatch default value: false

set default value: true

undoable default value: false

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

 

Preview Mode

<void>PreviewBegin <enum>previewOperation

previewOperation enums: {

#GrowSelection | #ShrinkSelection | #SelectEdgeLoop

| #SelectEdgeRing | #HideSelection | #HideUnselected

| UnhideAll | #NamedSelectionCopy | #NamedSelectionPaste

| #Cap | #Delete | #Remove

| #Detach | #AttachList | #SplitEdges

| #BreakVertex | #Collapse | #ResetSlicePlane

| #Slice | #WeldSelected | #CreateShape

| #MakePlanar | #AlignGrid | #AlignView

| #RemoveIsoVerts | #MeshSmooth | #Tessellate

| #Update | #SelectByVertexColor | #Retriangulate

| #FlipNormals | #SelectByMatID | #SelectBySmoothingGroups

| #Autosmooth | #ClearSmoothingGroups | #Extrude

| #Bevel | #Inset | #Outline

| #ExtrudeAlongSpline | #HingeFromEdge | #ConnectEdges

| #ConnectVertices | #Chamfer | #Cut

| #RemoveIsoMapVerts | #ToggleShadedFaces

| #MakePlanarInX | #MakePlanarInY |#MakePlanarInZ}

 

Preview the specified operation. Lets you create interactive dialogs for manipulating sub-object selections in realtime.

Example:

--The following script creates a plane and a small menu to interactively

--extrude selected polygons.

p = convertToPoly(Plane())     --create a plane, turn to Epoly.

select p --select the plane

max modify mode --enter Modify panel

subobjectlevel = 4 --set Sub-Object mode to Polygon

rollout extrude_faces "Extrude" --define a rollout

(

button try_it "Preview" across:3 --a button to start a new extrusion

button cancel_it "Cancel" --a button to cancel preview

button accept_it "Accept" --a button to accept the extrusion

on cancel_it pressed do p.previewCancel() --cancel

on accept_it pressed do p.previewAccept() --accept

on try_it pressed do p.previewBegin #Extrude --begin again

)

createDialog extrude_faces 200 30 --create a dialog with the rollout

--Run the script, select some polygons, press Preview

--and watch them extrude interactively.

--Press Accept if you like the result, press Cancel to discard.

--Press Preview again for next extrusion etc.

 

<void>PreviewCancel()

Cancel the interactive preview.

<void>PreviewAccept()

Accept the interactive preview results.

<void>PreviewInvalidate()

Invalidates the preview results.

<bool>PreviewOn()

Enables preview mode.

<void>PreviewSetDragging <bool>dragging

Enables/Disables preview dragging.

<bool>PreviewGetDragging()

Returns true if preview dragging is enabled, false otherwise.

 

<bool>PopupDialog <enum>popupOperation

popupOperation enums:

{ #GrowSelection | #ShrinkSelection | #SelectEdgeLoop

| #SelectEdgeRing | #HideSelection | #HideUnselected

| #UnhideAll | #NamedSelectionCopy | #NamedSelectionPaste

| #Cap | #Delete | #Remove

| #Detach | #AttachList | #SplitEdges

| #BreakVertex | #Collapse | #ResetSlicePlane

| #Slice | #WeldSelected | #CreateShape

| #MakePlanar | #AlignGrid | #AlignView

| #RemoveIsoVerts | #MeshSmooth | #Tessellate

| #Update | #SelectByVertexColor | #Retriangulate

| #FlipNormals | #SelectByMatID | #SelectBySmoothingGroups

| #Autosmooth | #ClearSmoothingGroups | #Extrude

| #Bevel | #Inset | #Outline

| #ExtrudeAlongSpline | #HingeFromEdge | #ConnectEdges

| #ConnectVertices | #Chamfer | #Cut

| #RemoveIsoMapVerts | #ToggleShadedFaces

| #MakePlanarInX | #MakePlanarInY |#MakePlanarInZ }

 

Push the popup dialog's button for the specified interactive operation.

 

<void>ClosePopupDialog()

Close the popup dialog

 

<void>RepeatLastOperation()

Repeat the last operation in the current sub-object level.

 

Convert Selection

<void>GrowSelection selLevel:<enum>

selLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

selLevel default value: #CurrentLevel

Grow the selection in the specified sub-object level.

 

<void>ShrinkSelection selLevel:<enum>

selLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

selLevel default value: #CurrentLevel

Shrink the selection in the specified sub-object level.

 

<integer>ConvertSelection <enum>fromSelLevel <enum>toSelLevel [requireAll:<bool>]

fromSelLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

toSelLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

requireAll default value: false

Convert the selection from the specified source sub-object level to the specified target sub-object level. Returns the number of selected target sub-object elements.

 

<void>SelectBorder()

Select the borders containing the currently selected edges.

 

<void>SelectElement()

Select the elements containing the currently selected faces.

 

<void>SelectEdgeLoop()

Select the edge loops containing the currently selected edges.

 

<void>SelectEdgeRing()

Select the edge rings using the currently selected edges.

 

<void>setRingShift <integer>RingShiftValue <bool>MoveOnly <bool>Add

Moves the Ring selection. Available in 3ds Max 8 and higher.

RingShiftValue is the quantity of edges to shift. If MoveOnly is true, the selected edges will be moved, If Add is true and MoveOnly is true, newly selected edges will be added to the current selection. If MoveOnly is true and Add is false, newly selected edges will be removed to the current selection.

 

<void>setLoopShift <integer>LoopShiftValue <bool>MoveOnly <bool>Add

Moves the Loop selection. Available in 3ds Max 8 and higher.

LoopShiftValue is the quantity of edges to shift. If MoveOnly is true, the selected edges will be moved, If Add is true and MoveOnly is true, newly selected edges will be added to the current selection. If MoveOnly is true and Add is false, newly selected edges will be removed to the current selection.

 

<integer>ConvertSelectionToBorder <enum>fromSelLevel <enum>toSelLevel

fromSelLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

toSelLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

Converts the current selection to border selection. The first argument represent the sub-object type to convert from, the second one represents the sub-object type to convert to. Available in 3ds Max 8 and higher.

 

Remove

<bool>Remove selLevel:<enum> flag:<DWORD>

selLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

selLevel default value: #CurrentLevel

flag default value: 1

Remove the sub-objects defined by flags from the specified sub-object level. Returns true on success.

Note:

See polyOp.getVertsByFlag, polyOp.getEdgesByFlag and polyOp.getFacesByFlag for descriptions of the flag bits.

Examples:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

polyop.setVertSelection p #{13} --select a vertex

p.EditablePoly.Remove selLevel:#Vertex

 

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

polyop.setVertSelection p #{13} --select a vertex

select p --select object

subobjectlevel = 1 --change to vertex level

p.Remove () --remove the current selection

 

<bool>DeleteIsoMapVerts()

Delete the isolated vertices. Returns true on success.

 

Connect

 

<bool>Outline [faceFlag:<DWORD>]

faceFlag default value: 1

Outline the polygons defined by the flags. Returns true on success.

Note:

See polyOp.getFacesByFlag for descriptions of the flag bits.

 

<bool>ConnectEdges edgeFlag:<DWORD>

edgeFlag default value: 1

Connect the edges defined by the flags. Returns true on success.

Note:

See polyOp.getEdgesByFlag for descriptions of the flag bits.

 

<bool>ConnectVertices vertexFlag:<DWORD>

vertexFlag default value: 1

Connect the vertices defined by the flags. Returns true on success.

Note:

See polyOp.getVertsByFlag for descriptions of the flag bits.

 

Toggle Shaded Faces

<void>ToggleShadedFaces()

Toggles shaded polygons.

 

Get/Set Selections

<enum>GetEPolySelLevel()

GetEPolySelLevel enums: {#Object|#Vertex|#Edge|#Border|#Face|#Element|#CurrentLevel}

Returns the EditablePoly selection level set in the Modify panel.

 

<enum>GetMeshSelLevel()

GetMeshSelLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

Returns the mesh selection level, this means the sub-object that can be selected in the current sub-object level. Edge and Border sub-object levels both return #Edge, Polygon and Element sub-object levels both return #Face.

 

<bitArray>GetSelection <enum>selectionLevel

selectionLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

Returns the selection from the specified sub-object level as bitarray

 

<void>SetSelection <enum>selectionLevel <bitArray>selection

selectionLevel enums: {#Object|#Vertex|#Edge|#Face|#CurrentLevel}

Set the selection in the specified sub-object level using a bitarray.

Examples:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

p.SetSelection #Face #{1,2,3} --select polygons 1,2 and 3

p.SetSelection #Vertex #{1,2,3} --select vertices 1,2 and 3

 

Get Vertex

<integer>GetNumVertices()

Returns the number of vertices in the EditablePoly.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

num_vert = p.GetNumVertices() --num_vert will contain 25

 

<point3>GetVertex <index>vertexID

Returns the coordinates of the vertex with the specified index.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

--loop through all vertices in the plane and print

--the coordinates of each one of them:

for i = 1 to p.GetNumVertices() do

print (p.GetVertex i)

 

<integer>GetVertexFaceCount <index>vertexID

Returns the coordinates of the vertex with the specified index.

Example:

p = convertToPoly(Plane())    --create a Plane, convert to Epoly

--loop through all vertices in the plane and print the number

--of polygons that are using each of them:

for i = 1 to p.GetNumVertices() do

print (p.GetVertexFaceCount i)

 

<index>GetVertexFace <index>vertexID <index>face

Returns the face index of the Nth polygon sharing the specified vertex (where N is between 1 and the number of polygons using the vertex). If the face argument is higher than the number of polygon sharing the vertex, the function will return 0.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

--Print the indices of all faces sharing vertex 13 in the plane.

for i = 1 to (p.EditablePoly.GetVertexFaceCount 13) do

print (p.EditablePoly.GetVertexFace 13 i)

 

<integer>GetVertexEdgeCount <index>vertexID

Returns the number of edges sharing the specified vertex.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

p.GetVertexEdgeCount 1 --returns 2 for a corner vertex

p.GetVertexEdgeCount 2 --returns 3 for a side vertex

p.GetVertexEdgeCount 13 --returns 4 for an inside vertex

 

<index>GetVertexEdge <index>vertexID <index>edge

Returns the edge index of the Nth edge sharing the specified vertex. (where N is between 1 and the number of edges sharing the vertex). If the edge argument is higher than the number of edges sharing the vertex, the function will return 0.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

--Print the indices of all edges sharing vertex 13 in the plane.

for i = 1 to (p.GetVertexEdgeCount 13) do

print (p.GetEdgeFace 13 i)

Get Edge

<integer>GetNumEdges()

Returns the number of edges in the EditablePoly.

Example:

p = convertToPoly(Plane())    --create a Plane, convert to Epoly

num_edges = p.GetNumEdges()  --num_edges will contain 40

 

<index>GetEdgeVertex <index>edgeID <index>end

Returns the vertex index used by the specified edge. Since an edge has two vertices, the end argument is needed to define which of the two vertices of the edge to get.

Example:

p = convertToPoly(Plane())    --create a Plane, convert to Epoly

p.GetEdgeVertex 1 1 --returns vertex 6

p.GetEdgeVertex 1 2 --returns vertex 1

p.GetEdgeVertex 4 1 --returns vertex 1

p.GetEdgeVertex 4 2 --returns vertex 2

 

<index>GetEdgeFace <index>edgeID <index>side

Returns the face index used by the specified edge. Since an edge can have two faces, the side argument is needed to define which of the two possible faces to get.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

p.GetEdgeFace 18 1 --returns face 6

p.GetEdgeFace 18 2 --returns face 7

p.GetEdgeFace 4 1 --returns face 1

p.GetEdgeFace 4 2 --returns 0 as there is no second face

Get Face

<integer>GetNumFaces()

Returns the number of faces in the EditablePoly.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

num_faces = p.GetNumFaces() --num_faces will contain 16

 

<integer>GetFaceDegree <index>faceID

Returns the number of corners of the specified polygon. 3 means triangle, 4 means quad etc.

Example:

p = convertToPoly(Plane())     --create a Plane, convert to Epoly

p.setSelection #Vertex #{13} --select the middle vertex

p.GetFaceDegree 1   -- degree of the corner face is 4

p.Remove selLevel:#Vertex --remove the middle vertex

p.GetFaceDegree 6   -- degree of the middle face is 8

 

<index>GetFaceVertex <index>faceID <index>corner

Returns the vertex index of the Nth vertex used by the specified face. (where N is between 1 and the number of face corners). If the corner argument is higher than the number of face corners, the function will return 0.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

p.GetFaceVertex 1 1 --returns face 6

p.GetFaceVertex 1 2 --returns face 1

p.GetFaceVertex 1 3 --returns face 2

p.GetFaceVertex 1 4 --returns face 7

p.GetFaceVertex 1 5 --returns 0, there is no fifth corner

 

<index>GetFaceEdge <index>faceID <index>side

Returns the vertex index of the Nth vertex used by the specified face. (where N is between 1 and the number of face corners). If the corner argument is higher than the number of face corners, the function will return 0.

Example:

p = convertToPoly(Plane()) --create a Plane, convert to Epoly

p.GetFaceEdge 1 1 --returns edge 1

p.GetFaceEdge 1 2 --returns edge 4

p.GetFaceEdge 1 3 --returns edge 3

p.GetFaceEdge 1 4 --returns edge 2

p.GetFaceEdge 1 5 --returns 0, there is no fifth edge

 

<index>GetFaceMaterial <index>faceID

Returns the material ID of the specified face. If the face index is higher than the number of faces in the EditablePoly, the function will return 1.

 

<DWORD>GetFaceSmoothingGroups <index>faceID

Returns the Smoothing Groups of the specified face. If the face index is higher than the number of faces in the EditablePoly, the function will return 0.

 

Get Map Channel

<integer>GetNumMapChannels()

Returns the number of mapping channels in the EditablePoly.

 

<bool>GetMapChannelActive <integer>mapChannel

Returns true if the specified mapping channel is active, false if not. If the mapChannel argument is higher than the number of available mapping channels, the function will return false.

 

<integer>GetNumMapVertices <integer>mapChannel

Returns the number of texture vertices in the specified mapping channel. Returns 0 if the mapChannel argument is higher than the number of available mapping channels.

 

<point3>GetMapVertex <integer>mapChannel <index>vertexID

Returns the value of the specified texture verticex in the specified mapping channel. Returns [0,0,0] if the mapChannel argument is higher than the number of available mapping channels or the vertex index is higher than the number of texture vertices.

 

<integer>GetMapFaceVertex <integer>mapChannel <index>faceID <index>corner

Returns the texture vertex index of the Nth texture vertex used by the specified face. (where N is between 1 and the number of face corners). If the corner argument is higher than the number of face corners, the function will return -1.

 

 

Editable_Poly Topics:

Editable_Poly: GeometryClass

Editable_Poly Properties

Editable_Poly Methods

Editable_Poly Geometry Methods (polyOp struct)

Editable_Poly Mapping Methods(polyOp struct)