This entry was posted on 土曜日, 5月 10th, 2008 at 11:33:19 and is filed under Maya, python. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


pymel
Pymel Python Module - Syntax / Scripting Tools for Maya
http://www.highend3d.com/maya/downloads/tools/syntax_scripting/Pymel-4844.html
maya pyhtonのラッパー
maya pythonをよりpythonぽい書き方でかけます
maya python:
import maya.cmds as mc nodes = mc.ls(sl=1) mc.connectAttr(nodes[0]+".sx", nodes[1]+".sx") pos = mc.getAttr(nodes[0]+".t") mc.setAttr(nodes[1]+".t", pos[0][0], pos[0][1], pos[0][2])
pymel:
from pymel import * nodes=ls(sl=1) nodes[0].sx >> nodes[1].sx pos = nodes[0].translate.get() nodes[1].translate = pos
うん、mayaPythonでgetAttrしたときタプルの中の配列として返すのは仕様としておかしいと思うわ
便利なのは分かるんですけど
こういうものってデフォルトで用意されてないと仕事で使う気がしないんですよねー
でもこの書き方はかなり魅力的
オブジェクトのメソッドでgetとかsetとかするのがやっぱりしっくりくるし
connectAttrの書き方も直感的で良いです
昨日は久々にたくさんのコードを書いた。
UIをゼロから作ったんで無駄にformLayoutに行数かかっただけなんだけど
なんとも無駄な事をしているなぁ
とにかくキーボードを打つ回数を減らしたい
2 Responses to “pymel”
Leave a Reply

5月 14th, 2008 at 13:12:36
pymel、かなり良い感じに見えるんですが、
これがデフォルトだといいんですけどね、、に尽きます。。
でもこれなら仕事で使いたいなぁ、と思います。
5月 15th, 2008 at 20:03:39
MayaPythonを使ってると
ホントにpymelが欲しくなりますね!
最近OpenMayaをちょっと使ってるんですけど
もっとOOPっぽくかけないかな~って思います