No More Retake

3DCG屋さん向けTips&Referenceサイト

メニュー

アトリビュートのコネクト by pymel

pymelでは、オペレータを使ってもアトリビュートがコネクトできるらしい。
忘れないうちに書いておこう。

簡単な例として、CubeとSphereを作成し、それぞれのTranslateをコネクトするスクリプト。

#モジュールの読み込み
import pymel.core as pm</pre>
#新規でCubeとSphereを作成
cb = pm.polyCube(name='testCube')[0]
sh = pm.polySphere(name='testSphere')[0]

# connect
#CubeのTranslateをSphereのTranslateにコネクト
cb.t &gt;&gt; sh.t

# disconnect
#CubeのTranslateとSphereのTranslateのコネクトを解除
cb.tx // sh.tx

こんな書き方もあったとは、知らなかった。
コネクトの部分ををオペレータを使わずに書くと

# connect
cb.t.connect(sh.t)</pre>
# disconnect
cb.tx.disconnect(sh.tx)

以上!

関連記事

  1. 2012.05.06

    if ~in文
  2. 2014.07.07

    Maya:12.345e-006

コメントをお待ちしております

このサイトについて

3DCG Tipsサイト。Houdiniの記事が多めです。

RSS

follow us in feedly

Archives

  • 2024 (1)
  • 2023 (2)
  • 2022 (9)
  • 2021 (14)
  • 2020 (46)
  • 2019 (17)
  • 2018 (33)
  • 2017 (29)
  • 2016 (36)
  • 2015 (64)
  • 2014 (54)
  • 2013 (60)
  • 2012 (55)

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

Houdiniを使えるようになる本


Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&urls=http%3A%2F%2Fnomoreretake.net%2F2012%2F05%2F19%2F%25e3%2582%25a2%25e3%2583%2588%25e3%2583%25aa%25e3%2583%2593%25e3%2583%25a5%25e3%2583%25bc%25e3%2583%2588%25e3%2581%25ae%25e3%2582%25b3%25e3%2583%258d%25e3%2582%25af%25e3%2583%2588-by-pymel%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.b.st-hatena.com/entry.count?url=http%3A%2F%2Fnomoreretake.net%2F2012%2F05%2F19%2F%25e3%2582%25a2%25e3%2583%2588%25e3%2583%25aa%25e3%2583%2593%25e3%2583%25a5%25e3%2583%25bc%25e3%2583%2588%25e3%2581%25ae%25e3%2582%25b3%25e3%2583%258d%25e3%2582%25af%25e3%2583%2588-by-pymel%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132