neverhood311 / Stop-motion-OBJ

A Blender add-on for importing a sequence of OBJ meshes as frames
GNU General Public License v3.0
675 stars 52 forks source link

Streamed mesh sequence: Blender crashes randomly while rendering animation #174

Open Arnache opened 1 year ago

Arnache commented 1 year ago

System Information Operating system: tested on

Blender version : 3.4.1 on both

Addon version Broken: 2.1.1 and 2.2.0.beta.0 too Worked: I don't know

Describe the bug Blender crashes randomly while rendering animation of a streamed mesh sequence.

Steps To Reproduce

  1. Create 1000 OBJ meshes, without material. My meshes range from 700 kB to 16MB.
  2. Import them with Stop-motion-OBJ using Cache mode "Streamed".
  3. Select the imported object, then Properties panel (Shift-F7) > Object Properties tab > Stop motion OBJ > Streaming > Cache size : set to 1 so that memory is freed after each mesh is updated between frames (default is 0 which means "keep everything" according to the tool tip).
  4. Choose Cycles as render engine and set up your lighting, and your material for the mesh sequence.
  5. Save your file!
  6. Render animation (Ctrl-F12)
  7. Drink coffee/check mail while it renders.
  8. Blender crashes anywhere between 1 and 600 frames rendered.

Expected behavior All frames should render and Blender should not crash.

Comments There should be no shortage of memory since the cache mode is "Streamed" and the cache size is set to "1".

neverhood311 commented 1 year ago

Drink coffee/check mail while it renders.

😃

Blender crashes randomly while rendering animation of a streamed mesh sequence.

This is a known issue and it's been very difficult to debug, unfortunately. I mention it in the Stop Motion OBJ wiki here and it's also an issue known to the Blender FLIP Fluids addon developers (see here). The problem with tracking this bug down is that it shows up at random. Sometimes it works fine, other times it crashes.

Stop Motion OBJ already does what it can to reduce the likelihood of these crashes (it enables Render > Lock Interface), but it's not perfect.

The only additional advice I can give is to make sure to render to a PNG sequence so you don't lose the entire render, then re-render, having Blender pick up where it left off (make sure that Output Properties > Output > Image Sequence > Overwrite is un-checked)

Arnache commented 1 year ago

This is a known issue and it's been very difficult to debug, unfortunately.

OK thanks for the details and advice. I do have the Lock Interface option on indeed, and I am rendering PNG's, regularly reloading the file to restart the render where it crashed. On the other addon's page you indicated they mention "At the moment the cause is understood to be a design problem in Blender.". I hope they will figure this out, eventually. Usually I do overnight renders but here this is impossible (It would take 10 nights instead of 1).

I will give command-line render a try: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Rendering-from-the-Command-Line

Arnache commented 1 year ago

I tried command-line rendering and it worked without any flaw:

blender -b file.blend -a

So this is a fix to my problem, while we wait for Blender to fix itself.

neverhood311 commented 1 year ago

Fantastic! Thanks for trying this out.

QiruiFU commented 5 months ago

I tried command-line rendering and it worked without any flaw:

blender -b file.blend -a

So this is a fix to my problem, while we wait for Blender to fix itself.

It does work! Thanks for saving me from crashing blender!