Page MenuHome

Autocomplete bug with mesh.loop_triangles. in Blender Python Consolle
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Win 10 Pro and linux
Graphics card: Gtx1080ti / Gtx 970

Blender Version
Broken: 2.82

if try to autocomplete in the py console, blender crashes

mesh = bpy.data.meshes.new('Test')
mesh.loop_triangles. #Type till . and hit tab.

Event Timeline

Ankit Meel (ankitm) changed the task status from Needs Triage to Needs Information from User.EditedFeb 19 2020, 11:57 AM

On default setup, it doesn't crash on 2.83 if I type mesh.loop and press tab, it gives two green options s and _triangles. I enter _ and hit tab, it correctly autocompletes.
Are you using some other file? Please attach that. Also try on 2.83, get it from https://builder.blender.org

I confirm that what you said it does, but if I try to add a "." and I try to autocomplete, it will crash 2.82 currently, and 2.83 same crash
So mesh.loop_triangles. .... autocomplete ... crash

Oh yeah, misunderstood that part. Segmentation fault: 11

Ankit Meel (ankitm) changed the task status from Needs Information from User to Needs Triage.Feb 19 2020, 12:06 PM
Ankit Meel (ankitm) updated the task description. (Show Details)
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Feb 19 2020, 5:40 PM

me->mloop was NULL

>	blender.exe!rna_MeshLoopTriangle_area_get(PointerRNA * ptr) Line 473	C
 	blender.exe!pyrna_prop_to_py(PointerRNA * ptr, PropertyRNA * prop) Line 1526	C
 	blender.exe!pyrna_prop_collection_getattro(BPy_PropertyRNA * self, _object * pyname) Line 4571	C
 	[Externí kód]	
 	blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8333	C
 	blender.exe!rna_operator_execute_cb(bContext * C, wmOperator * op) Line 1307	C
 	blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1279	C
 	blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1514	C
 	blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1529	C
 	blender.exe!console_indent_or_autocomplete_exec(bContext * C, wmOperator * UNUSED_op) Line 486	C
 	blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1279	C
 	blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2091	C
 	blender.exe!wm_handlers_do_keymap_with_keymap_handler(bContext * C, wmEvent * event, ListBase * handlers, wmEventHandler_Keymap * handler, wmKeyMap * keymap, const bool do_debug_handler) Line 2401	C
 	blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2537	C
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2802	C
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3255	C
 	blender.exe!WM_main(bContext * C) Line 421	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 520	C
 	[Externí kód]
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".

We can harden the RNA accessors fairly easily, but the root of the issue here is that mesh.loop_triangles is seen as an actual looptri item, with completely wrong random values, when RNA should detect that the looptri array is empty (its len is at zero)... Still investigating what exactly is wrong here.

Wow... Think that's the cutest typo-bug I have seen in a while... and it has been there for over one year! It's actually quiet impressive to see that RNA survived to that mistake for so long. :P