问题描述
我在Mac(OS 10.9.2)上使用Blender 2.7,并且无法正常打开控制台.如果我打开blender.app/Contents/MacOS/blender,会出现一个新的终端窗口,但其中充满了清晰可辨的字符,例如œ˙Ì˛Ä&àÖÄH__PAGEZERO__TEXTÃÃ". Blender也不会在其中记录任何打印语句或错误.
I'm using Blender 2.7 on my mac (OS 10.9.2) and the console won't properly open. If I open blender.app/Contents/MacOS/blender, I get a new terminal window, but it's full of a mix of legible and illegible characters such as "œ˙Ì˛Ä&àÖÄH__PAGEZERO__TEXTÃÃ". No print statements or errors will log there from Blender, either.
有人知道怎么回事吗?
谢谢!
我也是终端机的新手,并试图使用/Contents/MacOS目录:P中的开放式搅拌器".如果您从父目录中键入"./blender",它就可以正常工作.
I'm also new to terminal and was trying to use "open blender" from the /Contents/MacOS directory :P. If you type "./blender" from the parent directory, it works just fine.
如果任何人都可以了解正在发生的事情,或者键入"./filename"和"open filename"之间的区别,那真是太棒了.
If anyone could shed some light on what's happening or what the difference between typing "./filename" and "open filename" is, that would be awesome.
推荐答案
Blender需要运行各种资源,这些资源与二进制文件位于同一文件夹中,当您启动Blender时,它会从当前工作目录开始以查找它们
Blender has various resources it needs to run that are located in the same folder as the binary, it starts with the current working directory to find them when you start blender.
在正在键入命令的终端中,有一个搜索命令的顺序(在PATH变量中定义),在命令前加上./
表示要在当前工作目录中而不是在命令目录中运行该命令.在PATH列表中进行搜索.
In the terminal you are typing commands, there is a sequence (defined in the PATH variable) to where the command is searched for, prefixing the command with ./
is saying to run the command in the current working directory instead of searching through the PATH list for it.
打开命令的目的是在合适的编辑器中打开可编辑文件,似乎可以使用终端进行处理,只是新终端将在您的主目录中启动,从而使搅拌器无法找到它.资源.自从我使用OSX已有几年了,但它可能还试图将Blender Binary作为Shell脚本运行.不管哪种方式,open都不处理可运行的二进制文件,也不是专门为处理可运行的二进制文件而设计的.
The command open is meant to open editable files in a suitable editor, it would appear that it gets the idea that it can be handled with the terminal, except the new terminal will start in your home directory leaving blender unable to find it's resources. It's been a few years since I used OSX but it may also be trying to run the blender binary as a shell script. Either way open doesn't handle runnable binaries and isn't designed to.
所以区别在于open blender
就像是要编辑文件,而./blender
实际上是从命令行运行应用程序.
So the difference is that open blender
is like saying that you want to edit the file, but ./blender
is actually running an application from the command line.
您可能还发现创建一个Applescript告诉终端更改工作目录并启动Blender相当容易.可以轻松地将其另存为可从查找器启动的应用程序.我认为(未测试)-
You may also find it fairly easy to create an applescript that tells the terminal to change the working directory and start blender. This can easily be saved as an application you can start from the finder. Which I think would be (untested) -
tell application "Terminal"
do script "cd /Applications/blender/blender.app/Contents/MacOS && ./blender"
end tell
如果您只想在运行脚本时输出python输出,则可以尝试此处的脚本-它使您可以在Blender的python控制台中运行脚本以捕获输出.
And if all you want is the python output when you run your scripts you may want to try the script here - it lets you run a script in blender's python console to catch the output.
如果您希望使用Python脚本为Blender提供特定的帮助,请访问 blender.stackexchange
When you want blender specific help with python scripting ask at blender.stackexchange
这篇关于Blender 2.7 MacOS控制台错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!