mitsuba-renderer / mitsuba-blender

Mitsuba integration add-on for Blender
BSD 3-Clause "New" or "Revised" License
278 stars 36 forks source link

Importer : AttributeError: 'NoneType' object has no attribute 'data' #43

Open cococolorful opened 2 years ago

cococolorful commented 2 years ago

Impotter : AttributeError: 'NoneType' object has no attribute 'data'

Bug Description When I try to import a scene(scenes\dragon\dragon.xml) from differentiable-sdf-rendering, the first error that occurs is Cannot resolve scene relative path "textures/cathedral.hdr".I think it is because <path value="../"/> doesn't work correctly, so I move the all the files(scenes\dragon\*) directly to scenes\.The error goes away, but a new one appears.

Traceback (most recent call last):
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\__init__.py", line 61, in execute
    importer.load_mitsuba_scene(context, scene, collection, self.filepath, axis_mat)
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\__init__.py", line 393, in load_mitsuba_scene
    if not instantiate_bl_data_node(mi_context, bl_scene_data_node):
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\__init__.py", line 356, in instantiate_bl_data_node
    if not _bl_node_instantiators[node_type](mi_context, bl_node):
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\__init__.py", line 224, in instantiate_bl_scene_node
    if not instantiate_bl_data_node(mi_context, child_node):
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\__init__.py", line 356, in instantiate_bl_data_node
    if not _bl_node_instantiators[node_type](mi_context, bl_node):
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\__init__.py", line 322, in instantiate_bl_properties_node
    if not _bl_properties_node_instantiators[node_prop_type](mi_context, bl_node):
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\__init__.py", line 308, in instantiate_sampler_properties_node
    return renderer.apply_mi_sampler_properties(mi_context, bl_node.mi_props)
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\renderer.py", line 248, in apply_mi_sampler_properties
    return _mi_sampler_properties_converters[mi_sampler_type](mi_context, mi_props)
  File "C:\Users\hgx\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\mitsuba-blender\io\importer\renderer.py", line 182, in apply_mi_independent_properties
    mi_camera = mi_context.bl_scene.camera.data.mitsuba
AttributeError: 'NoneType' object has no attribute 'data'

To Reproduce Steps to reproduce the behavior:

  1. download scenes from differentiable-sdf-rendering
  2. import the xxx\scenes\dragon\dragon.xml which you will see the first error.
  3. move filesscenes\dragon\* to scenes\(I'm not sure if this is the right way to do it)
  4. See the second error

Expected behavior Load the scene correctly

Environment (please complete the following information):