## MQObject class

MQObject contains vertices and faces.

### Property

get | set | Type | Name | Description
--- | --- | --- | --- | ---
x | x | string | name | object's name
x |  | long | id | unique ID of object
x | x | string | typeName | type of object
[Object] | Polygonal object
[PointLight] | Point light
[DirLight] | Directional light
x |  | int | numVertex | number of vertices
x |  | int | numFace | number of faces
x |  | list<MQVertex> | vertex | list of vertices
x |  | list<MQFace> | face | list of faces
x | x | int | visible | visibility of the object
[0] | Hidden
[1] | Visible
x | x | int | lock | locking of the object
[0] | Disable
[1] | Locked
x | x | int | select | selection of the object
[0] | Not selected
[1] | Selected
x | x | MQColor | color | color of vertices and lines
x | x | int | colorValid | validation of 'color' property
[0] | Invalid
[1] | Valid
x | x | int | shading | enable smooth shading
[0] | Flat shading
[1] | Smooth shading
x | x | float | smoothAngle | smoothing angle
x | x | int | patchType | type of the patch
[0] | None
[1] | Spline Type 1
[2] | Spline Type 2
[3] | Catmull-Clark
[4] | OpenSubdiv
x | x | int | patchSegment | segment of the patch
x | x | int | patchTriangle | division of triangles for Catmull-Clark patch
[0] | Divide into quadrangles
[1] | Divide into triangles
x | x | int | patchSmoothTriangle | smoothing of triangles for OpenSubdiv patch
[0] | No smoothing
[1] | Smoothing
x | x | int | patchLimitSurface | limit surface for OpenSubdiv patch
[0] | No limit surface
[1] | Limit surface
x | x | int | patchMeshInterp | An interpolation method of open faces for OpenSubdiv patch
[1] | Edge only
[2] | Edge and corder
x | x | int | patchUVInterp | An interpolation method of UV borders for OpenSubdiv patch
[0] | All
[1] | None
[2] | Corners + 1
[3] | Boundaries
[4] | Corners only
[5] | Corners + 2
x | x | int | mirrorType | type of mirroring
[0] | None
[1] | separated at center
[2] | joined by center
x | x | int | mirrorAxisX | Apply mirroring at X axis
[0] | None
[1] | Enable
x | x | int | mirrorAxisY | Apply mirroring at Y axis
[0] | None
[1] | Enable
x | x | int | mirrorAxisZ | Apply mirroring at Z axis
[0] | None
[1] | Enable
x | x | int | mirrorAxisLocal | Apply mirroring by the local coordinate
[0] | Global coordinate
[1] | Local coordinate
x | x | float | mirrorDistance | Maximum joined distance of mirroring.
x | x | int | latheType | type of lathe
[0] | None
[1] | Front
[2] | Back
[3] | Double sided
x | x | int | latheAxis | axis of lathe
[0] | X
[1] | Y
[2] | Z
x | x | int | latheSegment | segment of lathe
x | x | int | depth | depth of the hierarchy
x | x | int | folding | folding of the hierarchy
x | x | MQPoint | scaling | scaling factor of the local coordinate
x | x | MQAngle | rotation | rotation angle of the local coordinate
x | x | MQPoint | translation | translation of the local coordinate
x | x | float | lightValue | lighting brightness
x | x | int | lightAttenuation | lighting attenuation
[0] | None
[1] | linear
[2] | quadric
x | x | float | lightFalloffEnd | distance of end of fall off
x | x | float | lightFalloffHalf | distance of half fall off
x | x | list<int> | uvChannels | list of UV channel ID
x |  | int | activeUVChannel | active UV channel ID

### Method

Member | Description
--- | ---
clone | Duplicate an object.
merge | Merge two objects.
freeze | Polygonize attributes such as a patch or a mirroring.
clear | Clear all vertices and faces.
addVertex | Add a vertex.
addVertex | Add a vertex.
deleteVertex | Delete a vertex.
addFace | Add a face.
insertFace | Insert a face at the specified index.
deleteFace | Delete a face.
invertFace | Invert a direction of a face.
optimizeVertex | Combine vertices in the specified distance.
compact | Compact indices of vertices and faces.
getVertexIndexFromUniqueID | Get the index of vertex from unique ID.
getFaceIndexFromUniqueID | Get the index of face from unique ID.
allocUserData | Allocate a memory area for an user data in the object.
freeUserData | Free an allocated memory area for an user data.
getUserDataInt | Get an integer value (4 bytes) from the object user data.
getUserDataFloat | Get a float value (4 bytes) from the object user data.
getUserDataString | Get a string from the object user data.
setUserDataInt | Set an integer value (4 bytes) from the object user data.
setUserDataFloat | Set a float value (4 bytes) from the object user data.
setUserDataString | Set a string from the object user data.
allocVertexUserData | Allocate a memory area for user data in vertices.
freeVertexUserData | Free an allocated memory area for an user data.
getVertexUserDataInt | Get an integer value (4 bytes) from the vertex user data.
getVertexUserDataFloat | Get a float value (4 bytes) from the vertex user data.
getVertexUserDataString | Get a string from the vertex user data.
setVertexUserDataInt | Set an integer value (4 bytes) from the vertex user data.
setVertexUserDataFloat | Set a float value (4 bytes) from the vertex user data.
setVertexUserDataString | Set a string from the vertex user data.
allocFaceUserData | Allocate a memory area for user data in faces.
freeFaceUserData | Free an allocated memory area for an user data.
getFaceUserDataInt | Get an integer value (4 bytes) from the face user data.
getFaceUserDataFloat | Get a float value (4 bytes) from the face user data.
getFaceUserDataString | Get a string from the face user data.
setFaceUserDataInt | Set an integer value (4 bytes) from the face user data.
setFaceUserDataFloat | Set a float value (4 bytes) from the face user data.
setFaceUserDataString | Set a string from the face user data.
activateUVChannel | Activate an UV Channel.
addUVChannel | Add an UV Channel.
deleteUVChannel | Delete an UV Channel.

clone
Duplicate an object.
  Return value:
  MQObject | - | clone object

merge(source)
Merge two objects.
  Parameters:
  MQObject | source | - | source object
  Return value:
  int | - | Result [0] failed [1] succeeded

freeze([flag])
Polygonize attributes such as a patch or a mirroring.
  Parameters:
  int | flag | - | flags (combined) [1] patch [2] mirror [4] lathe [-1] all
  Return value:
  int | - | Result [0] failed [1] succeeded

clear
Clear all vertices and faces.

addVertex(point)
Add a vertex.
  Parameters:
  MQPoint | point | - | position of a new vertex
  Return value:
  int | - | index of vertex [-1] failed

addVertex(x, y, z)
Add a vertex.
  Parameters:
  float | x | - | X coordinate of a new vertex
  float | y | - | Y coordinate of a new vertex
  float | z | - | Z coordinate of a new vertex
  Return value:
  int | - | index of vertex [-1] failed

deleteVertex(index[, delete_face])
Delete a vertex.
  Parameters:
  int | index | - | index of the deleting vertex
  int | delete_face | - | whether to delete shared faces [0] Not delete (default) [1] Delete

addFace(list)
Add a face.
  Parameters:
  list<int> | list | - | list of the indices of the vertices
  Return value:
  int | - | index of face [-1] failed
Example:

insertFace(index, list)
Insert a face at the specified index.
  Parameters:
  int | index | - | index of face
  list<int> | list | - | list of the indices of the vertices
  Return value:
  int | - | index of face [-1] failed

deleteFace(index[, delete_vertex])
Delete a face.
  Parameters:
  int | index | - | index of the deleting face
  int | delete_vertex | - | delete a vertex that is not shared by other faces [0] Not delete (default) [1] Delete

invertFace(index)
Invert a direction of a face.
  Parameters:
  int | index | - | index of face

optimizeVertex(distance)
Combine vertices in the specified distance.
  Parameters:
  float | distance | - | distance to merge

compact
Compact indices of vertices and faces.

getVertexIndexFromUniqueID(id)
Get the index of vertex from unique ID.
  Parameters:
  long | id | - | unique ID of vertex
  Return value:
  int | - | index of vertex [-1] failed

getFaceIndexFromUniqueID(id)
Get the index of face from unique ID.
  Parameters:
  long | id | - | unique ID of face
  Return value:
  int | - | index of face [-1] failed

allocUserData(userdata_id)
Allocate a memory area for an user data in the object.
  Parameters:
  int | userdata_id | - | An object user data
  Return value:
  int | - | Result [0] failed [1] succeeded

freeUserData(userdata_id)
Free an allocated memory area for an user data.
  Parameters:
  int | userdata_id | - | An object user data

getUserDataInt(userdata_id, offset)
Get an integer value (4 bytes) from the object user data.
  Parameters:
  int | userdata_id | - | An object user data
  int | offset | - | An offset from a head of an user data
  Return value:
  int | - | value [None] Failed

getUserDataFloat(userdata_id, offset)
Get a float value (4 bytes) from the object user data.
  Parameters:
  int | userdata_id | - | An object user data
  int | offset | - | An offset from a head of an user data
  Return value:
  float | - | value [None] Failed

getUserDataString(userdata_id, offset, length)
Get a string from the object user data.
  Parameters:
  int | userdata_id | - | An object user data
  int | offset | - | An offset from a head of an user data
  int | length | - | data length (maximum length of string in bytes)
  Return value:
  string | - | value [None] Failed

setUserDataInt(userdata_id, offset, value)
Set an integer value (4 bytes) from the object user data.
  Parameters:
  int | userdata_id | - | An object user data
  int | offset | - | An offset from a head of an user data
  int | value | - | value

setUserDataFloat(userdata_id, offset, value)
Set a float value (4 bytes) from the object user data.
  Parameters:
  int | userdata_id | - | An object user data
  int | offset | - | An offset from a head of an user data
  float | value | - | value

setUserDataString(userdata_id, offset, length, value)
Set a string from the object user data.
  Parameters:
  int | userdata_id | - | An object user data
  int | offset | - | An offset from a head of an user data
  int | length | - | data length (maximum length of string in bytes)
  string | value | - | value

allocVertexUserData(userdata_id)
Allocate a memory area for user data in vertices.
  Parameters:
  int | userdata_id | - | A vertex user data
  Return value:
  int | - | Result [0] failed [1] succeeded

freeVertexUserData(userdata_id)
Free an allocated memory area for an user data.
  Parameters:
  int | userdata_id | - | A vertex user data

getVertexUserDataInt(userdata_id, index, offset)
Get an integer value (4 bytes) from the vertex user data.
  Parameters:
  int | userdata_id | - | A vertex user data
  int | index | - | An index of the vertex
  int | offset | - | An offset from a head of an user data
  Return value:
  int | - | value [None] Failed

getVertexUserDataFloat(userdata_id, index, offset)
Get a float value (4 bytes) from the vertex user data.
  Parameters:
  int | userdata_id | - | A vertex user data
  int | index | - | An index of the vertex
  int | offset | - | An offset from a head of an user data
  Return value:
  float | - | value [None] Failed

getVertexUserDataString(userdata_id, index, offset, length)
Get a string from the vertex user data.
  Parameters:
  int | userdata_id | - | A vertex user data
  int | index | - | An index of the vertex
  int | offset | - | An offset from a head of an user data
  int | length | - | data length (maximum length of string in bytes)
  Return value:
  string | - | value [None] Failed

setVertexUserDataInt(userdata_id, index, offset, value)
Set an integer value (4 bytes) from the vertex user data.
  Parameters:
  int | userdata_id | - | A vertex user data
  int | index | - | An index of the vertex
  int | offset | - | An offset from a head of an user data
  int | value | - | value

setVertexUserDataFloat(userdata_id, index, offset, value)
Set a float value (4 bytes) from the vertex user data.
  Parameters:
  int | userdata_id | - | A vertex user data
  int | index | - | An index of the vertex
  int | offset | - | An offset from a head of an user data
  float | value | - | value

setVertexUserDataString(userdata_id, index, offset, length, value)
Set a string from the vertex user data.
  Parameters:
  int | userdata_id | - | A vertex user data
  int | index | - | An index of the vertex
  int | offset | - | An offset from a head of an user data
  int | length | - | data length (maximum length of string in bytes)
  string | value | - | value

allocFaceUserData(userdata_id)
Allocate a memory area for user data in faces.
  Parameters:
  int | userdata_id | - | A face user data
  Return value:
  int | - | Result [0] failed [1] succeeded

freeFaceUserData(userdata_id)
Free an allocated memory area for an user data.
  Parameters:
  int | userdata_id | - | A face user data

getFaceUserDataInt(userdata_id, index, offset)
Get an integer value (4 bytes) from the face user data.
  Parameters:
  int | userdata_id | - | A face user data
  int | index | - | An index of the face
  int | offset | - | An offset from a head of an user data
  Return value:
  int | - | value [None] Failed

getFaceUserDataFloat(userdata_id, index, offset)
Get a float value (4 bytes) from the face user data.
  Parameters:
  int | userdata_id | - | A face user data
  int | index | - | An index of the face
  int | offset | - | An offset from a head of an user data
  Return value:
  float | - | value [None] Failed

getFaceUserDataString(userdata_id, index, offset, length)
Get a string from the face user data.
  Parameters:
  int | userdata_id | - | A face user data
  int | index | - | An index of the face
  int | offset | - | An offset from a head of an user data
  int | length | - | data length (maximum length of string in bytes)
  Return value:
  string | - | value [None] Failed

setFaceUserDataInt(userdata_id, index, offset, value)
Set an integer value (4 bytes) from the face user data.
  Parameters:
  int | userdata_id | - | A face user data
  int | index | - | An index of the face
  int | offset | - | An offset from a head of an user data
  int | value | - | value

setFaceUserDataFloat(userdata_id, index, offset, value)
Set a float value (4 bytes) from the face user data.
  Parameters:
  int | userdata_id | - | A face user data
  int | index | - | An index of the face
  int | offset | - | An offset from a head of an user data
  float | value | - | value

setFaceUserDataString(userdata_id, index, offset, length, value)
Set a string from the face user data.
  Parameters:
  int | userdata_id | - | A face user data
  int | index | - | An index of the face
  int | offset | - | An offset from a head of an user data
  int | length | - | data length (maximum length of string in bytes)
  string | value | - | value

activateUVChannel(channel)
Activate an UV Channel.
  Parameters:
  int | channel | - | UV channel ID [0] Default UV channel [!= 0] An ID that is generated and got by MQDocument.getUVChannelID()
  Return value:
  int | - | UV channel ID [0] UV channel not found [1] succeeded

addUVChannel(channel)
Add an UV Channel.
  Parameters:
  int | channel | - | UV channel ID [!= 0] An ID that is generated and got by MQDocument.getUVChannelID()
  Return value:
  int | - | Result [0] failed [1] succeeded

deleteUVChannel(channel)
Delete an UV Channel.
  Parameters:
  int | channel | - | UV channel ID
  Return value:
  int | - | Result [0] failed [1] succeeded