VRM-Addon-for-Blender icon indicating copy to clipboard operation
VRM-Addon-for-Blender copied to clipboard

Bug report : バグ報告

Open MafioLive opened this issue 2 years ago • 2 comments

Describe the bug :バグについて Unable to export VRM File

To Reproduce:バグの再現方法 Steps to reproduce the behavior: Was Working on my model and i went to export it. then i got a python error

Expected behavior:期待する動作 Expected to export successfully

  • OS: Win10
  • Blender 2.93.2
  • Addon Version 1_13_0

Blenders Reported Error: Python: Traceback (most recent call last): File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\VRM_Addon_for_Blender-1_13_0\io_scene_vrm\exporter_init_.py", line 60, in execute vrm_bin = glb_obj.convert_bpy2glb("0.0") File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\VRM_Addon_for_Blender-1_13_0\io_scene_vrm\exporter\glb_obj.py", line 96, in convert_bpy2glb self.mesh_to_bin_and_dic() File "C:\Users\Name\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\VRM_Addon_for_Blender-1_13_0\io_scene_vrm\exporter\glb_obj.py", line 1342, in mesh_to_bin_and_dic bpy.ops.object.mode_set(mode="OBJECT") File "S:\Program Files\Blender Foundation\Blender 2.93\2.93\scripts\modules\bpy\ops.py", line 132, in call ret = _op_call(self.idname_py(), None, kw) RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect

location: :-1

MafioLive avatar Sep 06 '21 14:09 MafioLive

The exact reproduction is to cause there to be no active object. One way to do this is by executing bpy.context.view_layer.objects.active = None Another is to create and delete an object (a cube or something, really anything) right before you hit export.

As long as bpy.context.view_layer.objects.active is None when you export the VRM, this crash will occur. Fixed in #74

Silvea12 avatar Dec 21 '21 08:12 Silvea12

The fix https://github.com/saturday06/VRM_Addon_for_Blender/pull/74 is released in latest release https://github.com/saturday06/VRM_Addon_for_Blender/releases Thanks!

saturday06 avatar Dec 22 '21 15:12 saturday06