davidejones / alternativa3d_tools

Blender addon to import and export alternativa3d files. See http://alternativaplatform.com for more information on the file types and its uses.
http://davidejones.com
20 stars 8 forks source link

Support blender 2.8/2.9 #5

Open nguyenbs opened 3 years ago

nguyenbs commented 3 years ago

Please do support for newest versions of Blender

davidejones commented 3 years ago

@nguyenbs I haven't tried the latest versions. Do you have any example of the error or issue with it?

davidejones commented 3 years ago

@nguyenbs I tried using the 2.8 and above and see the issues. I think at this point the code needs to be completely rewritten.

In the meantime i hacked something together so you can do a basic import in the newer version. You can try using the io_alternativa3d_tools.py in the branch davidejones/280-support.

For the longterm I might take a look at rewriting this addon its really just depends on how much freetime i have and how much interest there even is in this addon anymore.

Pyogenics commented 1 year ago

I'm aware this isn't really maintained but on blender 3.6.0 (lol), using the sample a3d files provided with this repo, it creates errors when importing anything. sprite.a3d:

Python: Traceback (most recent call last):
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 2873, in execute
    A3DImport2(file,Config)
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 2951, in A3DImport2
    a3d2.render()
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 4640, in render
    sprite.render(materials,maps,images)
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 8108, in render
    mtex = surf_mat.texture_slots.add()
           ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Material' object has no attribute 'texture_slots'

LOD.a3d copies.a3d linkedcopies.a3d:

Python: Traceback (most recent call last):
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 2873, in execute
    A3DImport2(file,Config)
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 2951, in A3DImport2
    a3d2.render()
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 4634, in render
    mesh.render(ibuffers,vbuffers,materials,maps,images)
  File "/home/mark/.config/blender/3.6/scripts/addons/io_alternativa3d_tools.py", line 5783, in render
    me.vertices[i].normal=norms[i]
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: bpy_struct: attribute "normal" from "MeshVertex" is read-only

Might see if I can fix these various issues myself perhaps? I don't think I will be needing the a3d format since the a3d engine can import other formats just fine but this seems like an interesting thing to tinker with. I assume that the main issues come from API changes in blender.

davidejones commented 1 year ago

@Pyogenics I'm always surprised when someone is using this still! So I had started a larger rewrite of this after the initial comment but didn't get very far because of other work.

I'll see if i can throw together something hacky to make it work in 3.6.0

davidejones commented 1 year ago

Hey @Pyogenics If you want to try out this test branch I made using blender 3.6.1 it may work a little better. https://github.com/davidejones/alternativa3d_tools/tree/davidejones/361-support

Pyogenics commented 1 year ago

Yes, it seemingly worked.