UuuNyaa / blender_mmd_tools

MMD Tools is a blender addon for importing/exporting Models and Motions of MikuMikuDance.
GNU General Public License v3.0
2.27k stars 109 forks source link

RuntimeError: Operator bpy.ops.mmd_tools.import_vmd.poll() failed, context is incorrect #178

Closed gs201510 closed 1 month ago

gs201510 commented 1 month ago

What version of softwares are you using?

How to Reproduce

Steps to reproduce the behavior:

  1. I'm trying to run this code via background mode in CLI
    bpy.ops.mmd_tools.import_vmd(filepath=animation_path)
  2. See error
    Traceback (most recent call last):
    File "/Users/gs/PycharmProjects/blender-builder/render_video.py", line 77, in <module>
    main()
    File "/Users/gs/PycharmProjects/blender-builder/render_video.py", line 68, in main
    import_vmd(animation_path)
    File "/Users/gs/PycharmProjects/blender-builder/render_video.py", line 23, in import_vmd
    bpy.ops.mmd_tools.import_vmd(filepath=animation_path)
    File "/Applications/Blender.app/Contents/Resources/4.2/scripts/modules/bpy/ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Operator bpy.ops.mmd_tools.import_vmd.poll() failed, context is incorrect