Created
March 29, 2014 10:13
-
-
Save fereria/9851859 to your computer and use it in GitHub Desktop.
UIからの値取得方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def ButtonSakusei(): | |
WindowName = pm.window(t = "gomi") | |
pm.columnLayout() | |
pm.text(label="gomigomi") | |
pm.separator( w = 250, h = 10) | |
pm.text(label="gomigomigomi") | |
nn = pm.floatField(v=10) | |
#ボタンを押したときに、Pushを呼び、引数で floatFieldのオブジェクトを渡します。 | |
#commandを書くときはCallbackを使います(詳細はHelpにて) | |
pm.button(label='Button 1', command = pm.Callback(Push,nn)) | |
pm.showWindow() | |
#ボタンを押したときの動作 | |
#*args というのは、可変引数と行って、引数の数が固定ではない場合に使用します。 | |
def Push(*args): | |
val = args[0].getValue() | |
print val | |
pm.polyCube(w=val,h=val,d=val) | |
ButtonSakusei() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment