QuadRemesher plugin crashes Blender 2.83 and 2.9 on Windows (in python code that hides and import a fbx) #77046

Closed
opened 2020-05-25 09:17:55 +02:00 by MaximeRouca · 23 comments

System Information
Operating system: windows
Graphics card: nvidia

Blender Version
Broken: 2.83 and 2.90
Worked: 2.82a

Short description of error
Hello,
I'm the developer of QuadRemesher (an automatic quad remeshing addon for Blender).
My addon (v1.0) is working well in 2.82 but crashes blender 2.83 and 2.9.
I found a workaround (in QR 1.1 CR3) but I think the crash needs to be fixed inside Blender to improve Blender stability.

My addon basically works like this: when you press "Remesh It", it:

  • exports the selected mesh in a fbx file (inputFile)
  • launches en executable which reads the inputFile, computes the quad remeshing, export the resulting quad-based mesh in a fbx file : retopoFile.
  • hides the selected objects and imports the retopoFile in the scene

This is crashing Blender 2.83 and 2.90 in the 3rd step (hide and import)
The workaround is just to switch the order of "hiding" and "importing" operations.
So in 1.1 CR3 I do : "imports" the retopoFile and then "hides the previously selected object".
With this order, Blender 2.83 / 2.90 is not crashing anymore.

Exact steps for others to reproduce the error
You will have to download and install my plugin : https://exoside.com/quadremesher/quadremesher-download/
(use the 1.0 if you want to reproduce the crash)
Once installed (see https://youtu.be/6BvP3rXeRRI),
you just need to click on "Remesh It" button with the "starting" Cube selected
The issue is in function doRemeshing_Finish (see "hide_set" and "import_mesh_fbx" calls)

**System Information** Operating system: windows Graphics card: nvidia **Blender Version** Broken: 2.83 and 2.90 Worked: 2.82a **Short description of error** Hello, I'm the developer of QuadRemesher (an automatic quad remeshing addon for Blender). My addon (v1.0) is working well in 2.82 but crashes blender 2.83 and 2.9. I found a workaround (in QR 1.1 CR3) but I think the crash needs to be fixed inside Blender to improve Blender stability. My addon basically works like this: when you press "Remesh It", it: - exports the selected mesh in a fbx file (inputFile) - launches en executable which reads the inputFile, computes the quad remeshing, export the resulting quad-based mesh in a fbx file : retopoFile. - hides the selected objects and imports the retopoFile in the scene This is crashing Blender 2.83 and 2.90 in the 3rd step (hide and import) The workaround is just to switch the order of "hiding" and "importing" operations. So in 1.1 CR3 I do : "imports" the retopoFile and then "hides the previously selected object". With this order, Blender 2.83 / 2.90 is not crashing anymore. **Exact steps for others to reproduce the error** You will have to download and install my plugin : https://exoside.com/quadremesher/quadremesher-download/ (use the 1.0 if you want to reproduce the crash) Once installed (see https://youtu.be/6BvP3rXeRRI), you just need to click on "Remesh It" button with the "starting" Cube selected The issue is in function doRemeshing_Finish (see "hide_set" and "import_mesh_fbx" calls)
Author

Added subscriber: @Max33

Added subscriber: @Max33
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Can this be reproduced with a simpler setup? (I assume this is not depending on the export as well as the remeshing at all?)

So something like this:

  • provide a blend file (share here -- also the fbx that will be imported) with
  • a minimal script that imports a simple fbx first, then hides --> no crash
  • a minimal script that hides first then imports a simple fbx --> crash

This will help reduce the time reproducing and tracking down the issue, thx in advance!

Can this be reproduced with a simpler setup? (I assume this is not depending on the export as well as the remeshing at all?) So something like this: - provide a blend file (share here -- also the fbx that will be imported) with - a minimal script that imports a simple fbx first, then hides --> no crash - a minimal script that hides first then imports a simple fbx --> crash This will help reduce the time reproducing and tracking down the issue, thx in advance!
Author

OK.

Here is a simple script that crashes Blender 2.83 and 2.90:
I call this function in the execute() function of an operator.
Just call it with the cube which is created when Blender starts.

def test_crash():
sel_objects = bpy.context.selected_objects
if len(sel_objects) != 1:
return
input_obj = sel_objects[0]

# 1 - export
myfilepath = "C:/Users/Public/testcrash.fbx"
bpy.ops.export_scene.fbx(filepath=myfilepath, use_selection=True)

# 2 - hide
input_obj.hide_set(state=True)

# 3 - import
bpy.ops.import_scene.fbx(filepath=myfilepath)

And this one works:
def working_case():
sel_objects = bpy.context.selected_objects
if len(sel_objects) != 1:
return
input_obj = sel_objects[0]

# 1 - export
myfilepath = "C:/Users/Public/testcrash.fbx"
bpy.ops.export_scene.fbx(filepath=myfilepath, use_selection=True)

# 3 - import
bpy.ops.import_scene.fbx(filepath=myfilepath)

# 2 - hide
input_obj.hide_set(state=True)
OK. Here is a simple script that crashes Blender 2.83 and 2.90: I call this function in the execute() function of an operator. Just call it with the cube which is created when Blender starts. def test_crash(): sel_objects = bpy.context.selected_objects if len(sel_objects) != 1: return input_obj = sel_objects[0] # 1 - export myfilepath = "C:/Users/Public/testcrash.fbx" bpy.ops.export_scene.fbx(filepath=myfilepath, use_selection=True) # 2 - hide input_obj.hide_set(state=True) # 3 - import bpy.ops.import_scene.fbx(filepath=myfilepath) And this one works: def working_case(): sel_objects = bpy.context.selected_objects if len(sel_objects) != 1: return input_obj = sel_objects[0] # 1 - export myfilepath = "C:/Users/Public/testcrash.fbx" bpy.ops.export_scene.fbx(filepath=myfilepath, use_selection=True) # 3 - import bpy.ops.import_scene.fbx(filepath=myfilepath) # 2 - hide input_obj.hide_set(state=True)

Added subscriber: @filibis

Added subscriber: @filibis
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Cannot reproduce here.
Checked in both 2.83 and 2.90 buildbot builds with this file:
#77046.blend

Just to be really sure: does it crash with the file above for you?

Cannot reproduce here. Checked in both 2.83 and 2.90 buildbot builds with this file: [#77046.blend](https://archive.blender.org/developer/F8555389/T77046.blend) Just to be really sure: does it crash with the file above for you?
Author

Yes it works if you run it outside of an operator.
But, as described in my previous message, it crashes when launched inside an operator execute() method. (at least on my computer with 2.83 and 2.90)
I attached an addon which allows to reproduce the crash.
(put it in the scripts/addons folder, enable it in the Prefs / Addons, hit 'N', open the QRTestCrash tab, click on <>)quad_remesher_crash.zip

Yes it works if you run it outside of an operator. But, as described in my previous message, it crashes when launched inside an operator execute() method. (at least on my computer with 2.83 and 2.90) I attached an addon which allows to reproduce the crash. (put it in the scripts/addons folder, enable it in the Prefs / Addons, hit 'N', open the QRTestCrash tab, click on <<Remesh It>>)[quad_remesher_crash.zip](https://archive.blender.org/developer/F8560511/quad_remesher_crash.zip)
Member

Also no crash here with the Addon you provided.
(I had to change myfilepath in the script to something writable on linux, but no, no crash here)

Do you have the chance to test this on another machine?
You could also check if there are possibly other Addons interfering? File > Defaults > Load Factory Settings and only enable that one Addon?

Also no crash here with the Addon you provided. (I had to change `myfilepath` in the script to something writable on linux, but no, no crash here) Do you have the chance to test this on another machine? You could also check if there are possibly other Addons interfering? `File` > `Defaults` > `Load Factory Settings` and only enable that one Addon?
Author

I tested on Linux. It works on my Linux.... but not on my Windows 10....
Can you test on Windows ?

I tested on Linux. It works on my Linux.... but not on my Windows 10.... Can you test on Windows ?

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Needs developer to test on windows.

Needs developer to test on windows.
Campbell Barton changed title from QuadRemesher plugin crashes Blender 2.83 and 2.9 (in python code that hides and import a fbx) to QuadRemesher plugin crashes Blender 2.83 and 2.9 on Windows (in python code that hides and import a fbx) 2020-06-16 05:32:57 +02:00
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

Changed status from 'Needs Developer To Reproduce' to: 'Needs User Info'

Changed status from 'Needs Developer To Reproduce' to: 'Needs User Info'
Member

no repro with 2.83 or 2.90 even tried the hardened heap.

Given you have the crash with 2.90, when you run it from the command line, and it crashes it should tell you the location of the crash report (generally somewhere in the temp folder) please attach this file to this report.

no repro with 2.83 or 2.90 even tried the hardened heap. Given you have the crash with 2.90, when you run it from the command line, and it crashes it should tell you the location of the crash report (generally somewhere in the temp folder) please attach this file to this report.

This report requires far too many steps to redo, please include a sample blend file that includes a script that crashes on execution.

This report requires far too many steps to redo, please include a sample blend file that includes a script that crashes on execution.
Author

The simple script has already been provided (see history of this conversation : May 25, 3 PM)
And (May 28 6 PM) -> you can download the zip with the code inside...

The simple script has already been provided (see history of this conversation : May 25, 3 PM) And (May 28 6 PM) -> you can download the zip with the code inside...
Member

In #77046#954666, @LazyDodo wrote:
no repro with 2.83 or 2.90 even tried the hardened heap.

Given you have the crash with 2.90, when you run it from the command line, and it crashes it should tell you the location of the crash report (generally somewhere in the temp folder) please attach this file to this report.

@Max33 : please the above ^^

> In #77046#954666, @LazyDodo wrote: > no repro with 2.83 or 2.90 even tried the hardened heap. > > Given you have the crash with 2.90, when you run it from the command line, and it crashes it should tell you the location of the crash report (generally somewhere in the temp folder) please attach this file to this report. @Max33 : please the above ^^
Author

Hello the bug seems to be fixed.
I can reproduce the crash in 2.83 Beta (Date 2020-05-15)
And the crash doesn't happen with Blender 2.83.2 .

Hello the bug seems to be fixed. I can reproduce the crash in 2.83 Beta (Date 2020-05-15) And the crash doesn't happen with Blender 2.83.2 .

Changed status from 'Needs User Info' to: 'Resolved'

Changed status from 'Needs User Info' to: 'Resolved'
Campbell Barton self-assigned this 2020-07-19 10:25:56 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 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#77046
No description provided.