擅长:python、mysql、java
<p>您还可以查看本教程:</p>
<p><a href="http://www.creativecrash.com/tutorials/using-eclipse-as-a-maya-ide" rel="nofollow noreferrer">http://www.creativecrash.com/tutorials/using-eclipse-as-a-maya-ide</a>(最相关的部分可在链接页面的“第2页”选项卡上找到)。基本上,您需要将Eclipse的“预定义”指向/devkit/other/pymel/extras/completion/pypredef</p>
<p><img src="https://i.stack.imgur.com/8h4u0.png" alt="pypredef"/></p>
<p>只要(a)使用的是2.6解释器和(b)eclipse PYTHONPATH中有maya python目录,则示例应该可以正常工作:</p>
<p><img src="https://i.stack.imgur.com/lH8HP.png" alt="enter image description here"/>
将eclipse配置为使用/bin通常是最容易的/玛雅皮.exe作为玛雅人的智慧。你可能会发现它更容易使用</p>
<pre><code>import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
pc = cmds.polyCube()
</code></pre>
<p>除非已经初始化,否则cmds模块导入为空maya.独立-您的示例显示了这一点,但可能您在之前的运行中遇到了该错误独立。初始化()? 在</p>