avoid AttributeError when panels draw.
keep material order at exporting.
fix failure when model has BDEF4 bone.