Camera has wrong zoom levels when explicitly set by Scene Actuator #31357

Closed
opened 2012-05-07 21:29:23 +02:00 by Leonard Ritter · 10 comments

Category: Logic

%%%Problem:

When a Scene actuator requests "Set Camera" explicitly, the view is changed to the new camera, but the zoom level depends on the previously active view: A.) If an orthogonal view has been previously selected, the zoom factor is too large - incorrect. B.) If the camera is the active view (Numpad 0), and the view is zoomed out, so that the passepartout is visible, the zoom factor is, again, too large, and restricted to the small view - incorrect. C.) If the camera is the active view, and the view is zoomed in, so that the passepartout is not visible at all, the zoom factor is 100% correct.

Expectation:

The zoom should always behave as in case C. I can see why case B is a feature, since that allows to see beyond the camera even when it is fully automated, but case A is terribly annoying. I always have to switch to the correct camera first and scroll in before I can run the game and view it the way it's supposed to be viewed.

To reproduce, perform following steps on attached example:

For all cases, perform following step first:

  1. load camzoombug.blend. You can see that the cube is configured to set the camera explicitly. An isometric, orthogonal view is visible by default.

case A:

  1. Press P to start the game engine.
  2. Note that the camera is properly assigned, but the cube appears to occupy only ~1/5th of the screen. This is incorrect.

case B:

  1. Press Numpad 0 to make the camera the active view. Using the mousewheel, scroll out until the passepartout is boldly visible.
  2. Press P to start the game engine.
  3. Note that the passepartout is still visible just as set up by you, even though the camera has been explicitly set again by the actuator.

case C:

  1. Press Numpad 0. The camera is made the current view. It appears slightly zoomed in, so that the passepartout is not visible.
  2. Press P to start the game engine.
  3. Note that the camera is properly assigned, and the cube occupies about 1/3rd of the screen. This is correct.
    %%%
**Category**: Logic %%%Problem: When a Scene actuator requests "Set Camera" explicitly, the view is changed to the new camera, but the zoom level depends on the previously active view: A.) If an orthogonal view has been previously selected, the zoom factor is too large - incorrect. B.) If the camera is the active view (Numpad 0), and the view is zoomed out, so that the passepartout is visible, the zoom factor is, again, too large, and restricted to the small view - incorrect. C.) If the camera is the active view, and the view is zoomed in, so that the passepartout is not visible at all, the zoom factor is 100% correct. Expectation: The zoom should always behave as in case C. I can see why case B is a feature, since that allows to see beyond the camera even when it is fully automated, but case A is terribly annoying. I always have to switch to the correct camera first and scroll in before I can run the game and view it the way it's supposed to be viewed. To reproduce, perform following steps on attached example: For all cases, perform following step first: 1. load camzoombug.blend. You can see that the cube is configured to set the camera explicitly. An isometric, orthogonal view is visible by default. case A: 1. Press P to start the game engine. 2. Note that the camera is properly assigned, but the cube appears to occupy only ~1/5th of the screen. This is incorrect. case B: 1. Press Numpad 0 to make the camera the active view. Using the mousewheel, scroll out until the passepartout is boldly visible. 2. Press P to start the game engine. 3. Note that the passepartout is still visible just as set up by you, even though the camera has been explicitly set again by the actuator. case C: 1. Press Numpad 0. The camera is made the current view. It appears slightly zoomed in, so that the passepartout is not visible. 2. Press P to start the game engine. 3. Note that the camera is properly assigned, and the cube occupies about 1/3rd of the screen. This is correct. %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Encountered with Blender 2.63 for Linux-64, running on Ubuntu 12.04.%%%

%%%Encountered with Blender 2.63 for Linux-64, running on Ubuntu 12.04.%%%

%%%Michael, can you please look into this?%%%

%%%Michael, can you please look into this?%%%

%%%Moved from Blender 2.6 Bug Tracker to Game Engine%%%

%%%Moved from Blender 2.6 Bug Tracker to Game Engine%%%

%%%Hi Leonard, I'm not so sure this is a bug. The only thing missing in A is the passpartout.
As you can see in the new attached file - camzoombug_2.blend - the camera lens is correct in A, B or C.%%%

%%%Hi Leonard, I'm not so sure this is a bug. The only thing missing in A is the passpartout. As you can see in the new attached file - camzoombug_2.blend - the camera lens is correct in A, B or C.%%%
Author

%%%Your example is slightly different to mine. What I am bugged about is the different ways in which the camera is displayed when I enter the game at first. Unlike your example, camzoombug.blend sets the camera right away - but, as noted in case A, if the current 3D view is not set to the active camera, then not only is the passepartout missing (which is unnerving enough), the screen is also not to set to a size that makes sense.

This is incredibly unnerving in day to day use: whenever i make changes to a scene and i want to test it, i have to first manually select any camera before running the game, or else the zoom levels will be all wrong, even though I have programmatically selected a camera, and it is clear that I want to see the entire picture in frame, clipped, and scaled to a size that fits the frame. -- so it's always, move around ortho view, edit, hit numpad 0 for cam, hit P, then hit numpad 0 again to go back to ortho view - i can never just edit and P, i always have to do this little numpad 0 thing inbetween or else the view is messed up.

I've attached screenshots to further illustrate the problem with my particular blend file:
during_editing.png: i'm editing my scene file - now before i test the scene i have to first hit numpad 0 to select any camera view
before_running.png: this is what it has to look like so i get a correct view when starting the game, so it looks like...
starting_from_camera.png: ... <- this; when i forget to select a camera view and stay in ortho, it looks like...
starting_from_ortho.png: ... <- THIS, which is terrible and doesn't help me at all; the zoom and fov levels are wrong.

the camzoombug.blend demonstrates exactly the same problem. it's not just the missing passepartout (which also sucks!) - it's also the wrong zoom level.

(Off-the-record: besides this camera bug, there are other things that make the edit-and-test cycle clumsy, such as the game always showing the currently active layers across all scenes; so I often have to go back and forth between scenes to select the layers i want actually to be active at runtime; having the wrong layers activated breaks the game. Also, for the release, the correct start-up scene has to be activated on save, or else the game will start with the wrong scene. I kind of fix these issues with a python script that loads my game blendfile, fixes all the layers, selects the correct active scene, and then saves to a final blend file, but I wish it were easier to prepare a file for deployment, by e.g. specifying a start-up scene for the blend file, or marking a set of scene layers as the default set-up when doing a release run.)
%%%

%%%Your example is slightly different to mine. What I am bugged about is the different ways in which the camera is displayed when I enter the game at first. Unlike your example, camzoombug.blend sets the camera right away - but, as noted in case A, if the current 3D view is not set to the active camera, then not only is the passepartout missing (which is unnerving enough), the screen is also not to set to a size that makes sense. This is incredibly unnerving in day to day use: whenever i make changes to a scene and i want to test it, i have to first manually select any camera before running the game, or else the zoom levels will be all wrong, even though I have programmatically selected a camera, and it is clear that I want to see the entire picture in frame, clipped, and scaled to a size that fits the frame. -- so it's always, move around ortho view, edit, hit numpad 0 for cam, hit P, then hit numpad 0 again to go back to ortho view - i can never just edit and P, i always have to do this little numpad 0 thing inbetween or else the view is messed up. I've attached screenshots to further illustrate the problem with my particular blend file: during_editing.png: i'm editing my scene file - now before i test the scene i have to first hit numpad 0 to select _any_ camera view before_running.png: this is what it has to look like so i get a correct view when starting the game, so it looks like... starting_from_camera.png: ... <- this; when i forget to select a camera view and _stay_ in ortho, it looks like... starting_from_ortho.png: ... <- THIS, which is terrible and doesn't help me at all; the zoom and fov levels are wrong. the camzoombug.blend demonstrates exactly the same problem. it's not just the missing passepartout (which also sucks!) - it's also the wrong zoom level. (Off-the-record: besides this camera bug, there are other things that make the edit-and-test cycle clumsy, such as the game always showing the currently active layers across all scenes; so I often have to go back and forth between scenes to select the layers i want actually to be active at runtime; having the wrong layers activated breaks the game. Also, for the release, the correct start-up scene has to be activated on save, or else the game will start with the wrong scene. I kind of fix these issues with a python script that loads my game blendfile, fixes all the layers, selects the correct active scene, and then saves to a final blend file, but I wish it were easier to prepare a file for deployment, by e.g. specifying a start-up scene for the blend file, or marking a set of scene layers as the default set-up when doing a release run.) %%%

%%%Have you considered to have a Screen if only a 3dvew on it, no menus whatsoever and with the layers (and camera) 'locked'?
So all you need to preview is [Ctrl + ->] + P. That's how I use to work. This Screen not only will have the correct layers but the correct camera and scene.
(and if you need to isolate layers for some editing in a different screen you can do it by clicking the 'chain' icon on the right of the layers before changing them)

That may solve most of your workflow problems (considering the off-the-record ones)

You can even use the 'Run' button by the Player panel to launch the blenderplayer instead (then you have always the screensize of the actual game).%%%

%%%Have you considered to have a Screen if only a 3dvew on it, no menus whatsoever and with the layers (and camera) 'locked'? So all you need to preview is [Ctrl + ->] + P. That's how I use to work. This Screen not only will have the correct layers but the correct camera and scene. (and if you need to isolate layers for some editing in a different screen you can do it by clicking the 'chain' icon on the right of the layers before changing them) That may solve most of your workflow problems (considering the off-the-record ones) You can even use the 'Run' button by the Player panel to launch the blenderplayer instead (then you have always the screensize of the actual game).%%%
Author

%%%Running the external player from within Blender somehow messes up all the paths within the blend file on Linux, so I can't do that. But yes, I use switching screens a lot, but it always struck me as kind of unwieldy. I'll give it another shot.%%%

%%%Running the external player from within Blender somehow messes up all the paths within the blend file on Linux, so I can't do that. But yes, I use switching screens a lot, but it always struck me as kind of unwieldy. I'll give it another shot.%%%

This issue was referenced by 13a4bcd148

This issue was referenced by 13a4bcd148bd7a32af8af626f42f7793aca7b7fe

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#31357
No description provided.