Crash when saving the file without an active camera #91931

Closed
opened 2021-10-03 23:11:40 +02:00 by zhangliqi · 20 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Intel(R) HD Graphics 620 Intel 4.4.0 - Build 21.20.16.4526

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-10-01 21:26, hash: 12e8c78353
Worked: (newest version of Blender that worked as expected)

Short description of error
Attempting to call a camera that does not exist crashes

Steps to Reproduce

  1. Go to Preference settings and go to Save&Load panel.
  2. Change File preview type from default "Screenshot" to "Camera View"
  3. Delete the camera object in the scene and save the file
  4. crash
    屏幕截图 2021-10-04 051016.png
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: Intel(R) HD Graphics 620 Intel 4.4.0 - Build 21.20.16.4526 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-10-01 21:26, hash: `12e8c78353` Worked: (newest version of Blender that worked as expected) **Short description of error** Attempting to call a camera that does not exist crashes **Steps to Reproduce** 1. Go to Preference settings and go to Save&Load panel. 2. Change File preview type from default "Screenshot" to "Camera View" 3. Delete the camera object in the scene and save the file 4. crash ![屏幕截图 2021-10-04 051016.png](https://archive.blender.org/developer/F10753992/屏幕截图_2021-10-04_051016.png)
Author

Added subscriber: @shadow_creeper

Added subscriber: @shadow_creeper

#92457 was marked as duplicate of this issue

#92457 was marked as duplicate of this issue

#92008 was marked as duplicate of this issue

#92008 was marked as duplicate of this issue

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

Could you please describe the steps that led to the crash in detail?

Could you please describe the steps that led to the crash in detail?
Author

Because the settings are set by saving the camera view as a project preview
But there is no camera in the scene that causes the call to NULL

Because the settings are set by saving the camera view as a project preview But there is no camera in the scene that causes the call to NULL
Author

In #91931#1230262, @rjg wrote:
Because the settings are set by saving the camera view as a project preview

But there is no camera in the scene that causes the call to NULL

> In #91931#1230262, @rjg wrote: > Because the settings are set by saving the camera view as a project preview But there is no camera in the scene that causes the call to NULL
Contributor

Added subscriber: @Eary

Added subscriber: @Eary
Contributor

Steps:

  1. Go to Preference settings and go to Save&Load panel.
  2. Change File preview type from default "Screenshot" to "Camera View"
  3. Delete the camera object in the scene and save the file
  4. crash
Steps: 1. Go to Preference settings and go to Save&Load panel. 2. Change File preview type from default "Screenshot" to "Camera View" 3. Delete the camera object in the scene and save the file 4. crash

Added subscribers: @Harley, @deadpin

Added subscribers: @Harley, @deadpin

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

Thanks for those instructions @Eary I can confirm the crash which happens in the code path below.

region is null; it is not set correctly inside blend_file_thumb_from_camera. @Harley Looks like a recent change of yours may have been the culprit?

> blender.exe!ED_view3d_draw_offscreen_imbuf(Depsgraph * depsgraph, Scene * scene, eDrawType drawtype, View3D * v3d, ARegion * region, int sizex, int sizey, eImBufFlags imbuf_flag, int alpha_mode, const unsigned char * viewname, const bool restore_rv3d_mats, GPUOffScreen * ofs, unsigned char * err_out) Line 1854	C

  blender.exe!blend_file_thumb_from_camera(const bContext * C, Scene * scene, bScreen * screen, BlendThumbnail * * thumb_pt) Line 1662	C
  blender.exe!wm_file_write(bContext * C, const unsigned char * filepath, int fileflags, eBLO_WritePathRemap remap_mode, bool use_save_as_copy, ReportList * reports) Line 1808	C
  blender.exe!wm_save_as_mainfile_exec(bContext * C, wmOperator * op) Line 3096	C

Thanks for those instructions @Eary I can confirm the crash which happens in the code path below. `region` is null; it is not set correctly inside `blend_file_thumb_from_camera`. @Harley Looks like a recent change of yours may have been the culprit? ``` > blender.exe!ED_view3d_draw_offscreen_imbuf(Depsgraph * depsgraph, Scene * scene, eDrawType drawtype, View3D * v3d, ARegion * region, int sizex, int sizey, eImBufFlags imbuf_flag, int alpha_mode, const unsigned char * viewname, const bool restore_rv3d_mats, GPUOffScreen * ofs, unsigned char * err_out) Line 1854 C blender.exe!blend_file_thumb_from_camera(const bContext * C, Scene * scene, bScreen * screen, BlendThumbnail * * thumb_pt) Line 1662 C blender.exe!wm_file_write(bContext * C, const unsigned char * filepath, int fileflags, eBLO_WritePathRemap remap_mode, bool use_save_as_copy, ReportList * reports) Line 1808 C blender.exe!wm_save_as_mainfile_exec(bContext * C, wmOperator * op) Line 3096 C ```
Harley Acheson self-assigned this 2021-10-04 04:17:26 +02:00
Member

Yup, sure sounds like me. LOL

Yup, sure sounds like me. LOL
Member

Added subscribers: @lsscpp, @PratikPB2123

Added subscribers: @lsscpp, @PratikPB2123
Pratik Borhade changed title from Crash on save to Crash when saving the file without an active camera 2021-10-07 13:12:59 +02:00

Added subscriber: @georgK

Added subscriber: @georgK

Bug still there in 3.0.0 Alpha, branch: master, commit date: 2021-10-08 14:49, hash: 94d2736dfb.
Instead of falling back to "Screenshot" in such cases, could we please use the viewport camera instead?

Bug still there in 3.0.0 Alpha, branch: master, commit date: 2021-10-08 14:49, hash: `94d2736dfb`. Instead of falling back to "Screenshot" in such cases, could we please use the viewport camera instead?

Added subscriber: @NikkioBlend

Added subscriber: @NikkioBlend

This issue was referenced by b714f9bf43

This issue was referenced by b714f9bf437de32dab768d4c28674ca1f3e5b325
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' 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
8 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#91931
No description provided.