Archipack floor preset crashes Blender debug build #75394

Closed
opened 2020-04-05 00:27:58 +02:00 by Robert Guetzkow · 7 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.30

Blender Version
Broken: version: 2.83 (sub 11), branch: master, commit date: 2020-04-04 16:55, hash: blender/blender@505a19ed75
Worked: 2.82a

Short description of error
Calling Archipack's floor operator bpy.ops.archipack.floor() with the tile_30x60.py preset crashes a Blender debug build. The issue seems to be a call to bmesh.ops.bevel() in archipack_floor.py which triggers an assert due to a normal being zero.

BM_loop_interp_from_face(BMesh * bm, BMLoop * l_dst, const BMFace * f_src, const bool do_vertex, const bool do_multires) Line 748	C
bev_create_ngon(BMesh * bm, BMVert * * vert_arr, const int totv, BMFace * * face_arr, BMFace * facerep, BMEdge * * edge_arr, int mat_nr, bool do_interp) Line 684	C
bevel_build_poly(BevelParams * bp, BMesh * bm, BevVert * bv) Line 5236	C
build_vmesh(BevelParams * bp, BMesh * bm, BevVert * bv) Line 5482	C
BM_mesh_bevel(BMesh * bm, const float offset, const int offset_type, const int segments, const float profile, const bool vertex_only, const bool use_weights, const bool limit_offset, const MDeformVert * dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, const bool harden_normals, const int face_strength_mode, const int miter_outer, const int miter_inner, const float spread, const float smoothresh, const bool use_custom_profile, const CurveProfile * custom_profile, const int vmesh_method) Line 7296	C
bmo_bevel_exec(BMesh * bm, BMOperator * op) Line 100	C
BMO_op_exec(BMesh * bm, BMOperator * op) Line 221	C
BPy_BMO_call(BPy_BMeshOpFunc * self, _object * args, _object * kw) Line 817	C

Exact steps for others to reproduce the error

  • Open the preferences and enable the Archipack add-on (Edit > Preferences > Add-ons)
  • Render presets thumbs in Archipacks preferences (this will already cause the error in a subprocess during the thumbnail creation)

Switch to the Scripting workspace and run the following script

import bpy
from pathlib import Path


preset_paths = bpy.utils.script_paths("presets")
for path in preset_paths:
    archipack_preset = Path(path) / "archipack_floor" / "tile_30x60.py"
    if archipack_preset.is_file():
        bpy.ops.archipack.floor("INVOKE_DEFAULT", filepath=str(archipack_preset), auto_manipulate=False)
        break
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.30 **Blender Version** Broken: version: 2.83 (sub 11), branch: master, commit date: 2020-04-04 16:55, hash: `blender/blender@505a19ed75` Worked: 2.82a **Short description of error** Calling Archipack's floor operator `bpy.ops.archipack.floor()` with the `tile_30x60.py` preset crashes a Blender debug build. The issue seems to be a call to `bmesh.ops.bevel()` in [archipack_floor.py ](https://developer.blender.org/diffusion/BA/browse/master/archipack/archipack_floor.py) which triggers an assert due to a normal being zero. ``` BM_loop_interp_from_face(BMesh * bm, BMLoop * l_dst, const BMFace * f_src, const bool do_vertex, const bool do_multires) Line 748 C bev_create_ngon(BMesh * bm, BMVert * * vert_arr, const int totv, BMFace * * face_arr, BMFace * facerep, BMEdge * * edge_arr, int mat_nr, bool do_interp) Line 684 C bevel_build_poly(BevelParams * bp, BMesh * bm, BevVert * bv) Line 5236 C build_vmesh(BevelParams * bp, BMesh * bm, BevVert * bv) Line 5482 C BM_mesh_bevel(BMesh * bm, const float offset, const int offset_type, const int segments, const float profile, const bool vertex_only, const bool use_weights, const bool limit_offset, const MDeformVert * dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, const bool harden_normals, const int face_strength_mode, const int miter_outer, const int miter_inner, const float spread, const float smoothresh, const bool use_custom_profile, const CurveProfile * custom_profile, const int vmesh_method) Line 7296 C bmo_bevel_exec(BMesh * bm, BMOperator * op) Line 100 C BMO_op_exec(BMesh * bm, BMOperator * op) Line 221 C BPy_BMO_call(BPy_BMeshOpFunc * self, _object * args, _object * kw) Line 817 C ``` **Exact steps for others to reproduce the error** - Open the preferences and enable the Archipack add-on (*Edit > Preferences > Add-ons*) - *Render presets thumbs* in Archipacks preferences (this will already cause the error in a subprocess during the thumbnail creation) # Switch to the *Scripting* workspace and run the following script ``` import bpy from pathlib import Path preset_paths = bpy.utils.script_paths("presets") for path in preset_paths: archipack_preset = Path(path) / "archipack_floor" / "tile_30x60.py" if archipack_preset.is_file(): bpy.ops.archipack.floor("INVOKE_DEFAULT", filepath=str(archipack_preset), auto_manipulate=False) break ```
Author
Member

Added subscriber: @rjg

Added subscriber: @rjg
Robert Guetzkow changed title from Archipack floor operator crashes Blender to bmesh.ops.bevel crashes Blender 2020-04-05 01:09:57 +02:00
Author
Member

Added subscribers: @HooglyBoogly, @howardt

Added subscribers: @HooglyBoogly, @howardt
Author
Member

@HooglyBoogly @howardt This might be for you.

@HooglyBoogly @howardt This might be for you.
Author
Member

The assert is triggered in BM_loop_interp_from_face because one normal is (0.0, 0.0, 0.0).

BLI_assert(BM_face_is_normal_valid(f_src));
The assert is triggered in `BM_loop_interp_from_face` because one normal is (0.0, 0.0, 0.0). ``` BLI_assert(BM_face_is_normal_valid(f_src)); ```
Author
Member

The issue is not in bmesh.ops.bevel(). It seems that Archipack needs to updated the normals prior to beveling the geometry.

The issue is not in `bmesh.ops.bevel()`. It seems that Archipack needs to updated the normals prior to beveling the geometry.
Robert Guetzkow changed title from bmesh.ops.bevel crashes Blender to Archipack floor preset crashes Blender debug build 2020-04-06 22:22:54 +02:00

This issue was referenced by fb6d7c4ed8

This issue was referenced by fb6d7c4ed81bc58d15ab81f59292b14f86073bd9
Author
Member

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Robert Guetzkow self-assigned this 2020-04-07 15:45:50 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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-addons#75394
No description provided.