Skip to main content
added 355 characters in body
Source Link
stacker
  • 38.9k
  • 31
  • 144
  • 245

You can access all objects from the scene by its name:

import GameLogic
scene = GameLogic.getCurrentScene()
obj=scene.objects['ObjectName']

To access the vertices:

import GameLogic


scene = GameLogic.getCurrentScene()
obj=scene.objects['Cube']

mesh = obj.meshes[0]

for v in range(mesh.getVertexArrayLength(0)):
    vert = mesh.getVertex(0, v)
    print( "%d,%d,%d" % ( vert.x, vert.y, vert.z ))
    
print( dir( vert ))

You can access all objects from the scene by its name:

import GameLogic
scene = GameLogic.getCurrentScene()
obj=scene.objects['ObjectName']

You can access all objects from the scene by its name:

import GameLogic
scene = GameLogic.getCurrentScene()
obj=scene.objects['ObjectName']

To access the vertices:

import GameLogic


scene = GameLogic.getCurrentScene()
obj=scene.objects['Cube']

mesh = obj.meshes[0]

for v in range(mesh.getVertexArrayLength(0)):
    vert = mesh.getVertex(0, v)
    print( "%d,%d,%d" % ( vert.x, vert.y, vert.z ))
    
print( dir( vert ))
Source Link
stacker
  • 38.9k
  • 31
  • 144
  • 245

You can access all objects from the scene by its name:

import GameLogic
scene = GameLogic.getCurrentScene()
obj=scene.objects['ObjectName']