question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image compositor crash / temporary mesh invalidation

See original GitHub issue

This is a strange crash, and I had some trouble creating a minimal reproduce case for it.

To reproduce it, I needed to:

  • Merge two textures in such a way that they call @scurest’s (awesome) image compositor.
  • Turn on “Smooth Shading” and “Auto Normals” for the mesh, such that it will need normal splitting.
  • Turn on “Apply Modifiers” such that the normals will get split.

Here’s a Blender 2.81a project that will reproduce the problem, but only on newer (2.82) versions of this glTF addon.

crashy_cube.zip

Unfortunately, this crash now happens in the stable release of 2.82. It’s new there, it didn’t happen in the stable release of Blender 2.81a.

But, the problem can be reproduced in 2.81a, if one manually applies a newer version of this addon to it. That means the problem is localized to the addon, not a change in Blender itself. From there I was able to run git bisect to get an exact ID for which commit introduces the problem.

Git bisect says: 4b460489cdba12bb01954a2748cd7209e6549959 is the first bad commit.

The crash writes this to the console:

Traceback (most recent call last):
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\__init__.py", line 487, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 40, in save
    json, buffer = __export(export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 53, in __export
    __gather_gltf(exporter, export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 62, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 37, in gather_gltf2
    scenes.append(__gather_scene(blender_scene, export_settings))
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 56, in __gather_scene
    node = gltf2_blender_gather_nodes.gather_node(blender_object, blender_scene, export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 46, in gather_node
    node = __gather_node(blender_object, blender_scene, export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 64, in __gather_node
    mesh=__gather_mesh(blender_object, export_settings),
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 337, in __gather_mesh
    export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_mesh.py", line 43, in gather_mesh
    weights=__gather_weights(blender_mesh, vertex_groups, modifiers, export_settings)
  File "D:\emackey\Git_Large\glTF-Blender-IO\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_mesh.py", line 138, in __gather_weights
    if not export_settings[MORPH] or not blender_mesh.shape_keys:
ReferenceError: StructRNA of type Mesh has been removed

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
juliendurourecommented, Feb 21, 2020

Thanks a lot @scurest , it was my plan to get this minimal script to reproduce the bug, but you did it first! Thanks 😃

1reaction
scurestcommented, Feb 21, 2020

Script to reproduce this without needing the whole addon (maybe useful for asking upstream).

Open @emackey’s crashy_cube.blend, put this in the text editor and run it. It will crash.
If at least one of the if Trues is changed to if False, the crash goes away.

import bpy

ob = bpy.data.objects['Cube']

edge_split = ob.modifiers.new('Temporary_Auto_Smooth', 'EDGE_SPLIT')
ob.data.use_auto_smooth = False

depsgraph = bpy.context.evaluated_depsgraph_get()
mesh_owner = ob.evaluated_get(depsgraph)
mesh = mesh_owner.to_mesh(preserve_all_data_layers=True, depsgraph=depsgraph)

if True:
    ob.data.use_auto_smooth = True 
    ob.modifiers.remove(edge_split)

if True:
    scn = bpy.data.scenes.new('temp scene')
    scn.use_nodes = True
    scn.node_tree.nodes.remove(scn.node_tree.nodes['Render Layers'])
    bpy.ops.render.render(scene=scn.name, write_still=True)

print(mesh.name)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error exporting shapekeys on blender 2.82 · Issue #930 - GitHub
image. Not sure yet why error occurs or not depending on material. ... Image compositor crash / temporary mesh invalidation #932.
Read more >
UI Invalidation - Unreal Engine Documentation
How Invalidation Works. Volatile Widgets. Invalidation is a system that reduces the CPU usage of UI by limiting how often it repaints widgets....
Read more >
T93310 Compositor: Crash due to broken image paths
Blender will crash because of broken image paths. Solution: Solve the paths in Blender 2.93 first. Exact steps for others to reproduce the...
Read more >
User Guide :: Nsight Graphics Documentation
Nsight Graphics™ is a standalone application for the debugging, profiling, and analysis of graphics applications. Nsight Graphics supports ...
Read more >
gcloud compute images deprecate - Documentation
For example, specifying 30d sets the planned DELETED time to 30 days from the current system time, but does not delete the image....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found