Moguri / blend2bam

A CLI tool to convert Blender blend files to Panda3D BAM files
MIT License
66 stars 17 forks source link

blend file with shape keys and modifier causes crash #80

Closed mina-skunk closed 1 year ago

mina-skunk commented 1 year ago

error

RuntimeError: Error: Modifier cannot be applied to a mesh with shape keys

steps

Blender 3.5.1 (hash 6ee8aa4997ee built 2023-05-06 00:20:19) Read prefs: /home/will/.config/blender/3.5/config/userpref.blend Failed to open dir (No such file or directory): /run/user/1000/gvfs/ Reloading external rigs... Reloading external metarigs... Read blend: /home/will/source/my-panda-py/models/low_poly_cat.blend Error: Modifier cannot be applied to a mesh with shape keys Traceback (most recent call last): File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blend2gltf/../blender_script_common.py", line 34, in convert_files convertfn(settings, src, dst) File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blend2gltf/blender28_script.py", line 168, in export_gltf prepare_meshes() File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blend2gltf/blender28_script.py", line 153, in prepare_meshes bpy.ops.object.modifier_apply(modifier=modifier.name) File "/usr/share/blender/3.5/scripts/modules/bpy/ops.py", line 113, in call ret = _op_call(self.idname_py(), None, kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Error: Modifier cannot be applied to a mesh with shape keys

Failed to convert /home/will/source/my-panda-py/models/low_poly_cat.blend to gltf Traceback (most recent call last): File "/home/will/.local/lib/python3.11/site-packages/blend2bam/cli.py", line 88, in convert src2tmp.convert_single(srcfile, tmpfile.name) File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blend2gltf/init.py", line 47, in convert_single self.convert_batch(srcroot, dstdir, files) File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blend2gltf/init.py", line 62, in convert_batch blenderutils.run_blender_script(self.script_file, args, blenderdir=blenderdir) File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blenderutils.py", line 29, in run_blender_script run_blender( File "/home/will/.local/lib/python3.11/site-packages/blend2bam/blenderutils.py", line 25, in run_blender subprocess.check_call(binpath + ['--background'] + args, stdout=None)#subprocess.DEVNULL) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['blender', '--background', '-P', '/home/will/.local/lib/python3.11/site-packages/blend2bam/blend2gltf/blender28_script.py', '--', '/tmp/tmplz3ucz1r', '/home/will/source/my-panda-py/models', '/tmp', '/home/will/source/my-panda-py/models/low_poly_cat.blend']' returned non-zero exit status 1.

Failed to convert all files

mina-skunk commented 1 year ago

moved to Moguri/panda3d-gltf#121

Moguri commented 1 year ago

I am going to reopen this one since (based on the error output) it is a blend2bam issue and not panda3d-gltf.