Describe the bug
if you try to import a fbx file with one bones in it from the loader, Blender will crash. If the fbx doesnt have bones, it works. If you try to import the fbx containing bones outside of the loader (directly in the script editor), it works.
this is the code used to import it. same code works from the script editor.
import bpy
def get_view3d_operator_context():
"""Adapted from several sources.
It seems like io ops needs a
specific context that if run external to the Blender console needs to
be specified
"""
for window in bpy.context.window_manager.windows:
for area in window.screen.areas:
if area.type == "VIEW_3D":
for region in area.regions:
if region.type == "WINDOW":
context_override = {
"window": window,
"screen": window.screen,
"area": area,
"region": region,
"scene": bpy.context.scene,
}
return context_override
return None
context = get_view3d_operator_context()
path = r"//path/to//scene.v006.fbx"
bpy.ops.import_scene.fbx(
context,
filepath=path,
use_manual_orientation=False,
global_scale=1.0,
use_custom_normals=True,
use_image_search=True,
use_alpha_decals=False,
decal_offset=0.0,
use_anim=False,
anim_offset=1.0,
use_subsurf=False,
use_custom_props=True,
use_custom_props_enum_as_string=True,
ignore_leaf_bones=True,
force_connect_children=False,
automatic_bone_orientation=True,
primary_bone_axis="Y",
secondary_bone_axis="X",
use_prepost_rot=True,
axis_forward="-Z",
axis_up="Y",
)
using debugpy, I noticed the crash is happening inside the following function
root_helper.build_hierarchy(fbx_tmpl, settings, scene, view_layer)
...../Blender 3.3/3.3/scripts/addons/io_scene_fbx/import_fbx.py -> line 2845
To Reproduce
Steps to reproduce the behavior:
export fbx of a cube with 1 bones
open loader, select the fbx
import into collection
crash...
Desktop (please complete the following information):
Describe the bug if you try to import a fbx file with one bones in it from the loader, Blender will crash. If the fbx doesnt have bones, it works. If you try to import the fbx containing bones outside of the loader (directly in the script editor), it works.
this is the code used to import it. same code works from the script editor.
using debugpy, I noticed the crash is happening inside the following function root_helper.build_hierarchy(fbx_tmpl, settings, scene, view_layer) ...../Blender 3.3/3.3/scripts/addons/io_scene_fbx/import_fbx.py -> line 2845
To Reproduce Steps to reproduce the behavior:
Desktop (please complete the following information):