rlguy / Blender-FLIP-Fluids

The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.
https://www.blendermarket.com/products/flipfluids
GNU General Public License v3.0
1.71k stars 190 forks source link

Library Override Included obstacle causes bpy error #612

Closed Tillwoofie closed 1 year ago

Tillwoofie commented 1 year ago

Hey, I looked around and didn't see this issue reported before, and don't remember seeing it before, I'll try and include as much information as I can, though if you need anything more, let me know! The version of FlipFluids I have was freshly updated today, from Blender Marketplace.

System Information

Blender Version: 3.4.1, blender-v3.4-release, 2022-12-19 17:00, 55485cb379f7 Addon Version: A FLIP Fluid Simulation Tool for Blender (v1.6.2 Stable 29-MAR-2023) OS: Windows-10-10.0.19045-SP0 GPU: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.41 CPU: AMD Ryzen Threadripper 3960X 24-Core Processor CPU Threads: 48 RAM: 128GB

Blender Binary: C:\Program Files\Blender Foundation\Blender 3.4\blender.exe Addon Path: C:\Users\Till\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\flip_fluids_addon Renderer: BLENDER_EEVEE Cycles Device: N/A Viewport Modes: SOLID Objects: 7 FLIP Objects: 3 FLIP Domains: FLIP Domain Obstacle Objects: 1 <Export Animated: 0> <Skip Re-export: 0> Fluid Objects: 0 Inflow Objects: 1 <Export Animated: 0> <Skip Re-export: 0> Outflow Objects: 0 Force Field Objects: 0 Cache Path: D:\blender bits\inc test\outerfile_flip_fluid_cache Cache Exists: True Cache Logs: N/A Simulation Visibility: Surface Visibility: Whitewater Visibility: N/A Enabled Features: Default Enabled Attributes: N/A Lock Interface: Enabled Cycles Persistent Data: Disabled Developer Tools: Enabled Mixbox Plugin: Installed Enabled Addons: 3D-Print Toolbox, Bsurfaces GPL Edition, F2, Rigify, Node Wrangler, Archimesh, Blender ID authentication, Modifier Tools, Magic UV, Bool Tool, LoopTools, Copy Attributes Menu, renderBeamer for Blender, Quad Remesher 1.2 Bridge, Extra Objects, Extra Objects, Import Images as Planes, Poliigon Addon, RetopoFlow, Extra Lights, Auto Eye, Voxel Heat Diffuse Skinning, Blender Bone Dynamics Pro, Auto-Rig Pro, FLIP Fluids 1.6.2

Describe the bug

It seems that when you have an obstacle object (this may include more FLIP Fluid types, but I know this triggers the issue), that is linked into a scene where you are going to be simulating with it. The error that pops up (and crashes the baking process) returns with the error being TypeError: bpy_prop_collection.remove() not supported for this collection I discovered this issue with a much larger project, but was able to reproduce this with just a more or less empty scene too.

I tried it on another machine with the same flip Fluids version on Blender 3.5.0 and had the same result.

It appears the only option to make this work right now is to make all the objects local ( Object -> Relations -> Make Local... ) to the file doing the simulating, however it's not quite ideal, as then there are many copies of the same objects saved on disk, and then they can differ between scenes/projects if they get changed in the main file.

To Reproduce

inc test.zip

Link an obstacle object from another .blend file into a file with a Domain, make the collection from the linked file into a library override and attempt to bake it. I have included a .zip with 2 .blend files, inctest.blend, and outerfile.blend If you open the outerfile.blend and attempt to bake the simulation, it should almost immediately give the error (since this is basically just bare default settings thrown together). Both files are very simple and have the bare minimum in them.

Expected Behaviour

Ideally being able to bake and render an animation with obstacles included from another file, so you can have premade objects with their FlipFluid settings pre-made, so they don't have to be re-done every time.

Actual Behaviour

Baking crash, requiring restart of Blender.

Screenshots

include_test

rlguy commented 1 year ago

Thanks for the report! I am able to reproduce the error with the supplied Blend files.

It looks like this issue is caused by a change between the previous FLIP Fluids 1.6.1 and the latest version 1.6.2 and is a side effect of a bug fix. The bug fix involved making a change that requires data of the FLIP Obstacle/Inflow/Outflow/Fluid/ForceField type objects to be modified before baking a simulation. Linked objects are not allowed to have their data modified, and this is what is triggering errors.

I think we may be able to add a workaround to fix this type of issue. We'll see what we can do and try to have this fixed for the next FLIP Fluids 1.6.3 version, which is planned for release in about two weeks.

Note: Linking FLIP Domain type objects will not be supported, as this type of object requires modifying its data in order for the addon to function.

Tillwoofie commented 1 year ago

Sounds good, glad I was able to help reproduce it quickly! I don't ever link in domain objects, mostly just Obstacle, Inflow, and Outflows.

I have a work-around for right now (making objects local), so it's not holding anything up.

Thanks very much for your work on the add-on and looking at this so quick!

schroef commented 1 year ago

Perhaps an idea. For an addon i did some work on, i made a small edition for when linked armatures are used. It's makes a copy of the linked armatures and puts it a new collection, only then could it be used for actions needed.

I know it's not the same object type as this addon uses, but i think the principle idea is the same. Unless you cn do library overrides on this type. I do not know if that is possible

rlguy commented 1 year ago

Thanks for the suggestion! That's a solution that I had not thought about. In our longer-term development plans we had wanted to be able to improve support for linked objects and I think this solution could work well with this idea.

rlguy commented 1 year ago

Just had a chance to add a fix for this issue. This fix will be included in the next stable release, FLIP Fluids 1.6.3 which is planned for release in about one week.