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.
8 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#91931
No description provided.