UPBGE / upbge

UPBGE, the best integrated game engine in Blender
https://upbge.org
Other
1.44k stars 181 forks source link

VERSION 0.43 Aplha camera angle changes #1914

Open Feral3d opened 1 week ago

Feral3d commented 1 week ago

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.

youle31 commented 1 week ago

hi, changing lens via bge api sounds working for me in this file:

cam_lens.zip

Feral3d commented 1 week ago

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.

youle31 commented 1 week ago

it works for me here:

cam_test.zip

it doesn't work using "viewport render" mode (it is "expected")