PySide2 Designer in Houdini

   2862   5   1
User Avatar
Member
16 posts
Joined: March 2020
Offline
I know this is a crazy obscure question but I figure there are plenty super-clever "python-istas" who might be able to crack this nut.

There is a copy of "designer.exe" included with every version of PySide2 installed with every version of Python in Houdini.

What is the best way for executing designer.exe?
User Avatar
Member
274 posts
Joined: July 2013
Offline
as in.. using a .ui file in a panel or just executing that specific exe for the current houdini version?
More code, less clicks.
User Avatar
Member
16 posts
Joined: March 2020
Offline
Yes! Thank you for responding Jonathan!
I wish to execute Designer to generate a .ui file which I can use to drive an interface.
I typically use the the version installed with PyQt5. However, I am trying to answer the question, "If a user did not install PyQt5 or PySide2 separately on their machine, how could they use the version of Designer installed with Houdini Python?"

Thank you for your time!
User Avatar
Member
64 posts
Joined: April 2022
Offline
import os
from PySide2 import QtCore
from PySide2.QtUiTools import QUiLoader


def load_designer_widget(file_path):
    qui_loader = QUiLoader()
    qui_loader.setWorkingDirectory(os.path.dirname(file_path))
    ui_file = QtCore.QFile(file_path)
    ui_file.open(QtCore.QFile.ReadOnly)
    widget = qui_loader.load(ui_file)
    widget.setWindowFlags(QtCore.Qt.Widget)
    return widget

I created this function to make it easier to import a designer file into Houdini
alexeyvanzhula.gumroad.com
User Avatar
Member
16 posts
Joined: March 2020
Offline
These are great!

The download is a perfect alternative and the code snippet is perfect!

Thank you, alexyvanzhula1984!
  • Quick Links