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

AttributeError: 'Object' object has no attribute 'cycles_visibility' when Cycles Addon is disabled #552

Closed thegreatlettuce closed 3 years ago

thegreatlettuce commented 3 years ago

System Information

Blender Version (including hash): 2.93.1 (1b8d33b18c2f) FLIP Fluids Version: 1.1.0 stable Operating System: Win10 CPU: Intel i5 9400F 2.90GHz GFX: NVIDIA Geforce RTX 2060 RAM: 32 GB 2666Mhz DDR4

Describe the bug

I tried to set up a simple scene with an Inflow and an Obstacle to test the addon. After hitting Bake, the error below will happen and the simulation stuck after 'Exporting static data' (see screenshot).

After closing Blender and reopening it again, I could manage to run the baking process but nothing happened afterwards when the animation is played (no fluid mesh).

The simulation runs normally for the attached example scenes.

Here is the blend file.

Python: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\operators\export_operators.py", line 148, in modal
    self._export_simulation_data_file()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\operators\export_operators.py", line 101, in _export_simulation_data_file
    dprops.bake.export_success = export.export_simulation_data(
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 431, in export_simulation_data
    __export_simulation_data_to_file(context, simulation_objects, data_filepath)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 38, in __export_simulation_data_to_file
    data = __get_simulation_data_dict(context, simobjects)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 48, in __get_simulation_data_dict
    data['domain_data'] = __get_domain_data_dict(context, simobjects.domain)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 109, in __get_domain_data_dict
    d['advanced']['num_threads_auto_detect'] = dprops.advanced.num_threads_auto_detect
KeyError: 'advanced'

location: <unknown location>:-1

To Reproduce

The error happens whenever a new scene is set up.

Expected Behaviour

A description of what you expected to happen.

Actual Behaviour

A description of what actually happened.

Screenshots

Capture

rlguy commented 3 years ago

Hi, thank you for the detailed report!

Are you receiving any other error messages in the system console prior to this error? This type of error usually means that initialization of the addon was halted due to an earlier error.

thegreatlettuce commented 3 years ago

Thank you for your reply. I've just figured out that the error was caused by not enabling Cycles Render Engine addon. The full error message is pasted below for your further reference.

After enabling Cycles, I managed to bake the simulation, however, the issue now is that I'm experiencing a significant drop in fps while playing the animation (it could be as low as 3-4 fps). Is it something to do with my computer spec? or am I missing any other addons?

simulation

Full error message when Cycles is not enabled:

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 102, in <lambda>
    set=lambda self, value: self._set_object_type(value),
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 245, in _set_object_type
    active_object.flip_fluid.domain.initialize()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\domain_properties.py", line 149, in initialize
    self._initialize_cache()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\domain_properties.py", line 213, in _initialize_cache
    self.mesh_cache.initialize_cache_objects()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\objects\flip_fluid_cache.py", line 1442, in initialize_cache_objects
    self.surface.initialize_cache_object()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\objects\flip_fluid_cache.py", line 196, in initialize_cache_object
    cache_object.cycles.use_motion_blur = False
AttributeError: 'Object' object has no attribute 'cycles'
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 102, in <lambda>
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Info: Total files 0 | Changed 0 | Failed 0
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 102, in <lambda>
    set=lambda self, value: self._set_object_type(value),
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 256, in _set_object_type
    self._toggle_cycles_ray_visibility(active_object, False)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 102, in <lambda>
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Info: Successfully reset bake

Exporting Simulation Meshes:
------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
Exporting... 2 / 2 objects      (Database size: 92 kB)
Python: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\operators\export_operators.py", line 148, in modal
    self._export_simulation_data_file()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\operators\export_operators.py", line 101, in _export_simulation_data_file
    dprops.bake.export_success = export.export_simulation_data(
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 431, in export_simulation_data
    __export_simulation_data_to_file(context, simulation_objects, data_filepath)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 38, in __export_simulation_data_to_file
    data = __get_simulation_data_dict(context, simobjects)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 48, in __get_simulation_data_dict
    data['domain_data'] = __get_domain_data_dict(context, simobjects.domain)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 109, in __get_domain_data_dict
    d['advanced']['num_threads_auto_detect'] = dprops.advanced.num_threads_auto_detect
KeyError: 'advanced'

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\operators\export_operators.py", line 148, in modal
    self._export_simulation_data_file()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\operators\export_operators.py", line 101, in _export_simulation_data_file
    dprops.bake.export_success = export.export_simulation_data(
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 431, in export_simulation_data
    __export_simulation_data_to_file(context, simulation_objects, data_filepath)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 38, in __export_simulation_data_to_file
    data = __get_simulation_data_dict(context, simobjects)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 48, in __get_simulation_data_dict
    data['domain_data'] = __get_domain_data_dict(context, simobjects.domain)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\export.py", line 109, in __get_domain_data_dict
    d['advanced']['num_threads_auto_detect'] = dprops.advanced.num_threads_auto_detect
KeyError: 'advanced'

location: <unknown location>:-1

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\__init__.py", line 80, in scene_update_post
    properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\__init__.py", line 46, in scene_update_post
    object_properties.scene_update_post(scene)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 435, in scene_update_post
    obj.flip_fluid.scene_update_post(scene, obj)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 134, in scene_update_post
    self._toggle_cycles_ray_visibility(bl_object, not bl_object.hide_render)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\flip_fluids_addon\properties\object_properties.py", line 199, in _toggle_cycles_ray_visibility
    obj.cycles_visibility.camera = is_enabled
AttributeError: 'Object' object has no attribute 'cycles_visibility'
rlguy commented 3 years ago

Thank you for the update and info about the Cycles addon. I am able to reproduce this issue.

I was not aware that the Cycles renderer could be disabled and did not take this into account in a few areas of the codebase.

This issue has been fixed. Until the next experimental build is available (date TDB), I'll leave this issue open for visibility.


The low frame rate during playback is likely due to the loading process of the high geometry simulation mesh and is normal. It takes time both loading the data from HDD/SSD and time for Blender to process the data for display and management.

Hope this info helps!

rlguy commented 3 years ago

Closing. This fix is now available in the latest experimental build (v9.1.1).