Archipack generator list index out of range
Archipack version: 2.3.1
Blender version: 2.83
Os version: Gentoo Linux
Description of the issue:
I triggered this Blender segfault. I don't know how I triggered it. I was selecting an Archipack wall and attempting to scale it by -1 in the X axis to flip it horizontally, and I think it sliced the wall instead (since I pressed the S key) and then it crashed. Hopefully this console log helps narrow it down:
./blender :)
Read prefs: /home/dion/.config/blender/2.83/config/userpref.blend
/run/user/1000/gvfs/ non-existent directory
found bundled python: /home/dion/drive/blender/blender-2.83.1-linux64/2.83/python
DEBUG:BlenderGIS-master.core.checkdeps:GDAL Python binding unavailable
DEBUG:BlenderGIS-master.core.checkdeps:PyProj unavailable
DEBUG:BlenderGIS-master.core.checkdeps:Pillow unavailable
DEBUG:BlenderGIS-master.core.checkdeps:ImageIO Freeimage plugin available
Warning: class BIM_OT_copy_attributes_to_selection contains a property which should be an annotation!
/home/dion/.config/blender/2.83/scripts/addons/blenderbim/bim/__init__.py:271
assign as a type annotation: BIM_OT_copy_attributes_to_selection.prop_base
assign as a type annotation: BIM_OT_copy_attributes_to_selection.prop_name
assign as a type annotation: BIM_OT_copy_attributes_to_selection.sub_props
assign as a type annotation: BIM_OT_copy_attributes_to_selection.collection_element
Warning: class BIM_OT_add_annotation contains a property which should be an annotation!
/home/dion/.config/blender/2.83/scripts/addons/blenderbim/bim/__init__.py:271
assign as a type annotation: BIM_OT_add_annotation.obj_name
assign as a type annotation: BIM_OT_add_annotation.data_type
register_class(...):
Warning: 'HYY_OT_status_dd' doesn't contain '_HT_' with prefix & suffix
----------------------------------------------
2020-08-02 08:18:39,820 INFO archipack_io_export_ifc.py 59 BlenderBIM addon not found cannot import name 'QtoCalculator' from 'blenderbim.bim.export_ifc' (/home/dion/.config/blender/2.83/scripts/addons/blenderbim/bim/export_ifc.py)
BlenderBIM addon not found cannot import name 'QtoCalculator' from 'blenderbim.bim.export_ifc' (/home/dion/.config/blender/2.83/scripts/addons/blenderbim/bim/export_ifc.py)
Archipack PRO : blenderBIM addon not found, support for bim export will be disabled
Archipack PRO 2.3.1 : ready
----------------------------------------------
CAD Transform 0.0.8 : ready
Info: Deleted 1 object(s)
Info: Deleted 2 object(s)
update_path curve not found name:
update_path curve not found name:
update_path curve not found name:
Archipack: Unable to load default material library, please check path in addon prefs [Errno 2] No such file or directory: ''
Archipack: Unable to load default material library, please check path in addon prefs [Errno 2] No such file or directory: ''
Archipack: Unable to load default material library, please check path in addon prefs [Errno 2] No such file or directory: ''
Error in sys.excepthook:
Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/BlenderGIS-master/__init__.py", line 79, in _excepthook
if 'BlenderGIS' in exc_traceback.tb_frame.f_code.co_filename:
AttributeError: 'NoneType' object has no attribute 'tb_frame'
Original exception was:
File "<string>", line 1
.
^
SyntaxError: unexpected EOF while parsing
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 't' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 't' is not defined
exclude_selected_face
exclude_selected_face
exclude_selected_face
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 't' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 't' is not defined
exclude_selected_face
exclude_selected_face
exclude_selected_face
Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_curveman.py", line 848, in execute
new_g, origin = g.split(self.index, self.t)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_generator.py", line 1977, in split
_k = Line(co, last=part1[-1])
IndexError: list index out of range
location: /home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py:201
location: /home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py:201
Error: Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_curveman.py", line 848, in execute
new_g, origin = g.split(self.index, self.t)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_generator.py", line 1977, in split
_k = Line(co, last=part1[-1])
IndexError: list index out of range
location: /home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py:201
Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 3772, in modal
res = manips[key].manipulable.manipulable_modal(context, event, o, self.lock)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 4048, in manipulable_modal
if manipulator.modal(context, event):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 671, in modal
return self.keyboard_event(context, event)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 1474, in keyboard_event
self.mouse_press(context, event)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 1491, in mouse_press
op(**params)
File "/home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_curveman.py", line 848, in execute
new_g, origin = g.split(self.index, self.t)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_generator.py", line 1977, in split
_k = Line(co, last=part1[-1])
IndexError: list index out of range
location: /home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py:201
location: <unknown location>:-1
location: <unknown location>:-1
Error: Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 3772, in modal
res = manips[key].manipulable.manipulable_modal(context, event, o, self.lock)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 4048, in manipulable_modal
if manipulator.modal(context, event):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 671, in modal
return self.keyboard_event(context, event)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 1474, in keyboard_event
self.mouse_press(context, event)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_manipulator.py", line 1491, in mouse_press
op(**params)
File "/home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_curveman.py", line 848, in execute
new_g, origin = g.split(self.index, self.t)
File "/home/dion/.config/blender/2.83/scripts/addons/archipack_20/archipack_generator.py", line 1977, in split
_k = Line(co, last=part1[-1])
IndexError: list index out of range
location: /home/dion/drive/blender/blender-2.83.1-linux64/2.83/scripts/modules/bpy/ops.py:201
location: <unknown location>:-1
Writing: /tmp/blender.crash.txt
[1] 16550 segmentation fault ./blender
Aha, if I press the "S" key to scale a wall but my cursor is not at a valid "Split" point along the wall, it triggers the list index out of range error. I understand that the "S" to scale vs "S" to split is a conflict, so perhaps it should fail silently, or fallthru to "Scale" if your mouse is not in a splittable location?
Also, if I take a wall, move cursor to a splittable location, press S to split, and then press Ctrl-Z to undo, Blender segfaults.
Scale for archipack walls is not supported at this time, unless i do listen to scale events, there is no way to handle scale action at data structure level - so wall is not aware of user scale action and parametric dimensions may then no more be relevant.
"S" to split shortcut is configurable in preferences.
I guess undo trigger segfault as manipulators pointers probably are not properly recovered. Looks like enabling "undo legacy" in preference solve this issue.
@s-leger if the undo segfault is due to Blender's new undo system, is that a Blender bug instead?
As far as i can tell, manipulators pointers location to memory is not correctly reverted.