No More Retake

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

メニュー

Houdini:Python memo Part03

Houdini Python、ダイアログ系のサンプル。
シェルフにでも張り付けてポチると出てくる・・・たぶんね。

ポップアップメッセージ

hou.ui.displayMessage("hoge")

HoudiniPython_07

テキストフィールド付きダイアログ

import hou

Dialog = hou.ui.readInput(message ="Text Field Dialog\n",title = "TextField Dialog",severity=hou.severityType.Warning,buttons=["Accept","Cancel"])

if Dialog[0]==0:
    hou.ui.displayMessage(Dialog[1], buttons=('OK','NO',))

 

テキストフィールド付きダイアログ(Multi)

import hou

Dialog = hou.ui.readMultiInput(message ="Multi Text Field Dialog\n",input_labels = [" text1"," text2"," text3"," text4", " text5"],
title = "Multi TextField Dialog",initial_contents =['watashi','ha','houdini','choto','dekiru'],buttons=["Accept","Cancel"])

#Dialog[0]-button, Dialog[1]-textfield
if Dialog[0]==0:

    Namespace = Dialog[1];

    sTextA = Namespace[0]
    sTextB = Namespace[1]
    sTextC = Namespace[2]
    sTextD = Namespace[3]
    sTextE = Namespace[4]

sNewText = "{} {} {} {} {}".format(sTextA,sTextB,sTextC,sTextD,sTextE)

hou.ui.displayMessage(sNewText, buttons=('OK','NO',))

 

List Selection ダイアログ

list = ["text1","text2","text3","text4"]
Dialog = hou.ui.selectFromList(list, message='Select!!')

if len(Dialog)!=0:
    for i in Dialog:
        hou.ui.displayMessage(list[i] , buttons=('OK','NO',))

 

Node Selectionダイアログ

oNode = hou.ui.selectNode()

hou.ui.displayMessage(oNode, buttons=('OK','NO',))

 

File Selectionダイアログ

oFile = hou.ui.selectFile()

hou.ui.displayMessage(oFile, buttons=('OK','NO',))

 

関連記事

  1. 2017.08.09

    Houdini:COINS

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

このサイトについて

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

RSS

follow us in feedly

Archives

  • 2024 (4)
  • 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%2F2018%2F09%2F08%2Fhoudinipython-memo-part03%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%2F2018%2F09%2F08%2Fhoudinipython-memo-part03%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