Maya教程之Maya’s programming languages——关于《Maya的编程语言》
白羽 2018-08-09 来源 :网络 阅读 1193 评论 0

摘要:本文将带你了解Maya教程之Maya’s programming languages——关于《Maya的编程语言》,希望本文对大家学Maya有所帮助

        本文将带你了解Maya教程之Maya’s programming languages——关于《Maya的编程语言》,希望本文对大家学Maya有所帮助


Maya’s programming
languages







by jason















It seems like
there are more and more posts, queries, and threads about Maya’s
different scripting languages. I figure it’ll be nice to have a
nice listing of the languages, their benefits and uses.
Here is a quick
breakdown:
MEL:
Entire application is basically
written in MEL
Super simple, easy to learn
Very limited in data-structures and
code complexity
Most training material available
King of the 3D scripting languages,
really
maya.cmds:
Python syntax of entire MEL command
base
Still command-based as opposed to
OOP-based
Can import any python module
Has access to most of Maya API as
python syntax
Simplest, safest, most robust option
for Maya
PyMEL:
‘Pythonic’ wrapper for all of
maya.cmds and MEL
True OOP
Code scales well
Tons of utility functions
The sweet spot, for sure
MRV:
‘Pythonic’ wrapper for C++ API
True API formatted syntax
For programmers who’d like to
prototype faster
API:
C++ language for much of Maya
Create custom locators, deformers,
nodes, etc.
Not intended for scripting
procedures
The serious-end of things
There are
performance issues with each language but in my experience, speed
is not an issue in all but a few cases (iterating through lots of
verts or polys, etc.)
The great thing
is that you can actually use all of these languages together, at
the same time, in the same script if you want to.
 A python script can import maya.cmds and PyMEL
(though they stomp on each other a bit, so you’d have to import
into seperate namespaces if you really wanted to use both), PyMEL
has a mel call for special mel cases, both have access to most of
the API via python; and you can import MRV too, if needed.
For noobs, I’d
hop straight into maya.cmds and then expand your knowledge out to
the other options as needed.
Ping me for
glaring omissions, thanks.



似乎有越来越多的关于Maya不同脚本语言的帖子,如查询或线程。我认为,有一个语言编程对比列表会很有好处,关于他们的好处和用途。

以下是快速细分:

MEL:
整个应用程序基本上都用MEL编写;
超级简单,易学;
数据结构和代码复杂性非常有限制;
大量的培训材料可供使用;
是最好的3D脚本语言,真的;

maya.cmds:
整个MEL命令库的Python语法化;
仍然是基于命令的,而不是基于OOP面向对象的;
可以导入任何python模块;
像python语法一样可以使用大部分的Maya API;
对于Maya编程是最简单,最安全,最强健的选择;

PyMEL:
是所有maya.cmds和MEL的python风格化“Pythonic”包装(wrapper);
真正OOP面向对象编程;
代码规模等级很好;
大量有用的函数;
有可爱的亮点地方,当然;

MRV:(很少用到)——可以用-OpenMaya-Maya Python API 2.0


MRV is a python framework based on wrapping the Maya API to speed
up development and ease of use within pipelines using Autodesk
Maya.


MRV是一个基于包装Maya API的python框架,可以使用Autodesk
Maya加快管道内的开发和易用性。
对C ++ API的python风格化“Pythonic”包装;
真正的 API格式化语法;
适合想要更快原型的程序员;

API:
使用C ++语言优化Maya;

创建自定义定位器locator,变形器deformers,节点nodes等;
不适用于脚本程序;
一些严重要的事情上;



每种语言都存在性能问题,但根据我的经验,一般情况下速度是一个不必在乎的问题,只是在某些情况下(通过大量的verting或者poly等来迭代)比较在乎。

更重要的事情是,如果你想的话,可以同时在同一个脚本中将所有这些语言放一起使用。一个python脚本可以导入maya.cmds和PyMEL(尽管会存在一点他们彼此重写覆盖的风险,所以,如果你真的想同时导入使用这两个模块脚本,你就必须导入到单独的命名空间里加以区分),PyMEL有一个mel命令调用特殊的mel
case通过python访问大部分的API; 如果需要,您也可以导入MRV。

对于菜鸟(noobs),我会建议直接使用maya.cmds,然后根据需要,随着您的知识扩展而做出其他选择。    

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标常用软件之Maya频道!

本文由 @白羽 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程