ROMP icon indicating copy to clipboard operation
ROMP copied to clipboard

KeyError: 'bpy_prop_collection[key]: key "m_avg_Pelvis" not found'

Open lucasjinreal opened this issue 3 years ago • 4 comments

Hi, brother, I run convert blender fbx script got this error:

KeyError: 'bpy_prop_collection[key]: key "m_avg_Pelvis" not found'

why this error happens?

lucasjinreal avatar Jan 01 '22 04:01 lucasjinreal

image

the error comes from here

lucasjinreal avatar Jan 01 '22 04:01 lucasjinreal

@Arthur151 I changed gender to female, same error happens:

convert_fbx.py", line 299, in process_poses
KeyError: 'bpy_prop_collection[key]: key "f_avg_Pelvis" not found'
错误: Python 脚本失败,请检查系统控制台中的消息

lucasjinreal avatar Jan 01 '22 05:01 lucasjinreal

@Arthur151 it turns out my blender loaded more than one Armature, but still got this error even I logged out all bone names:

  armature = bpy.data.armatures[0]
    ob = bpy.data.objects['Armature.001']
    armature = ob.data
    print(armature.bones.keys())
    print(armature.name)
    bpy.ops.object.mode_set(mode='EDIT')
    # get specific bone name 'Bone'
    pelvis_bone = armature.edit_bones[bone_name_from_index[0]]
FBX version: 7400
['m_avg_root', 'm_avg_Pelvis', 'm_avg_L_Hip', 'm_avg_L_Knee', 'm_avg_L_Ankle', 'm_avg_L_Foot', 'm_avg_R_Hip', 'm_avg_R_Knee', 'm_avg_R_Ankle', 'm_avg_R_Foot', 'm_avg_Spine1', 'm_avg_Spine2', 'm_avg_Spine3', 'm_avg_Neck', 'm_avg_Head', 'm_avg_L_Collar', 'm_avg_L_Shoulder', 'm_avg_L_Elbow', 'm_avg_L_Wrist', 'm_avg_L_Hand', 'm_avg_R_Collar', 'm_avg_R_Shoulder', 'm_avg_R_Elbow', 'm_avg_R_Wrist', 'm_avg_R_Hand']
Armature.001

the bone names obvisouly have that key. why?

lucasjinreal avatar Jan 01 '22 05:01 lucasjinreal

image

lucasjinreal avatar Jan 01 '22 05:01 lucasjinreal