Maniphest T75394

Archipack floor preset crashes Blender debug build
Closed, ResolvedBUG

Assigned To
Robert Guetzkow (rjg)
Authored By
Robert Guetzkow (rjg)
Apr 5 2020, 12:27 AM
Tags
  • BF Blender
  • Add-ons (Community)
Subscribers
Hans Goudey (HooglyBoogly)
Howard Trickey (howardt)
Robert Guetzkow (rjg)

Description

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: rB505a19ed75b2
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

  1. Open the preferences and enable the Archipack add-on (Edit > Preferences > Add-ons)
  2. Render presets thumbs in Archipacks preferences (this will already cause the error in a subprocess during the thumbnail creation)
  3. 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

Revisions and Commits

rBA Blender Add-ons
D7364

Event Timeline

Robert Guetzkow (rjg) created this task.Apr 5 2020, 12:27 AM
Robert Guetzkow (rjg) updated the task description.Apr 5 2020, 12:37 AM
Robert Guetzkow (rjg) updated the task description.
Robert Guetzkow (rjg) updated the task description.Apr 5 2020, 12:48 AM
Robert Guetzkow (rjg) updated the task description.Apr 5 2020, 12:52 AM
Robert Guetzkow (rjg) updated the task description.Apr 5 2020, 12:56 AM
Robert Guetzkow (rjg) updated the task description.
Robert Guetzkow (rjg) renamed this task from Archipack floor operator crashes Blender to bmesh.ops.bevel crashes Blender.Apr 5 2020, 1:09 AM
Robert Guetzkow (rjg) updated the task description.
Robert Guetzkow (rjg) added subscribers: Hans Goudey (HooglyBoogly), Howard Trickey (howardt).Apr 5 2020, 1:13 AM

@Hans Goudey (HooglyBoogly) @Howard Trickey (howardt) This might be for you.

Robert Guetzkow (rjg) updated the task description.Apr 5 2020, 1:20 AM
Robert Guetzkow (rjg) added a comment.Apr 5 2020, 3:54 PM

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));
Robert Guetzkow (rjg) added a comment.Apr 6 2020, 10:21 PM

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

Robert Guetzkow (rjg) renamed this task from bmesh.ops.bevel crashes Blender to Archipack floor preset crashes Blender debug build.Apr 6 2020, 10:22 PM
Robert Guetzkow (rjg) updated the task description.
Robert Guetzkow (rjg) added a project: Add-ons (Community).Apr 7 2020, 1:38 PM
Robert Guetzkow (rjg) closed this task as Resolved by committing rBAfb6d7c4ed81b: Fix T75394: Archipack update normals before beveling.Apr 7 2020, 3:45 PM
Robert Guetzkow (rjg) claimed this task.
Robert Guetzkow (rjg) added a commit: rBAfb6d7c4ed81b: Fix T75394: Archipack update normals before beveling.
Robert Guetzkow (rjg) changed the subtype of this task from "Report" to "Bug".May 1 2020, 11:21 AM