Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not usable with bpy #102

Open
Oberschnulli opened this issue May 17, 2024 · 1 comment
Open

Plugin not usable with bpy #102

Oberschnulli opened this issue May 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Oberschnulli
Copy link

Oberschnulli commented May 17, 2024

Issue Title (please complete the title by following the instructions and remove this paragraph)
I'm able to export my scene from blender to mitsuba via the GUI.
But I neet to that 4000 times and want to automate it.
Unfortunately the export via python somehow stopped working..

Bug Description
cannot export the mitsuba scene via the python terminal in blender ir by using the command line

To Reproduce
Steps to reproduce the behavior:

>>> bpy.ops.export_scene.mitsuba(filepath="test.xml")
Scene File: test.xml
Scene Folder: .
Error: Python: Traceback (most recent call last):
  File "/home/erik/.config/blender/4.0/scripts/addons/mitsuba-blender/io/__init__.py", line 138, in execute
    self.converter.dict_to_xml()
  File "/home/erik/.config/blender/4.0/scripts/addons/mitsuba-blender/io/exporter/__init__.py", line 108, in dict_to_xml
    self.xml_writer.process(self.export_ctx.scene_data)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 644, in process
    self.write_dict(self.scene_data[Files.MAIN])
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packa... truncated
Traceback (most recent call last):
  File "/home/erik/.config/blender/4.0/scripts/addons/mitsuba-blender/io/__init__.py", line 138, in execute
    self.converter.dict_to_xml()
  File "/home/erik/.config/blender/4.0/scripts/addons/mitsuba-blender/io/exporter/__init__.py", line 108, in dict_to_xml
    self.xml_writer.process(self.export_ctx.scene_data)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 644, in process
    self.write_dict(self.scene_data[Files.MAIN])
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 596, in write_dict
    value = self.format_path(value, self.current_tag())
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 534, in format_path
    copy2(filepath, target_path)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/shutil.py", line 234, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/home/erik/software/blender-4.0.0-linux-x64/textures/Thick_Eye_Texture_Inner_Baked.png' and './textures/Thick_Eye_Texture_Inner_Baked.png' are the same file
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/scripts/modules/bpy/ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/home/erik/.config/blender/4.0/scripts/addons/mitsuba-blender/io/__init__.py", line 138, in execute
    self.converter.dict_to_xml()
  File "/home/erik/.config/blender/4.0/scripts/addons/mitsuba-blender/io/exporter/__init__.py", line 108, in dict_to_xml
    self.xml_writer.process(self.export_ctx.scene_data)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 644, in process
    self.write_dict(self.scene_data[Files.MAIN])
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 581, in write_dict
    self.write_dict(value)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 596, in write_dict
    value = self.format_path(value, self.current_tag())
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/site-packages/mitsuba/python/xml.py", line 534, in format_path
    copy2(filepath, target_path)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/erik/software/blender-4.0.0-linux-x64/4.0/python/lib/python3.10/shutil.py", line 234, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/home/erik/software/blender-4.0.0-linux-x64/textures/Thick_Eye_Texture_Inner_Baked.png' and './textures/Thick_Eye_Texture_Inner_Baked.png' are the same file
Location: /home/erik/software/blender-4.0.0-linux-x64/4.0/scripts/modules/bpy/ops.py:109

Environment (please complete the following information):

  • OS: [Linux]
  • Blender Version: [4.0.0]
  • Add-on Version: [latest]
@Oberschnulli Oberschnulli added the bug Something isn't working label May 17, 2024
@Oberschnulli Oberschnulli changed the title <Subject>: <Bug Summary> Plugin not usable with bpy May 17, 2024
@merlinND
Copy link
Member

Hello @Oberschnulli,

Given the error message:

shutil.SameFileError: '/home/erik/software/blender-4.0.0-linux-x64/textures/Thick_Eye_Texture_Inner_Baked.png' and './textures/Thick_Eye_Texture_Inner_Baked.png' are the same file

It seems like a problem related to the particular scene or sequence of scenes that you are trying to export. A minimal reproducer script + the input scenes will likely be needed to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants