我正在使用自动Blender python脚本,我想知道如何在发生异常时使用退出代码1终止它.
问题似乎是即使python脚本失败,来自blender的退出代码也始终为0.
以下脚本肯定会生成非零退出代码,但是blender会将退出代码设置为0
def main():
raise Exception("Fail")
sys.exit(1)
Run Code Online (Sandbox Code Playgroud)
我也尝试了--python-exit-code命令行参数,但没有效果:
C:\blender.exe --python-exit-code 2 --disable-abort-handler -P bake.py
Run Code Online (Sandbox Code Playgroud)
这给出了稍好的结果,因为我得到以下消息:
Error: script failed, file: 'bake.py', exiting with code 2.
Run Code Online (Sandbox Code Playgroud)
不幸的是退出代码仍为0.
任何人都可以通过一些解释或解决方案来启发我如何使用正确的退出代码退出流程?
非常感谢任何提示!
我在故障上编写了一个演示场景来测试我在a-frame中输出的gltf模型,但是我在控制台中遇到错误:
我的代码
<!DOCTYPE html>
<html>
<head>
<title>Basic Scene - A-Frame</title>
<meta name="description" content="Basic Scene - A-Frame">
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<a-asset-item id="gltfDemo" src="https://cdn.glitch.com/a3c2afff-dcc6-4918-bb73-5716b35f39b0%2Fexport.gltf?1499844855169"></a-asset-item>
<a-asset-item id="buffer_0.bin" src="https://cdn.glitch.com/a3c2afff-dcc6-4918-bb73-5716b35f39b0%2Fbuffer_0.bin?1499844851189"></a-asset-item>
<a-asset-item id="buffer_1.bin" src="https://cdn.glitch.com/a3c2afff-dcc6-4918-bb73-5716b35f39b0%2Fbuffer_1.bin?1499844853034"></a-asset-item>
</a-assets>
<a-entity gltf-model="#gltfDemo"></a-entity>
<a-sky color="#000"></a-sky>
<a-light type="ambient" color="#445451"></a-light>
<a-plane color="#050" rotation="-90 0 0" height="100" width="100"></a-plane>
<a-camera>
<a-cursor color="#FAFAFA"></a-cursor>
</a-camera>
</a-scene>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
错误:
VM1762:1 Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at e.parse (GLTFLoader.js:68)
at GLTFLoader.js:32
at three.js:29160
Run Code Online (Sandbox Code Playgroud)
源文件: Glitch Fiddle包含源文件
我有一种感觉,我错误地将gltf导入故障或以错误的方式使用它.有谁能够帮我?
支持哪些浏览器?
我可以在哪些手机上使用该应用程序?
它在哪些设备上运行最佳,或者如何获得最佳效果?
我可以使用哪些VR设备?