base class — SCA_IObject
A mesh object.
You can only change the vertex properties of a mesh object, not the mesh topology.
To use mesh objects effectively, you should know a bit about how the game engine handles them.
The correct method of iterating over every KX_VertexProxy in a game object
from bge import logic
cont = logic.getCurrentController()
object = cont.owner
for mesh in object.meshes:
for m_index in range(len(mesh.materials)):
for v_index in range(mesh.getVertexArrayLength(m_index)):
vertex = mesh.getVertex(m_index, v_index)
# Do something with vertex here...
# ... eg: color the vertex red.
vertex.color = [1.0, 0.0, 0.0, 1.0]
Type: | list of KX_BlenderMaterial or KX_PolygonMaterial types |
---|
Type: | integer |
---|
Type: | integer |
---|
Gets the name of the specified material.
Parameters: | matid (integer) – the specified material. |
---|---|
Returns: | the attached material name. |
Return type: | string |
Gets the name of the specified material’s texture.
Parameters: | matid (integer) – the specified material |
---|---|
Returns: | the attached material’s texture name. |
Return type: | string |
Gets the length of the vertex array associated with the specified material.
There is one vertex array for each material.
Parameters: | matid (integer) – the specified material |
---|---|
Returns: | the number of verticies in the vertex array. |
Return type: | integer |
Gets the specified vertex from the mesh object.
Parameters: |
|
---|---|
Returns: | a vertex object. |
Return type: |
Gets the specified polygon from the mesh.
Parameters: | index (integer) – polygon number |
---|---|
Returns: | a polygon object. |
Return type: | KX_PolyProxy |
Transforms the vertices of a mesh.
Parameters: |
|
---|
Transforms the vertices UV’s of a mesh.
Parameters: |
|
---|