Deformable_gPoly : GeometryClass

Deformable_gPoly - superclass: GeometryClass; super-superclass:node - classID: #(374834938, 0) 

Value > MAXWrapper > Node > GeometryClass > Deformable_gPoly

 

   

Geometry Objects - Quick Navigation

The Deformable_gPoly GeometryClass implements a geometry representation of 3ds Max objects that is optimized for fast viewport display.

It provides a Deformable_gPoly baseobject that can be collapsed to, and allows geometry data to be converted on the fly to Deformable_gPoly representation on the stack via the Turn_to_gPoly Modifier.

Available in 3ds Max 2013 and higher.

   

Constructor:

Class instances not creatable by MAXScript.

Other GeometryClass objects can be collapsed to Deformable_gPoly class using

convertTo <GeometryObject> Deformable_gPoly

where <GeometryObject> is any geometry class object that can produce a mesh, including Geometry Primitives, Editable Mesh, Editable Poly, Patch and NURBS objects.

   

Properties:

No Properties Exposed.

In fact, the Deformable_gPoly GeometryClass baseobject is the only 3ds Max object that does not show a User Interface in the Command Panel.

GPOLY BENCHMARK

(
resetMaxFile #noprompt	
theObj = teapot segs:64
theBend = bend()
addModifier theObj theBend

with animate on (
	at time 50 theObj.pos = [50,0,10]
	at time 100 (
		theObj.pos = [100,0,0]
		theObj.rotation = eulerangles 90 0 0
		theBend.angle = 90
	)
)

theStart = animationrange.start
theEnd = animationrange.end 
theLength = theEnd - theStart + 1

st = timestamp()
for i = theStart to theEnd do sliderTime = i
theTime = ((timestamp()-st)/1000.0)
format "Teapot Primitive: % seconds (% FPS).\n" theTime (theLength/theTime)

deleteModifier theObj theBend
convertTo theObj Deformable_gPoly
addModifier theObj theBend
	
st = timestamp()
for i = animationrange.start to animationrange.end do sliderTime = i
theTime2 = ((timestamp()-st)/1000.0)
format "Teapot gPoly: % seconds (% FPS).\n" theTime2 (theLength/theTime2)

format "gPoly Speed Up: %x\n" (theTime/theTime2)
)

RESULTS

Teapot Primitive: 28.265 seconds (3.56875f FPS).
Teapot gPoly: 11.167 seconds (9.04375f FPS).
gPoly Speed Up: 2.53112x
OK

   

The following Interface exposes methods for updating and manipulating the Deformable_gPoly object.

Interface: Deformable_gPoly

Methods:

<integer>GetNumberFaces()

Returns the number of faces in the Deformable_gPoly mesh.

   

<integer>GetNumberVertices()

Returns the number of vertices in the Deformable_gPoly mesh.

   

<void>ValidateNormals()

Validates the Normal data in the Deformable_gPoly mesh.

Other than the other geometry classes which re-calculate Normals on the fly based on Face Normals and Smoothing Groups on each update, the Deformable_gPoly mesh caches the Normals data. This contributes significantly to the viewport display speed up.

   

<index>GetMaterialID <index>faceIndex

Returns the Material ID of the indexed face.

   

<void>Update()

Updates the Deformable_gPoly data.

   

<void>LockFaceChannel()

Locks the Face Channel.

   

<void>UnlockFaceChannel()

Unlocks the Face Channel.

   

<void>CopyFaceChannel <&integer array>buffer

buffer is In and Out parameter

Copies the Face Channel into an array of Integers passed by-reference.

   

<void>PasteFaceChannel <&integer array>buffer

buffer is In and Out parameter

Pastes the by-reference array of integers as new Face Channel.

   

   

<boolean>LockPosChannel()

Locks the Position channel.

Returns true on success, false on failure.

   

<void>UnlockPosChannel()

Unlocks the Position channel.

   

<void>CopyPosChannel <&point3 array>buffer

buffer is In and Out parameter

Copies the Position Channel into an array of Point3 values passed by-reference.

   

<void>PastePosChannel <&point3 array>buffer

buffer is In and Out parameter

Pastes the by-reference array of Point3 values as new Position Channel.

   

   

<boolean>LockNormalChannel()

Locks the Normal channel.

Returns true on success, false on failure.

   

<void>UnlockNormalChannel()

Unlocks the Normal channel.

   

<void>CopyNormalChannel <&point3 array>buffer 

buffer is In and Out parameter

Copies the Normal Channel into an array of Point3 values passed by-reference.

   

<void>PasteNormalChannel <&point3 array>buffer 

buffer is In and Out parameter

Pastes the by-reference array of Point3 values as new Normal Channel.

   

   

<boolean>LockTangentChannel()

Locks the Tangent channel.

Returns true on success, false on failure.

   

<void>UnlockTangentChannel()

Unlocks the Tangent channel.

   

<void>CopyTangentChannel <&point3 array>buffer 

buffer is In and Out parameter

Copies the Tangent Channel into an array of Point3 values passed by-reference.

   

<void>PasteTangentChannel <&point3 array>buffer 

buffer is In and Out parameter

Pastes the by-reference array of Point3 values as new Tangent Channel.

   

   

<boolean>LockBitangentChannel()

Locks the Bitangent channel.

Returns true on success, false on failure.

   

<void>UnlockBitangentChannel()

Unlocks the Bitangent channel.

   

<void>CopyBitangentChannel <&point3 array>buffer 

buffer is In and Out parameter

Copies the Bitangent Channel into an array of Point3 values passed by-reference.

   

<void>PasteBitangentChannel <&point3 array>buffer 

buffer is In and Out parameter

Pastes the by-reference array of Point3 values as new Bitangent Channel.

   

   

<void>getUVWChannels <&integer array>channels 

channels is In and Out parameter

Writes the allocated mapping channels into a by-reference array of Integers argument.

   

<boolean>LockUVWChannel <integer>channelIndex

Locks the indexed Mapping channel.

Returns true on success, false on failure.

   

<void>UnlockUVWChannel <integer>channelIndex

Unlocks the indexed Mapping channel.

   

<void>CopyUVWChannel <&point3 array>buffer 

buffer is In and Out parameter

Currently broken.

   

<void>PasteUVWChannel <&point3 array>buffer 

buffer is In and Out parameter

Currently broken.

   

See Also