Open Feral3d opened 1 week ago
hi, changing lens via bge api sounds working for me in this file:
I apologize for the mistake, this effects game cameras that are converted, when loaded from external libraries. For example using own.scene.convertBlenderObject(game_camera_object). For example:
if cont.sensors['Always'].positive: filepath = "//lib/example_blender_file.blend" with bpy.data.libraries.load(filepath) as (data_from, data_to): data_to.objects = data_from.objects for o in bpy.data.objects: if o.name not in bpy.data.collections['Collection'].objects: bpy.data.collections['Collection'].objects.link(o) own.scene.convertBlenderObject(o)
All cameras that are linked, and converted suffer from this bug.
Updating the Camera angle/fov will update the physics objects, but the visuals remain unchanged: for example to update the camera fov slider, you need to run:
self.camera = game_camera new_camera_angle = 17.543
this only updates the game objects physics in relation to the camera
self.camera.lens = new_camera_angle
this updates the visuals/render of the camera only
self.camera.blenderObject.data.lens = new_camera_angle
So in order to correct camera lens fov, for now you need to run BOTH at the same time, individually they only do update the physics and render, respectively.