カメラの変更
2010/6/13
Blender2.49
Scene.active_camera
にCameraをぶち込む。
cont = GameLogic.getCurrentController()
scene = GameLogic.getCurrentScene()
cam1 = scene.cameras["OBCamera1"]
cam2 = scene.cameras["OBCamera2"]
if cont.sensors["One"].positive:
scene.active_camera = cam1am1
elif cont.sensors["Two"].positive:
scene.active_camera = cam2am2
キーボードの1でCamera1、キーボードの2でCamera2に切り替え。
cam1 = scene.objects["OBCamera1"]
cam2 = scene.objects["OBCamera2"]
でも所得可能。CameraはGameObjectのサブクラスだから(?)
Class KX_Scene active_camera
http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_Scene-class.html#active_camera
Class KX_Camera
http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_Camera-class.html
まぁ、わざわざスクリプトじゃなくても出来る
Changing Cameras -- Blender 3D Game Engine
http://www.tutorialsforblender3d.com/GameDoc/CamChange/CamChange_States_2.html