bisect_plane via python crashes blender #72465

Closed
opened 2019-12-15 17:10:49 +01:00 by richard schweiger · 5 comments

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.31

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: blender/blender@f1aa4d18d4

Short description of error
reduced the script to a minimum just reading the bmesh and oparating the bisect.
when i hit "run script" bledner crashes in running the bisect line.

Exact steps for others to reproduce the error
see the file attached having the script:

import bpy
from mathutils import Vector,Matrix
import bmesh
obj=bpy.context.scene.objects["Cube"]
bpy.ops.object.mode_set(mode='EDIT');
bm = bmesh.from_edit_mesh(obj.data)
visible_geom = [g for g in bm.faces- [x] + bm.verts- [x] + bm.edges[:]]
loc=Vector([0,0,0.25])
bisectno=Vector([0,0,1])bisect_test.blend
bmesh.ops.bisect_plane( bm, geom=visible_geom, dist=0.001, plane_co=loc, plane_no=bisectno)

**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.31 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: `blender/blender@f1aa4d18d4` **Short description of error** reduced the script to a minimum just reading the bmesh and oparating the bisect. when i hit "run script" bledner crashes in running the bisect line. **Exact steps for others to reproduce the error** see the file attached having the script: import bpy from mathutils import Vector,Matrix import bmesh obj=bpy.context.scene.objects["Cube"] bpy.ops.object.mode_set(mode='EDIT'); bm = bmesh.from_edit_mesh(obj.data) visible_geom = [g for g in bm.faces- [x] + bm.verts- [x] + bm.edges[:]] loc=Vector([0,0,0.25]) bisectno=Vector([0,0,1])[bisect_test.blend](https://archive.blender.org/developer/F8223397/bisect_test.blend) bmesh.ops.bisect_plane( bm, geom=visible_geom, dist=0.001, plane_co=loc, plane_no=bisectno)

Added subscriber: @office

Added subscriber: @office
richard schweiger changed title from bisect_plane via python crashes belnder to bisect_plane via python crashes blender 2019-12-15 17:11:09 +01:00
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

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

Changed status from 'Needs Triage' to: 'Archived'
Jacques Lucke self-assigned this 2019-12-29 15:00:06 +01:00
Member

The issue seems to be not directly related to bisect_plane. Two things indicate that:

  1. The crash happens in the drawing code.
  2. When I add bpy.ops.object.mode_set(mode='OBJECT') or bmesh.update_edit_mesh(obj.data) as last line, it does not crash anymore.

I think the bug here is in your code. You take the bmesh from edit mesh, modify it, and don't write it back.

Closing because it is probably wrong api usage.

The issue seems to be not directly related to `bisect_plane`. Two things indicate that: 1. The crash happens in the drawing code. 2. When I add `bpy.ops.object.mode_set(mode='OBJECT')` or `bmesh.update_edit_mesh(obj.data)` as last line, it does not crash anymore. I think the bug here is in your code. You take the bmesh from edit mesh, modify it, and don't write it back. Closing because it is probably wrong api usage.

thank you! sorry for bothering then.

thank you! sorry for bothering then.
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#72465
No description provided.