适用于 Maya 和其他 3D 应用程序的 Python 版本

发布于 2024-09-26 06:21:05 字数 90 浏览 6 评论 0原文

我有几个小项目,我想用它们来学习 python。如果我想稍后转向 Maya、Blender 等脚本编写,我应该使用什么版本?另外,有哪些资源可用于为这些程序编写脚本?

I have a couple small projects that I want to use to learn python. What version should I be using if I want to move to scripting for Maya, Blender, etc later? Also, what resources are there for scripting for those programs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尹雨沫 2024-10-03 06:21:05

如果您使用的是 Maya 2011,它已与 py 2.6.4 捆绑并绑定。您不需要单独安装,甚至 pyMEL 也不需要。

如果您想在将知识应用到 3D 应用程序之前先学习 Python,那么几乎任何 2.x Python 都可以,如果您刚开始,版本特定的功能只会在一段时间内发挥作用。
2.6.4 当然是一个不错的选择,因为它将与您可能在 Maya 和 Softimage 中使用的内容保持一致。

现在远离 py3k,因为在我们的领域采用似乎还有很长的路要走。

至于资源,对于 Python 和 Maya 来说,几乎没有,但到目前为止,我所见过的大多数面向编程的材料(除了古尔德的材料等少数值得注意的例外)通常介于平庸和纯粹的业余之间。

你最好有一本像样的入门级书籍,不要假设读者是白痴(我仍然对 O'Reilly 的 Python 学习评价很高),像 StackOverflow 这样的网站可以解决惯用问题,并进行大量的练习和浏览当涉及到 Maya 脚本 API 的细节时,进行必要的心理联系和练习。

尽早查看 pyMEL,因为它现在是捆绑的,也不会有什么坏处。
默认的、旧的 Maya 命令和类似于 mel 包装器的模块确实很糟糕,并且与 Pythonic 相去甚远。
pyMEL 虽然不是 100% 的实现,但具有更强的面向对象能力,读起来不像一大群猴子突然操作打字机。

If you are using Maya 2011 it comes bundled with and bound to py 2.6.4 already. You don't need a separate install, not even for pyMEL anymore.

If you want to learn Python on its own before applying the knowledge to a 3D app, then pretty much any 2.x Python will do really, the version specific features only come into play a while away if you're at your first steps.
2.6.4 though would of course be a good choice, as it will be aligned to what you might be using in Maya and Softimage right out of the gate.

Stay away from py3k for now as adoption in our field seems to be a long way away still.

As for resources, for Python and Maya together, close to nothing, but most of the programming oriented material I've seen published insofar, with only a handful of notable exceptions such as Gould's material, is usually between underwhelming and plain amateurish.

You're better off with a decent entry level book that doesn't assume the reader is drooling idiot (I still rate O'Reilly's learning Python very highly), sites like StackOverflow for idiomatic questions, and a lot of practice and browsing to make the necessary mental connection and exercise a bit when it comes to the specifics of the Maya scripting API.

Having a look early at pyMEL, since it's now bundled, also won't hurt.
The default, old maya commands and mel wrapper-like modules are truly atrocious and as far from Pythonic as they could make them.
pyMEL, while not 100% of the way there, has a stronger object orientation and doesn't read like a large population of monkeys was suddenly handled typewriters.

我家小可爱 2024-10-03 06:21:05

根据这篇文章,Maya 2011 使用Python 2.6。 4.当然,早期版本的 Maya 很可能会使用早期版本的 Python,反之亦然(可能;-)对于较新版本的 Maya(据我所知尚不存在;-)。

此页面(我现在无法阅读,也许是 blender. org 已关闭)显示,适用于 Windows 的 Blender 2.49b 是使用 Python 2.6 构建的,适用于 Linux、Irix 和 Solaris 则没有说明,适用于 MacOSX 的 PowerPC 需要 Python 2.3,适用于 MacOSX 的 intel 2.3 或 2.5。

如果您想尝试 Blender 2.5.4 beta,请参阅链接文本 --但没有提及 Python 版本。

“etc”不是我听说过的任何“3d 应用程序”的名称。

IOW,答案取决于您想要使用的 3D 程序的版本!对于最近的 Maya 和 Blender,Python 2.5 得到了相当可靠的保证(除了 MacOSC 上仅适用于 PowerPC 的 Blender 2.49b,您仅限于 Python 2.3); Python 2 的更高版本努力与早期版本保持高度兼容,因此即使您使用的是基于(例如)Python 2.6 的 3d 应用程序,只要您知道如何使用 Python 2.5 并坚持下去,您仍然应该很好(但反之则不然——如果你只知道如何使用 Python 2.6,当你需要在 2.5 或更早版本中做某事时,你可能会遇到麻烦;-)。

According to this post, Maya 2011 uses Python 2.6.4. Of course, earlier versions of Maya may well use earlier versions of Python, and vice versa (probably;-) for later versions of Maya (that do not yet exist AFAIK;-).

This page (which I can't read right now, maybe blender.org is down) shows that Blender 2.49b for Windows was built with Python 2.6, for Linux, Irix and Solaris doesn't say, for MacOSX for PowerPC requires Python 2.3, for MacOSX for intel 2.3 or 2.5.

If you want to try Blender 2.5.4 beta, see link text -- no mention of Python versions though.

"etc" is not the name of any "3d app" I've ever heard of.

IOW, the answer will depend on what version(s) of what 3d program(s) you want to use! Python 2.5 is pretty solidly guaranteed for reasonably recent Maya and Blender (except, for Blender 2.49b on MacOSC for PowerPC only, you're limited to Python 2.3); later versions of Python 2 strive to remain highly compatible with earlier ones, so even if you're on a 3d app based (say) on Python 2.6, as long as you know how to use Python 2.5 and stick to that you should still be fine (but not viceversa -- if you only know how to use Python 2.6, you may be in trouble when you need to do something in 2.5 or earlier;-).

甜妞爱困 2024-10-03 06:21:05

我会说Python版本没有太大区别。正如其他人提到的,ThE_JacO 不涉及流行的 3D 应用程序。 Maya、Pixar 的 RenderMan、Houdini、Blender、Realflow...都具有 Python 2.x 绑定。对于 Python 2.4、2.5 和 2.6,函数接口很少有差异。你可以忽略这个问题。

在我们的工作室中,我们编写 Python 脚本以在 2.4、2.5 和 2.6 中工作,因为我们在不同的动画项目上使用不同的 3D 应用程序版本。有一些代码片段需要进行修改才能使其正常工作,但它们确实是小问题。

I will say that there is no big difference for Python version. Just like others mentioned, ThE_JacO does not involved in popular 3D apps. Maya, Pixar's RenderMan, Houdini, Blender, Realflow, ... all have Python 2.x binding. For Python 2.4, 2.5, and 2.6, there is rare difference in function interfaces. You can just ignore this issue.

In our studio, we code Python scripts to work in 2.4, 2.5 and 2.6 because we uses different 3D apps version on different animation projects. There are some code snippets need modulation to make it all work well but they are really minor issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文