Hi,
I have only one object on my scene, and I want to recover its dimensions with the module bge (not with bpy)
For the moment I just sucess to recover its position. See my script:
import bge
import sys
To get the controller thats running this python script:
cont = bge.logic.getCurrentController() # bge.logic is automatically imported
To get the game object this controller is on:
object = cont.owner
#Select the object “Americain football ball”
scene = bge.logic.getCurrentScene()
texte = scene.objects.get(“Americain football ball”)
print ("mon objet selectionné est ", texte)
INITIAL POSITION
#We recover the initial position of the object
initial_position = object.position
print ("sa position est ",initial_position) #We save the initial position of the object
save_initial_position = initial_position.copy()
print ("la position enregistrée est: ", save_initial_position)
I try object.dimension, object.size but it doesn’t work.
Thanks for your help
Hi, so I know this is kind of old now, but if anywone is interested I’m working on implementing access from Python API to two new variables: worldDimensions (aliegned with the world axis) and localDimensions (aligned with the local axis).
I managed to add the worldDimensions successfuly, but I noticed I’m building blender 2.68 (or 2.66, can’t remember exactly, but it’s not important) instead of 2.72 (because probably I’m working on ‘ge_dev’). So my question is: what is the correct branch to work on for BGE?
EDIT:
Well, I’ve just submitted a patch, now it just needs to be revised I guess and merged.