瀏覽代碼

fix crash on node type check

Jason0214 6 年之前
父節點
當前提交
e24b5eae47
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      io_scene_godot/export_godot.py

+ 2 - 1
io_scene_godot/export_godot.py

@@ -125,7 +125,8 @@ class GodotExporter:
         # CollisionShape node has different direction in blender
         # and godot, so it has a -90 rotation around X axis,
         # here rotate its children back
-        if exported_node.parent.get_type() == 'CollisionShape':
+        if (exported_node.parent is not None and
+                exported_node.parent.get_type() == 'CollisionShape'):
             exported_node['transform'] = (
                 mathutils.Matrix.Rotation(math.radians(90), 4, 'X') *
                 exported_node['transform'])