Create a custom Python tool with UI

 


These day's nobody doubts that the ability to write even simple scripts it's a huge benefit for a CG artist. Why then it's not that common for artists to be able to code? Probably there is only one main reason: people thinking that coding is hard and requires a special gift. But this is not the case, anybody can build programs that will make their life way easier.

Follow this tutorial and you will get the knowledge on how to build your own production tools!

We will build from scratch a custom tool which does not have extraordinary functionality but will serve as an example template to solve many real tasks you may face in production. Starting from the basic functionality we will extend it with a User Interface, set up as a Shelf Tool and finally create a wrapper to launch Houdini within a custom environment.

This tutorial does not require any Python knowledge to follow the steps.

 

コメント

  • Podr 5 年, 11 ヶ月 前  | 

    Hi, Kiryha.
    Thx for this lesson.

    I stuck on printing custom text from uiGeoCreator.
    For me works only third version "we can grab user text from UI directly in buttonClicked() function"
    In two other cases, it doesn't grab user text but uses only default text from uiGeoCreator.ui

    • kiryha 5 年, 10 ヶ月 前  | 

      Hi, Podr!
      Sorry for the late reply, there is no comments notification system here (I guess). If you are still in trouble just e-mail me to kiryha@gmail.com

  • lor 4 年, 3 ヶ月 前  | 

    I am stuck at adding qt Designer .ui file into Python source editor.

    I use the code
    import hou
    from PySide2 import QtCore, QtUiTools, QtWidgets

    class GeoCreator(QtWidgets.QWidget):
    def __init__(self):
    super(GeoCreator,self).__init__()
    ui_file = 'C:/geo_create.ui'
    self.ui = QtUiTools.QUiLoader().load(ui_file, parentWidget=self)
    self.setParent(hou.ui.mainQtWindow(), QtCore.Qt.Window)

    win = GeoCreator()
    win.show()

    But I only get a blank window. Houdini 18.0.532, python 3.8.1 and QT Designer 5.14.1

  • Alex Amos 1 年, 8 ヶ月 前  | 

    I've been doing something similar with tkinter, but have some problems where sliders don't update in real time, in-fact none of it does, if my UI is open, Houdini is frozen, how do I get around this?

  • rmon61 1 年, 4 ヶ月 前  | 

    I am also getting the blank window open and Houdini getting frozen.

  • rmon61 1 年, 4 ヶ月 前  | 

    my mistake oops it is working

Please log in to leave a comment.