uvmap causes crash when entering texture paint mode #45514

Closed
opened 2015-07-21 16:39:32 +02:00 by Daniel Grauer · 20 comments
Member

System Information
Operating system and graphics card
OS: windows 8.1 64bit
GPU: NVIDIA GTX 860m

Blender Version
Broken:
version 2.75 (sub 2), branch b'master', commit date b'2015-07-17' b'13:15', hash b'955c13d'
Worked: (optional)

Short description of error
when switching to texture paint mode blender crashes. i could pin it down to the uv map, when i remove it i can enter texture paint mode without crashing.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

blend file: uvmap_crash.blend

  1. open the blend file
  2. switch to texture paint mode with the object selected
  3. blender crashes

crashlog:

# Blender 2.75 (sub 2), Commit date: 2015-07-21 11:49, Hash 9ae39a1
bpy.ops.view3d.layers(nr=5, extend=False)  # Operator
bpy.context.scene.layers[10] = True  # Property
bpy.context.scene.layers[0] = True  # Property
bpy.ops.object.delete(use_global=False)  # Operator
bpy.ops.object.delete(use_global=False)  # Operator
bpy.context.space_data.recent_folders_active = 0  # Property
bpy.ops.object.delete(use_global=False)  # Operator
bpy.ops.object.delete(use_global=False)  # Operator
bpy.context.space_data.context = 'MODIFIER'  # Property
bpy.ops.object.modifier_remove(modifier="Shrinkwrap")  # Operator
bpy.ops.object.modifier_remove(modifier="Lattice")  # Operator
bpy.ops.paint.texture_paint_toggle()  # Operator

# backtrace
35: BLI_system_backtrace - 0xF2304F0
34: blender_crash_handler_backtrace - 0xDFCBC60
33: blender_crash_handler - 0xDFCBCB0
32: windows_exception_handler - 0xDFCBF30
31: UnhandledExceptionFilter - 0x715F1AD0
30: memset - 0x742C5140
29: _C_specific_handler - 0x742B2800
28: _chkstk - 0x742C3E70
27: RtlRaiseException - 0x74283920
26: KiUserExceptionDispatcher - 0x742C3060
25: copy_v2_v2 - 0xED5FA10
24: cdDM_buffer_copy_uv_texpaint - 0xED6B0D0
23: cdDM_copy_gpu_data - 0xED6B9B0
22: gpu_buffer_setup - 0xEAB4710
21: gpu_buffer_setup_type - 0xEAB4BA0
20: gpu_buffer_setup_common - 0xEAB4C60
19: GPU_texpaint_uv_setup - 0xEAAF550
18: cdDM_drawFacesTex_common - 0xED67830
17: cdDM_drawFacesTex - 0xED67EF0
16: draw_mesh_textured_old - 0xE190170
15: draw_mesh_textured - 0xE18C2F0
14: draw_mesh_fancy - 0xE148E50
13: draw_mesh_object - 0xE149E10
12: draw_object - 0xE137610
11: view3d_draw_objects - 0xE124F00
10: view3d_main_area_draw_objects - 0xE126E50
9: view3d_main_area_draw - 0xE11C310
8: ED_region_do_draw - 0xE4AA9D0
7: wm_method_draw_triple - 0xE002590
6: wm_draw_update - 0xE000610
5: WM_main - 0xDFD0FB0
4: main - 0xDFCF4D0
3: __tmainCRTStartup - 0x125E80F0
2: mainCRTStartup - 0x125E8310
1: BaseThreadInitThunk - 0x722113B0
0: RtlUserThreadStart - 0x74245410

**System Information** Operating system and graphics card OS: windows 8.1 64bit GPU: NVIDIA GTX 860m **Blender Version** Broken: version 2.75 (sub 2), branch b'master', commit date b'2015-07-17' b'13:15', hash b'955c13d' Worked: (optional) **Short description of error** when switching to texture paint mode blender crashes. i could pin it down to the uv map, when i remove it i can enter texture paint mode without crashing. **Exact steps for others to reproduce the error** Based on a (as simple as possible) attached .blend file with minimum amount of steps blend file: [uvmap_crash.blend](https://archive.blender.org/developer/F211345/uvmap_crash.blend) 1. open the blend file 2. switch to texture paint mode with the object selected 3. blender crashes crashlog: ``` # Blender 2.75 (sub 2), Commit date: 2015-07-21 11:49, Hash 9ae39a1 bpy.ops.view3d.layers(nr=5, extend=False) # Operator bpy.context.scene.layers[10] = True # Property bpy.context.scene.layers[0] = True # Property bpy.ops.object.delete(use_global=False) # Operator bpy.ops.object.delete(use_global=False) # Operator bpy.context.space_data.recent_folders_active = 0 # Property bpy.ops.object.delete(use_global=False) # Operator bpy.ops.object.delete(use_global=False) # Operator bpy.context.space_data.context = 'MODIFIER' # Property bpy.ops.object.modifier_remove(modifier="Shrinkwrap") # Operator bpy.ops.object.modifier_remove(modifier="Lattice") # Operator bpy.ops.paint.texture_paint_toggle() # Operator # backtrace 35: BLI_system_backtrace - 0xF2304F0 34: blender_crash_handler_backtrace - 0xDFCBC60 33: blender_crash_handler - 0xDFCBCB0 32: windows_exception_handler - 0xDFCBF30 31: UnhandledExceptionFilter - 0x715F1AD0 30: memset - 0x742C5140 29: _C_specific_handler - 0x742B2800 28: _chkstk - 0x742C3E70 27: RtlRaiseException - 0x74283920 26: KiUserExceptionDispatcher - 0x742C3060 25: copy_v2_v2 - 0xED5FA10 24: cdDM_buffer_copy_uv_texpaint - 0xED6B0D0 23: cdDM_copy_gpu_data - 0xED6B9B0 22: gpu_buffer_setup - 0xEAB4710 21: gpu_buffer_setup_type - 0xEAB4BA0 20: gpu_buffer_setup_common - 0xEAB4C60 19: GPU_texpaint_uv_setup - 0xEAAF550 18: cdDM_drawFacesTex_common - 0xED67830 17: cdDM_drawFacesTex - 0xED67EF0 16: draw_mesh_textured_old - 0xE190170 15: draw_mesh_textured - 0xE18C2F0 14: draw_mesh_fancy - 0xE148E50 13: draw_mesh_object - 0xE149E10 12: draw_object - 0xE137610 11: view3d_draw_objects - 0xE124F00 10: view3d_main_area_draw_objects - 0xE126E50 9: view3d_main_area_draw - 0xE11C310 8: ED_region_do_draw - 0xE4AA9D0 7: wm_method_draw_triple - 0xE002590 6: wm_draw_update - 0xE000610 5: WM_main - 0xDFD0FB0 4: main - 0xDFCF4D0 3: __tmainCRTStartup - 0x125E80F0 2: mainCRTStartup - 0x125E8310 1: BaseThreadInitThunk - 0x722113B0 0: RtlUserThreadStart - 0x74245410 ```
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @DanielGrauer

Added subscriber: @DanielGrauer
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Can confirm

Can confirm

Added subscriber: @Psy-Fi

Added subscriber: @Psy-Fi
Antonis Ryakiotakis self-assigned this 2015-07-24 16:11:37 +02:00

Confirmed, thanks for the report.

Confirmed, thanks for the report.

I would be very interested to know how this file was created.

I would be very interested to know how this file was created.

The file even crashes on 2.75 official. It's caused by the stencil layer not being there (usually it's the same as the UV layer). Also looks like the stencil layer index is set to 2, while the mesh only has one UV layer. This should be impossible normally. I can add checks in the code to ensure it is within bounds, but best would be to know what caused the file to have this behaviour in the first place.

The file even crashes on 2.75 official. It's caused by the stencil layer not being there (usually it's the same as the UV layer). Also looks like the stencil layer index is set to 2, while the mesh only has one UV layer. This should be impossible normally. I can add checks in the code to ensure it is within bounds, but best would be to know what caused the file to have this behaviour in the first place.

Added subscriber: @sindra1961

Added subscriber: @sindra1961

Deletion of Shrinkwrap and Lattice modifier is recorded in crashlog attached in detail, but such modifier is not set in attached .blend file.
Is crashlog a thing recorded with attached .blend file?

Deletion of Shrinkwrap and Lattice modifier is recorded in crashlog attached in detail, but such modifier is not set in attached .blend file. Is crashlog a thing recorded with attached .blend file?
Author
Member

Added subscriber: @antony-2

Added subscriber: @antony-2
Author
Member

@antony-2: i will see if i can figure out what happened there
@perfection cat: it is the same blend file, i just stripped it down because i can not upload the full scene. but since it also happens when the modifiers are removed i dont think they are relevant to the problem.

@antony-2: i will see if i can figure out what happened there @perfection cat: it is the same blend file, i just stripped it down because i can not upload the full scene. but since it also happens when the modifiers are removed i dont think they are relevant to the problem.
Daniel Grauer changed title from uvmaap causes crash when entering texture paint mode to uvmap causes crash when entering texture paint mode 2015-07-27 10:29:06 +02:00
Author
Member

so i looked into the scene to see how this came to be, and it has a long history. Models in the scene have been made in the age of 2.49 and were at some point ported to 2.5+, there was a lot of stuff like multiple uvmaps, drivers, and deformation setups with lattices and such that have been removed over the years and also stencil layers.
my best guess is that we manually assigned a uvmap to a stencil layer which later got removed and somehow created this special case.

so i looked into the scene to see how this came to be, and it has a long history. Models in the scene have been made in the age of 2.49 and were at some point ported to 2.5+, there was a lot of stuff like multiple uvmaps, drivers, and deformation setups with lattices and such that have been removed over the years and also stencil layers. my best guess is that we manually assigned a uvmap to a stencil layer which later got removed and somehow created this special case.

How was the stencil layer assigned manually? was it through a python script?

The fix I will attempt will do two things:

  1. Block the code path that caused the issue from doing it (if it still exists, since this is such an old file, and only if you remember how it was done in the first place)
  2. Add code to the mesh_validate function to fix stencil indices. Then you'll have to run the function in the text editor. This should fix any invalid indices of stencils and you should be able to work on the file normally. I will post details here when it's ready.
How was the stencil layer assigned manually? was it through a python script? The fix I will attempt will do two things: 1) Block the code path that caused the issue from doing it (if it still exists, since this is such an old file, and only if you remember how it was done in the first place) 2) Add code to the mesh_validate function to fix stencil indices. Then you'll have to run the function in the text editor. This should fix any invalid indices of stencils and you should be able to work on the file normally. I will post details here when it's ready.
Author
Member

i think it was manually, i cant remember ever using a script for stencils.

i think it was manually, i cant remember ever using a script for stencils.
Author
Member

This comment was removed by @DanielGrauer

*This comment was removed by @DanielGrauer*

This issue was referenced by 67e32b3195

This issue was referenced by 67e32b31951b8b570148bd8b456afac27bb9645a

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Since there is no recollection of how the file was produced and there's such a complicated history, we can do little to fix the real cause of the issue. There is a big chance this won't happen with regular use of recent versions though.

To fix the file, I have added functionality in mesh validation that fixes the invalid indices for you.
Just go to a text editor or a console and run this python script:

import bpy

for me in bpy.data.meshes:
    me.validate()

Since there is no recollection of how the file was produced and there's such a complicated history, we can do little to fix the real cause of the issue. There is a big chance this won't happen with regular use of recent versions though. To fix the file, I have added functionality in mesh validation that fixes the invalid indices for you. Just go to a text editor or a console and run this python script: ``` import bpy for me in bpy.data.meshes: me.validate() ```
Author
Member

thanks a lot for adding the functionality! i also dont think this will happen with recent files and probably not possible to reproduce this without messing with very old blender versions.

thanks a lot for adding the functionality! i also dont think this will happen with recent files and probably not possible to reproduce this without messing with very old blender versions.
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
5 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#45514
No description provided.